From 2b83b908ddb035e4b23281d96cc69828e0b0e676 Mon Sep 17 00:00:00 2001
From: Jerry Cooke
Date: Mon, 4 Nov 2019 21:44:20 +0000
Subject: [PATCH 01/16] [Keymap] Add keymap for user jerryhcooke (#7251)
* Add keymap for user jerryhcooke
Created a new keymap with encoder changing per layer
* Added readme
* Update readme.md
* Update readme.md
* Update readme.md
* Update keyboards/keebio/iris/keymaps/jerryhcooke/keymap.c
Co-Authored-By: Drashna Jaelre
* Update keymap.c
* Fixed Formatting
Ran automatic C formatting as suggested
* Update rules.mk
Fixed linespacing
---
.../keebio/iris/keymaps/jerryhcooke/config.h | 35 +++++++++++++++++
.../keebio/iris/keymaps/jerryhcooke/keymap.c | 39 +++++++++++++++++++
.../keebio/iris/keymaps/jerryhcooke/readme.md | 3 ++
.../keebio/iris/keymaps/jerryhcooke/rules.mk | 3 ++
4 files changed, 80 insertions(+)
create mode 100644 keyboards/keebio/iris/keymaps/jerryhcooke/config.h
create mode 100644 keyboards/keebio/iris/keymaps/jerryhcooke/keymap.c
create mode 100644 keyboards/keebio/iris/keymaps/jerryhcooke/readme.md
create mode 100644 keyboards/keebio/iris/keymaps/jerryhcooke/rules.mk
diff --git a/keyboards/keebio/iris/keymaps/jerryhcooke/config.h b/keyboards/keebio/iris/keymaps/jerryhcooke/config.h
new file mode 100644
index 000000000000..58f33d371636
--- /dev/null
+++ b/keyboards/keebio/iris/keymaps/jerryhcooke/config.h
@@ -0,0 +1,35 @@
+/*
+Copyright 2017 Danny Nguyen
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see .
+*/
+
+#pragma once
+
+// #define USE_I2C
+#define EE_HANDS
+
+#undef RGBLED_NUM
+#define RGBLIGHT_ANIMATIONS
+#define RGBLED_NUM 12
+#define RGBLIGHT_HUE_STEP 2
+#define RGBLIGHT_SAT_STEP 8
+#define RGBLIGHT_VAL_STEP 8
+
+#ifndef NO_DEBUG
+# define NO_DEBUG
+#endif // !NO_DEBUG
+#if !defined(NO_PRINT) && !defined(CONSOLE_ENABLE)
+# define NO_PRINT
+#endif // !NO_PRINT
diff --git a/keyboards/keebio/iris/keymaps/jerryhcooke/keymap.c b/keyboards/keebio/iris/keymaps/jerryhcooke/keymap.c
new file mode 100644
index 000000000000..1e512540aae6
--- /dev/null
+++ b/keyboards/keebio/iris/keymaps/jerryhcooke/keymap.c
@@ -0,0 +1,39 @@
+#include QMK_KEYBOARD_H
+
+#define _QWERTY 0
+#define _LOWER 1
+#define _RAISE 2
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {[0] = LAYOUT(KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_I, KC_O, KC_ENT, LCTL_T(KC_LGUI), KC_Z, KC_X, KC_C, KC_D, KC_V, LGUI(KC_L), MEH_T(KC_MINS), KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_LGUI, LT(1, KC_QUOT), KC_SFTENT, KC_SPC, LT(2, KC_BSLS), LALT_T(KC_APP)),
+ [1] = LAYOUT(KC_MPLY, KC_NO, KC_DQUO, KC_NO, LALT(KC_F4), KC_NO, KC_P7, KC_P8, KC_P9, KC_PMNS, KC_NO, RESET, KC_MPRV, KC_END, KC_UP, KC_HOME, KC_PGUP, KC_NO, KC_P4, KC_P5, KC_P6, KC_PPLS, RGB_SAI, RGB_SAD, KC_MNXT, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_NO, KC_P1, KC_P2, KC_P3, KC_PAST, RGB_HUI, RGB_HUD, KC_NO, KC_WBAK, KC_WFWD, KC_WSTP, KC_WREF, KC_NO, LCA(KC_DEL), KC_NLCK, KC_P0, KC_P0, KC_PDOT, KC_PENT, RGB_SPI, RGB_SPD, KC_PSCR, KC_NO, KC_LGUI, RGB_TOG, RGB_VAI, RGB_VAD),
+ [2] = LAYOUT(KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_NO, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_K, KC_NO, KC_WH_D, KC_MS_U, KC_WH_U, KC_NO, KC_F12, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MS_L, KC_MS_D, KC_MS_R, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO)};
+
+#ifdef ENCODER_ENABLE
+void encoder_update_user(uint8_t index, bool clockwise) {
+ if (index == 0) {
+ switch (biton32(layer_state)) {
+ case _LOWER:
+ clockwise ? tap_code(KC_MS_WH_UP) : tap_code(KC_MS_WH_DOWN);
+ break;
+ case _RAISE:
+ clockwise ? rgblight_increase_hue() : rgblight_decrease_hue();
+ break;
+ default:
+ clockwise ? tap_code(KC_AUDIO_VOL_UP) : tap_code(KC_AUDIO_VOL_DOWN);
+ break;
+ }
+ } else if (index == 1) {
+ switch (biton32(layer_state)) {
+ case _LOWER:
+ clockwise ? tap_code(KC_UP) : tap_code(KC_DOWN);
+ break;
+ case _RAISE:
+ clockwise ? tap_code(KC_MEDIA_NEXT_TRACK) : tap_code(KC_MEDIA_PREV_TRACK);
+ break;
+ default:
+ clockwise ? tap_code(KC_RIGHT) : tap_code(KC_LEFT);
+ break;
+ }
+ }
+}
+#endif // ENCODER_ENABLE
diff --git a/keyboards/keebio/iris/keymaps/jerryhcooke/readme.md b/keyboards/keebio/iris/keymaps/jerryhcooke/readme.md
new file mode 100644
index 000000000000..8c2a6efef77c
--- /dev/null
+++ b/keyboards/keebio/iris/keymaps/jerryhcooke/readme.md
@@ -0,0 +1,3 @@
+[Jerry's Iris R4 Layout](https://imgur.com/a/JLytcqS)
+
+This is a fairly modified version of the default keymap that I tinkered with to allow the rotary encoder to carry out a different function on each layer.
diff --git a/keyboards/keebio/iris/keymaps/jerryhcooke/rules.mk b/keyboards/keebio/iris/keymaps/jerryhcooke/rules.mk
new file mode 100644
index 000000000000..8e5cd7a48551
--- /dev/null
+++ b/keyboards/keebio/iris/keymaps/jerryhcooke/rules.mk
@@ -0,0 +1,3 @@
+RGBLIGHT_ENABLE = yes
+BACKLIGHT_ENABLE = yes
+MOUSEKEY_ENABLE = yes
From a510e5212b32a1150a11670358fc8fe309ab1f09 Mon Sep 17 00:00:00 2001
From: Gregory Gubarev
Date: Tue, 5 Nov 2019 01:44:49 +0400
Subject: [PATCH 02/16] [Docs] Create RU ver getting_started_getting_help
(#7227)
* Create RU ver getting_started_getting_help
* uodate RU ver of getting_started_getting_help
* Update docs/ru-ru/getting_started_getting_help.md
Co-Authored-By: nabokovas
Co-Authored-By: Nikita Titov
---
docs/ru-ru/getting_started_getting_help.md | 15 +++++++++++++++
1 file changed, 15 insertions(+)
create mode 100644 docs/ru-ru/getting_started_getting_help.md
diff --git a/docs/ru-ru/getting_started_getting_help.md b/docs/ru-ru/getting_started_getting_help.md
new file mode 100644
index 000000000000..75be44310e5d
--- /dev/null
+++ b/docs/ru-ru/getting_started_getting_help.md
@@ -0,0 +1,15 @@
+# Получение помощи
+
+Существует много ресурсов для получения помощи по работе с QMK.
+
+## Чат в реальном времени
+
+Вы можете найти разработчиков и пользователей QMK на нашем главном [сервере Discord](https://discord.gg/Uq7gcHh). На сервере есть специальные каналы для разговоров о прошивке, Toolbox, оборудовании и конфигураторе.
+
+## OLKB Сабреддит
+
+Официальный форум QMK [/r/olkb](https://reddit.com/r/olkb) на [reddit.com](https://reddit.com).
+
+## GitHub ишью
+
+Вы можете открыть [ишью на GitHub](https://github.com/qmk/qmk_firmware/issues). Это особенно удобно, когда ваша проблема потребует длительного обсуждения или отладки.
From 511fa5f8156b188c591ee760b7d246939c260451 Mon Sep 17 00:00:00 2001
From: Daniel Shields <1530706+shieldsd@users.noreply.github.com>
Date: Mon, 4 Nov 2019 21:47:52 +0000
Subject: [PATCH 03/16] [Keymap] Add new LED/RGB key codes (#7254)
---
keyboards/model01/keymaps/dshields/keymap.c | 4 ++--
keyboards/planck/keymaps/dshields/keymap.c | 2 +-
users/dshields/dshields.h | 7 +++++++
3 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/keyboards/model01/keymaps/dshields/keymap.c b/keyboards/model01/keymaps/dshields/keymap.c
index 485acfd3e29d..981f1081837e 100644
--- a/keyboards/model01/keymaps/dshields/keymap.c
+++ b/keyboards/model01/keymaps/dshields/keymap.c
@@ -17,8 +17,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[FUN] = LAYOUT(
EEP_RST, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 ,
KC_TAB , _______, KC_MS_U, _______, KC_BTN3, _______, RGB_MOD, DM_STRT, _______, KC_LCBR, KC_RCBR, KC_LBRC, KC_RBRC, KC_F12 ,
- KC_HOME, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN1, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT, _______, _______,
- KC_END , KC_PSCR, KC_INS , _______, KC_BTN2, _______, _______, DM_STOP, _______, _______, _______, _______, KC_BSLS, KC_PIPE,
+ KC_HOME, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN1, _______, RGB_HUI, _______, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT, _______, _______,
+ KC_END , KC_PSCR, KC_INS , _______, KC_BTN2, _______, RGB_HUD, DM_STOP, _______, _______, _______, _______, KC_BSLS, KC_PIPE,
_______, _______,
KC_DEL , KC_ENT ,
_______, _______,
diff --git a/keyboards/planck/keymaps/dshields/keymap.c b/keyboards/planck/keymaps/dshields/keymap.c
index 1c4a00b9650b..030e094a7e57 100644
--- a/keyboards/planck/keymaps/dshields/keymap.c
+++ b/keyboards/planck/keymaps/dshields/keymap.c
@@ -24,7 +24,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[FUN] = LAYOUT_planck_grid(
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, RESET, EEP_RST, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 ,
KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, _______, _______, _______, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R,
- LGT_TOG, LGT_MOD, LGT_BRT, _______, _______, DM_STRT, DM_STOP, _______, _______, KC_BTN1, KC_BTN2, KC_BTN3,
+ LGT_TOG, LGT_MOD, LGT_BRT, LGT_INC, LGT_DEC, DM_STRT, DM_STOP, _______, _______, KC_BTN1, KC_BTN2, KC_BTN3,
_______, _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R
)
};
diff --git a/users/dshields/dshields.h b/users/dshields/dshields.h
index a65ccfea0046..d8f76e8c0088 100644
--- a/users/dshields/dshields.h
+++ b/users/dshields/dshields.h
@@ -21,20 +21,27 @@
// mod-tap keys
#define MT_SPC SFT_T(KC_SPC)
+// LED/RGB controls
#ifdef KEYBOARD_planck_light
#define LGT_TOG RGB_TOG
#define LGT_MOD RGB_MOD
#define LGT_BRT _______
+ #define LGT_INC RGB_HUI
+ #define LGT_DEC RGB_HUD
#endif
#ifdef KEYBOARD_planck_rev3
#define LGT_TOG BL_TOGG
#define LGT_MOD BL_STEP
#define LGT_BRT BL_BRTG
+ #define LGT_INC BL_INC
+ #define LGT_DEC BL_DEC
#endif
#ifdef KEYBOARD_planck_rev6
#define LGT_TOG _______
#define LGT_MOD _______
#define LGT_BRT _______
+ #define LGT_INC _______
+ #define LGT_DEC _______
#endif
enum layers { DEF, LWR, RSE, FUN };
From a836c85e54bfb06cd685a5444eea377374cebea3 Mon Sep 17 00:00:00 2001
From: Drashna Jaelre
Date: Mon, 4 Nov 2019 13:59:15 -0800
Subject: [PATCH 04/16] Update keymap.c
---
keyboards/kyria/keymaps/default/keymap.c | 27 ++++++++++--------------
1 file changed, 11 insertions(+), 16 deletions(-)
diff --git a/keyboards/kyria/keymaps/default/keymap.c b/keyboards/kyria/keymaps/default/keymap.c
index a27486d392af..acadb0422b1e 100644
--- a/keyboards/kyria/keymaps/default/keymap.c
+++ b/keyboards/kyria/keymaps/default/keymap.c
@@ -16,15 +16,10 @@
#include QMK_KEYBOARD_H
enum layers {
- QWERTY = 0,
- LOWER,
- RAISE,
- ADJUST
-};
-
-enum custom_keycodes {
- LOWER = SAFE_RANGE,
- RAISE
+ _QWERTY = 0,
+ _LOWER,
+ _RAISE,
+ _ADJUST
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
@@ -42,11 +37,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | Alt | Lower| Raise| | Lower| Raise| | | |
* `----------------------------------' `----------------------------------'
*/
- [QWERTY] = LAYOUT(
- LT(RAISE, KC_ESC), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_PIPE,
+ [_QWERTY] = LAYOUT(
+ LT(_RAISE, KC_ESC), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_PIPE,
MT(MOD_LCTL, KC_BSPC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LSFT, KC_LSFT, KC_LSFT, KC_LSFT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_MINS,
- KC_LGUI, KC_DEL, MT(MOD_LALT, KC_ENT), LT(LOWER, KC_SPC), LT(RAISE, KC_ESC), LT(LOWER, KC_ENT), LT(RAISE, KC_SPC), KC_TAB, KC_BSPC, KC_RALT
+ KC_LGUI, KC_DEL, MT(MOD_LALT, KC_ENT), LT(_LOWER, KC_SPC), LT(_RAISE, KC_ESC), LT(_LOWER, KC_ENT), LT(_RAISE, KC_SPC), KC_TAB, KC_BSPC, KC_RALT
),
/*
* Lower Layer: Symbols
@@ -62,7 +57,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | | | | |
* `----------------------------------' `----------------------------------'
*/
- [LOWER] = LAYOUT(
+ [_LOWER] = LAYOUT(
_______, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, _______, _______, _______, _______, _______, KC_BSLS,
_______, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, KC_PLUS, KC_MINS, KC_SLSH, KC_ASTR, KC_PERC, KC_QUOT,
_______, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, _______, _______, _______, _______, KC_AMPR, KC_EQL, KC_COMM, KC_DOT, KC_SLSH, KC_MINS,
@@ -82,7 +77,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | | | | |
* `----------------------------------' `----------------------------------'
*/
- [RAISE] = LAYOUT(
+ [_RAISE] = LAYOUT(
_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______,
_______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLU, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______,
_______, _______, _______, _______, KC_MUTE, KC_VOLD, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, _______, _______,
@@ -102,7 +97,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | | | | |
* `----------------------------------' `----------------------------------'
*/
- [ADJUST] = LAYOUT(
+ [_ADJUST] = LAYOUT(
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______,
_______, RGB_TOG, RGB_SAI, RGB_HUI, RGB_VAI, RGB_MOD, _______, _______, _______, KC_F11, KC_F12, _______,
_______, _______, RGB_SAD, RGB_HUD, RGB_VAD, RGB_RMOD,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
@@ -131,7 +126,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
layer_state_t layer_state_set_user(layer_state_t state) {
- return update_tri_layer_state(state, LOWER, RAISE, ADJUST);
+ return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
}
#ifdef OLED_DRIVER_ENABLE
From 29630e6e49487cbf97fa57f47b399d4d5866fe13 Mon Sep 17 00:00:00 2001
From: Drashna Jaelre
Date: Mon, 4 Nov 2019 15:35:47 -0800
Subject: [PATCH 05/16] [Core] Add short form LTO_ENABLE (#7259)
For drashna's sanity's sake
---
docs/config_options.md | 3 ++-
tmk_core/common.mk | 3 +++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/docs/config_options.md b/docs/config_options.md
index abd98ec8a802..c44a47178cee 100644
--- a/docs/config_options.md
+++ b/docs/config_options.md
@@ -348,7 +348,8 @@ Use these to enable or disable building certain features. The more you have enab
* `NO_USB_STARTUP_CHECK`
* Disables usb suspend check after keyboard startup. Usually the keyboard waits for the host to wake it up before any tasks are performed. This is useful for split keyboards as one half will not get a wakeup call but must send commands to the master.
* `LINK_TIME_OPTIMIZATION_ENABLE`
- = Enables Link Time Optimization (`LTO`) when compiling the keyboard. This makes the process take longer, but can significantly reduce the compiled size (and since the firmware is small, the added time is not noticable). However, this will automatically disable the old Macros and Functions features automatically, as these break when `LTO` is enabled. It does this by automatically defining `NO_ACTION_MACRO` and `NO_ACTION_FUNCTION`
+ * Enables Link Time Optimization (`LTO`) when compiling the keyboard. This makes the process take longer, but can significantly reduce the compiled size (and since the firmware is small, the added time is not noticeable). However, this will automatically disable the old Macros and Functions features automatically, as these break when `LTO` is enabled. It does this by automatically defining `NO_ACTION_MACRO` and `NO_ACTION_FUNCTION`
+ * Alternatively, you can use `LTO_ENABLE` instead of `LINK_TIME_OPTIMIZATION_ENABLE`.
## USB Endpoint Limitations
diff --git a/tmk_core/common.mk b/tmk_core/common.mk
index db553534652b..d43950299b1b 100644
--- a/tmk_core/common.mk
+++ b/tmk_core/common.mk
@@ -203,6 +203,9 @@ ifeq ($(strip $(SHARED_EP_ENABLE)), yes)
TMK_COMMON_DEFS += -DSHARED_EP_ENABLE
endif
+ifeq ($(strip $(LTO_ENABLE)), yes)
+ LINK_TIME_OPTIMIZATION_ENABLE = yes
+endif
ifeq ($(strip $(LINK_TIME_OPTIMIZATION_ENABLE)), yes)
EXTRAFLAGS += -flto
From 31fe2e085902b80c0cc89fbce3d592e1db041530 Mon Sep 17 00:00:00 2001
From: Drashna Jaelre
Date: Mon, 4 Nov 2019 15:53:40 -0800
Subject: [PATCH 06/16] [Keyboard] Reduce compiled size of Panc60 keyboard
(#7260)
---
keyboards/panc60/rules.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/keyboards/panc60/rules.mk b/keyboards/panc60/rules.mk
index 6ca8d7b78c3f..cdacb4be7dbe 100644
--- a/keyboards/panc60/rules.mk
+++ b/keyboards/panc60/rules.mk
@@ -31,7 +31,7 @@ BOOTMAGIC_ENABLE = no
MOUSEKEY_ENABLE = yes
EXTRAKEY_ENABLE = yes
CONSOLE_ENABLE = yes
-COMMAND_ENABLE = yes
+COMMAND_ENABLE = no
BACKLIGHT_ENABLE = yes
RGBLIGHT_ENABLE = yes
RGBLIGHT_CUSTOM_DRIVER = yes
From 0a9a69394e132c3d00eddffd2e345f48113e56c4 Mon Sep 17 00:00:00 2001
From: Christopher
Date: Tue, 5 Nov 2019 01:02:42 +0100
Subject: [PATCH 07/16] Fixes #7256: USB descriptor to identify correctly as
MIDI device. (#7258)
---
tmk_core/protocol/usb_descriptor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tmk_core/protocol/usb_descriptor.c b/tmk_core/protocol/usb_descriptor.c
index ffcf0957f358..e93ce87df28c 100644
--- a/tmk_core/protocol/usb_descriptor.c
+++ b/tmk_core/protocol/usb_descriptor.c
@@ -431,7 +431,7 @@ const USB_Descriptor_Configuration_t PROGMEM
.Refresh = 0,
.SyncEndpointNumber = 0},
- .MIDI_In_Jack_Endpoint_SPC = {.Header = {.Size = sizeof(USB_MIDI_Descriptor_Jack_Endpoint_t), .Type = AUDIO_DSUBTYPE_CSEndpoint_General}, .Subtype = AUDIO_DSUBTYPE_CSEndpoint_General, .TotalEmbeddedJacks = 0x01, .AssociatedJackID = {0x01}},
+ .MIDI_In_Jack_Endpoint_SPC = {.Header = {.Size = sizeof(USB_MIDI_Descriptor_Jack_Endpoint_t), .Type = AUDIO_DTYPE_CSEndpoint}, .Subtype = AUDIO_DSUBTYPE_CSEndpoint_General, .TotalEmbeddedJacks = 0x01, .AssociatedJackID = {0x01}},
.MIDI_Out_Jack_Endpoint = {.Endpoint = {.Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint}, .EndpointAddress = MIDI_STREAM_IN_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MIDI_STREAM_EPSIZE, .PollingIntervalMS = 0x05},
.Refresh = 0,
From efa28d0f5cca55b0dfecaddd0860ec3dfeab8bb0 Mon Sep 17 00:00:00 2001
From: fauxpark
Date: Tue, 5 Nov 2019 11:05:03 +1100
Subject: [PATCH 08/16] Convert some PS2AVRGB boards to I2C WS2812 driver
(#7241)
* Convert some PS2AVRGB boards to I2C WS2812 driver
* Fix Travis failure for bface
---
keyboards/ares/ares.c | 72 ++--------------------
keyboards/ares/rules.mk | 19 +-----
keyboards/donutcables/budget96/budget96.c | 71 +++-------------------
keyboards/donutcables/budget96/rules.mk | 20 +------
keyboards/eve/meteor/meteor.c | 50 ++--------------
keyboards/eve/meteor/rules.mk | 19 +-----
keyboards/exclusive/e6v2/le_bmc/le_bmc.c | 51 ++--------------
keyboards/exclusive/e6v2/le_bmc/rules.mk | 3 +-
keyboards/exclusive/e6v2/oe_bmc/oe_bmc.c | 63 +++----------------
keyboards/exclusive/e6v2/oe_bmc/rules.mk | 3 +-
keyboards/exent/exent.c | 73 -----------------------
keyboards/exent/rules.mk | 4 +-
keyboards/facew/facew.c | 54 ++++++-----------
keyboards/facew/rules.mk | 20 +------
keyboards/ft/mars80/mars80.c | 52 ++--------------
keyboards/ft/mars80/rules.mk | 19 +-----
keyboards/gray_studio/hb85/hb85.c | 40 +++----------
keyboards/gray_studio/hb85/rules.mk | 19 +-----
keyboards/jj4x4/jj4x4.c | 37 ------------
keyboards/jj4x4/rules.mk | 19 +-----
keyboards/kbdfans/kbdpad/mk1/mk1.c | 2 +-
keyboards/kbdfans/kbdpad/mk1/rules.mk | 15 -----
keyboards/panc60/panc60.c | 55 ++++++-----------
keyboards/panc60/rules.mk | 20 +------
keyboards/pearl/pearl.c | 52 ++--------------
keyboards/pearl/rules.mk | 20 +------
keyboards/percent/skog_lite/rules.mk | 19 +-----
keyboards/percent/skog_lite/skog_lite.c | 49 ++-------------
keyboards/singa/rules.mk | 19 +-----
keyboards/singa/singa.c | 49 ++-------------
keyboards/tgr/alice/alice.c | 39 +-----------
keyboards/tgr/alice/rules.mk | 19 +-----
keyboards/tgr/jane/jane.c | 51 ++--------------
keyboards/tgr/jane/rules.mk | 19 +-----
keyboards/unikorn/readme.md | 1 -
keyboards/unikorn/rules.mk | 19 +-----
keyboards/unikorn/unikorn.c | 50 ++--------------
keyboards/winkeyless/bface/bface.c | 49 ++-------------
keyboards/winkeyless/bface/bface.h | 4 +-
keyboards/winkeyless/bface/rules.mk | 20 +------
40 files changed, 122 insertions(+), 1157 deletions(-)
diff --git a/keyboards/ares/ares.c b/keyboards/ares/ares.c
index 85c7435edc3f..07276491c513 100644
--- a/keyboards/ares/ares.c
+++ b/keyboards/ares/ares.c
@@ -17,50 +17,12 @@ along with this program. If not, see .
#include "ares.h"
-#ifdef RGBLIGHT_ENABLE
-
-#include
-#include "i2c_master.h"
-#include "rgblight.h"
-
-extern rgblight_config_t rgblight_config;
-
-void matrix_init_kb(void) {
- i2c_init();
- // call user level keymaps, if any
- matrix_init_user();
-}
-
-// custom RGB driver
-void rgblight_set(void) {
- if (!rgblight_config.enable) {
- memset(led, 0, 3 * RGBLED_NUM);
- }
-
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
-}
-
-bool rgb_init = false;
-
-void matrix_scan_kb(void) {
- // if LEDs were previously on before poweroff, turn them back on
- if (rgb_init == false && rgblight_config.enable) {
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
- rgb_init = true;
- }
-
- rgblight_task();
- matrix_scan_user();
-}
-
-#endif
-
#ifdef BACKLIGHT_ENABLE
void backlight_init_ports(void) {
- setPinOutput(D0);
- setPinOutput(D1);
- setPinOutput(D4);
- setPinOutput(D6);
+ setPinOutput(D0);
+ setPinOutput(D1);
+ setPinOutput(D4);
+ setPinOutput(D6);
}
void backlight_set(uint8_t level) {
@@ -79,29 +41,3 @@ void backlight_set(uint8_t level) {
}
}
#endif
-
-// Optional override functions below.
-// You can leave any or all of these undefined.
-// These are only required if you want to perform custom actions.
-
-/*
-void matrix_init_kb(void) {
- // put your keyboard start-up code here
- // runs once when the firmware starts up
- matrix_init_user();
-}
-void matrix_scan_kb(void) {
- // put your looping keyboard code here
- // runs every cycle (a lot)
- matrix_scan_user();
-}
-bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
- // put your per-action keyboard code here
- // runs for every action, just before processing by the firmware
- return process_record_user(keycode, record);
-}
-void led_set_kb(uint8_t usb_led) {
- // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
- led_set_user(usb_led);
-}
-*/
\ No newline at end of file
diff --git a/keyboards/ares/rules.mk b/keyboards/ares/rules.mk
index 3ac90cf973f6..58d36bc67350 100644
--- a/keyboards/ares/rules.mk
+++ b/keyboards/ares/rules.mk
@@ -1,18 +1,3 @@
-# Copyright 2017 Luiz Ribeiro
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-
# MCU name
MCU = atmega32a
@@ -34,8 +19,6 @@ CONSOLE_ENABLE = yes
COMMAND_ENABLE = yes
BACKLIGHT_ENABLE = no
RGBLIGHT_ENABLE = no
-RGBLIGHT_CUSTOM_DRIVER = yes
+WS2812_DRIVER = i2c
OPT_DEFS = -DDEBUG_LEVEL=0
-
-SRC += i2c_master.c
diff --git a/keyboards/donutcables/budget96/budget96.c b/keyboards/donutcables/budget96/budget96.c
index 2fc826f09273..e9125a3e609e 100644
--- a/keyboards/donutcables/budget96/budget96.c
+++ b/keyboards/donutcables/budget96/budget96.c
@@ -13,61 +13,8 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-#include "budget96.h"
-
-#ifdef BACKLIGHT_ENABLE
-#include "backlight.h"
-#endif
-#ifdef RGBLIGHT_ENABLE
-#include "rgblight.h"
-#endif
-
-#include
-
-#include "action_layer.h"
-#include "i2c_master.h"
-#include "quantum.h"
-
-__attribute__ ((weak))
-void matrix_scan_user(void) {
-}
-
-#ifdef RGBLIGHT_ENABLE
-extern rgblight_config_t rgblight_config;
-
-void rgblight_set(void) {
- if (!rgblight_config.enable) {
- for (uint8_t i = 0; i < RGBLED_NUM; i++) {
- led[i].r = 0;
- led[i].g = 0;
- led[i].b = 0;
- }
- }
-
- i2c_init();
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
-}
-#endif
-
-void matrix_init_kb(void) {
-#ifdef RGBLIGHT_ENABLE
- if (rgblight_config.enable) {
- i2c_init();
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
- }
-#endif
- // call user level keymaps, if any
- matrix_init_user();
-}
-
-void matrix_scan_kb(void) {
-#ifdef RGBLIGHT_ENABLE
- rgblight_task();
-#endif
- matrix_scan_user();
- /* Nothing else for now. */
-}
+#include "budget96.h"
void backlight_init_ports(void) {
// initialize pins D0, D1, D4 and D6 as output
@@ -76,25 +23,25 @@ void backlight_init_ports(void) {
setPinOutput(D4);
setPinOutput(D6);
- // turn RGB LEDs on
+ // turn backlight LEDs on
writePinHigh(D0);
writePinHigh(D1);
writePinHigh(D4);
writePinHigh(D6);
}
- void backlight_set(uint8_t level) {
- if (level == 0) {
- // turn RGB LEDs off
+void backlight_set(uint8_t level) {
+ if (level == 0) {
+ // turn backlight LEDs off
writePinLow(D0);
writePinLow(D1);
writePinLow(D4);
writePinLow(D6);
- } else {
- // turn RGB LEDs on
+ } else {
+ // turn backlight LEDs on
writePinHigh(D0);
writePinHigh(D1);
writePinHigh(D4);
writePinHigh(D6);
- }
- }
+ }
+}
diff --git a/keyboards/donutcables/budget96/rules.mk b/keyboards/donutcables/budget96/rules.mk
index 4f9e0e412df6..54328d248d13 100644
--- a/keyboards/donutcables/budget96/rules.mk
+++ b/keyboards/donutcables/budget96/rules.mk
@@ -1,18 +1,3 @@
-# Copyright 2017 Luiz Ribeiro
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-
# MCU name
MCU = atmega32a
@@ -34,9 +19,6 @@ CONSOLE_ENABLE = yes
COMMAND_ENABLE = yes
BACKLIGHT_ENABLE = yes
RGBLIGHT_ENABLE = yes
-RGBLIGHT_CUSTOM_DRIVER = yes
+WS2812_DRIVER = i2c
OPT_DEFS = -DDEBUG_LEVEL=0
-
-# custom matrix setup
-SRC = i2c_master.c
diff --git a/keyboards/eve/meteor/meteor.c b/keyboards/eve/meteor/meteor.c
index 1bd47ef9e1af..f5ecbad02543 100644
--- a/keyboards/eve/meteor/meteor.c
+++ b/keyboards/eve/meteor/meteor.c
@@ -14,49 +14,7 @@
* along with this program. If not, see .
*/
-#include "i2c_master.h"
-#include "quantum.h"
-
-#ifdef RGBLIGHT_ENABLE
-#include "rgblight.h"
-extern rgblight_config_t rgblight_config;
-
-void rgblight_set(void) {
- if (!rgblight_config.enable) {
- for (uint8_t i = 0; i < RGBLED_NUM; i++) {
- led[i].r = 0;
- led[i].g = 0;
- led[i].b = 0;
- }
- }
-
- i2c_init();
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
-}
-#endif
-
-void matrix_init_kb(void) {
-#ifdef RGBLIGHT_ENABLE
- if (rgblight_config.enable) {
- i2c_init();
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
- }
-#endif
- // call user level keymaps, if any
- matrix_init_user();
-}
-
-void matrix_scan_kb(void) {
-#ifdef RGBLIGHT_ENABLE
- rgblight_task();
-#endif
- matrix_scan_user();
- /* Nothing else for now. */
-}
-
-__attribute__ ((weak))
-void matrix_scan_user(void) {
-}
+#include "meteor.h"
void backlight_init_ports(void) {
// initialize pins D0, D1, D4 and D6 as output
@@ -73,17 +31,17 @@ void backlight_init_ports(void) {
}
void backlight_set(uint8_t level) {
- if (level == 0) {
+ if (level == 0) {
// turn backlight LEDs off
writePinLow(D0);
writePinLow(D1);
writePinLow(D4);
writePinLow(D6);
- } else {
+ } else {
// turn backlight LEDs on
writePinHigh(D0);
writePinHigh(D1);
writePinHigh(D4);
writePinHigh(D6);
- }
+ }
}
diff --git a/keyboards/eve/meteor/rules.mk b/keyboards/eve/meteor/rules.mk
index e43baee5c5bf..e57c21c856bb 100644
--- a/keyboards/eve/meteor/rules.mk
+++ b/keyboards/eve/meteor/rules.mk
@@ -1,18 +1,3 @@
-# Copyright 2017 Luiz Ribeiro
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-
# MCU name
MCU = atmega32a
@@ -34,8 +19,6 @@ CONSOLE_ENABLE = yes
COMMAND_ENABLE = yes
BACKLIGHT_ENABLE = yes
RGBLIGHT_ENABLE = no
-RGBLIGHT_CUSTOM_DRIVER = no
+WS2812_DRIVER = i2c
OPT_DEFS = -DDEBUG_LEVEL=0
-
-QUANTUM_LIB_SRC = i2c_master.c
diff --git a/keyboards/exclusive/e6v2/le_bmc/le_bmc.c b/keyboards/exclusive/e6v2/le_bmc/le_bmc.c
index 5f7ef25b227d..e3b81c81ba43 100644
--- a/keyboards/exclusive/e6v2/le_bmc/le_bmc.c
+++ b/keyboards/exclusive/e6v2/le_bmc/le_bmc.c
@@ -13,49 +13,8 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-#include "rgblight.h"
-#include "i2c_master.h"
-#include "quantum.h"
-#ifdef RGBLIGHT_ENABLE
-extern rgblight_config_t rgblight_config;
-
-void rgblight_set(void) {
- if (!rgblight_config.enable) {
- for (uint8_t i = 0; i < RGBLED_NUM; i++) {
- led[i].r = 0;
- led[i].g = 0;
- led[i].b = 0;
- }
- }
-
- i2c_init();
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
-}
-#endif
-
-void matrix_init_kb(void) {
-#ifdef RGBLIGHT_ENABLE
- if (rgblight_config.enable) {
- i2c_init();
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
- }
-#endif
- // call user level keymaps, if any
- matrix_init_user();
-}
-
-void matrix_scan_kb(void) {
-#ifdef RGBLIGHT_ENABLE
- rgblight_task();
-#endif
- matrix_scan_user();
- /* Nothing else for now. */
-}
-
-__attribute__ ((weak))
-void matrix_scan_user(void) {
-}
+#include "le_bmc.h"
void backlight_init_ports(void) {
// initialize pins D0, D1, D4 and D6 as output
@@ -72,17 +31,17 @@ void backlight_init_ports(void) {
}
void backlight_set(uint8_t level) {
- if (level == 0) {
+ if (level == 0) {
// turn backlight LEDs off
writePinLow(D0);
writePinLow(D1);
writePinLow(D4);
writePinLow(D6);
- } else {
+ } else {
// turn backlight LEDs on
writePinHigh(D0);
writePinHigh(D1);
writePinHigh(D4);
writePinHigh(D6);
- }
-}
\ No newline at end of file
+ }
+}
diff --git a/keyboards/exclusive/e6v2/le_bmc/rules.mk b/keyboards/exclusive/e6v2/le_bmc/rules.mk
index 13a5f1b89a44..106044ba7257 100644
--- a/keyboards/exclusive/e6v2/le_bmc/rules.mk
+++ b/keyboards/exclusive/e6v2/le_bmc/rules.mk
@@ -24,7 +24,7 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
NKRO_ENABLE = no # USB Nkey Rollover
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
-RGBLIGHT_CUSTOM_DRIVER = yes
+WS2812_DRIVER = i2c
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
UNICODE_ENABLE = no # Unicode
@@ -34,4 +34,3 @@ FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
OPT_DEFS = -DDEBUG_LEVEL=0
-SRC += i2c_master.c
diff --git a/keyboards/exclusive/e6v2/oe_bmc/oe_bmc.c b/keyboards/exclusive/e6v2/oe_bmc/oe_bmc.c
index 5357550ae124..97d354653f1b 100644
--- a/keyboards/exclusive/e6v2/oe_bmc/oe_bmc.c
+++ b/keyboards/exclusive/e6v2/oe_bmc/oe_bmc.c
@@ -13,57 +13,8 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-#include "oe_bmc.h"
-#include "rgblight.h"
-#include "i2c_master.h"
-
-void matrix_init_kb(void) {
- // put your keyboard start-up code here
- // runs once when the firmware starts up
-
- matrix_init_user();
-}
-
-void matrix_scan_kb(void) {
- // put your looping keyboard code here
- // runs every cycle (a lot)
-
- matrix_scan_user();
-}
-
-bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
- // put your per-action keyboard code here
- // runs for every action, just before processing by the firmware
-
- return process_record_user(keycode, record);
-}
-
-void led_set_kb(uint8_t usb_led) {
- // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
- led_set_user(usb_led);
-}
-
-#ifdef RGBLIGHT_ENABLE
-extern rgblight_config_t rgblight_config;
-
-void rgblight_set(void) {
- if (!rgblight_config.enable) {
- for (uint8_t i = 0; i < RGBLED_NUM; i++) {
- led[i].r = 0;
- led[i].g = 0;
- led[i].b = 0;
- }
- }
-
- i2c_init();
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
-}
-#endif
-
-__attribute__ ((weak))
-void matrix_scan_user(void) {
-}
+#include "oe_bmc.h"
void backlight_init_ports(void) {
// initialize pins D0, D1, D4 and D6 as output
@@ -72,7 +23,7 @@ void backlight_init_ports(void) {
setPinOutput(D4);
setPinOutput(D6);
- // turn RGB LEDs on
+ // turn backlight LEDs on
writePinHigh(D0);
writePinHigh(D1);
writePinHigh(D4);
@@ -80,17 +31,17 @@ void backlight_init_ports(void) {
}
void backlight_set(uint8_t level) {
- if (level == 0) {
- // turn RGB LEDs off
+ if (level == 0) {
+ // turn backlight LEDs off
writePinLow(D0);
writePinLow(D1);
writePinLow(D4);
writePinLow(D6);
- } else {
- // turn RGB LEDs on
+ } else {
+ // turn backlight LEDs on
writePinHigh(D0);
writePinHigh(D1);
writePinHigh(D4);
writePinHigh(D6);
- }
+ }
}
diff --git a/keyboards/exclusive/e6v2/oe_bmc/rules.mk b/keyboards/exclusive/e6v2/oe_bmc/rules.mk
index 13a5f1b89a44..106044ba7257 100644
--- a/keyboards/exclusive/e6v2/oe_bmc/rules.mk
+++ b/keyboards/exclusive/e6v2/oe_bmc/rules.mk
@@ -24,7 +24,7 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
NKRO_ENABLE = no # USB Nkey Rollover
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
-RGBLIGHT_CUSTOM_DRIVER = yes
+WS2812_DRIVER = i2c
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
UNICODE_ENABLE = no # Unicode
@@ -34,4 +34,3 @@ FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
OPT_DEFS = -DDEBUG_LEVEL=0
-SRC += i2c_master.c
diff --git a/keyboards/exent/exent.c b/keyboards/exent/exent.c
index 00cd20aff6fd..82066f7e8553 100644
--- a/keyboards/exent/exent.c
+++ b/keyboards/exent/exent.c
@@ -15,76 +15,3 @@
*/
#include "exent.h"
-
-#ifdef RGBLIGHT_ENABLE
-
-# include
-# include "i2c_master.h"
-# include "rgblight.h"
-
-extern rgblight_config_t rgblight_config;
-
-void matrix_init_kb(void) {
- i2c_init();
- // call user level keymaps, if any
- matrix_init_user();
-}
-
-// custom RGB driver
-void rgblight_set(void) {
- if (!rgblight_config.enable) {
- memset(led, 0, 3 * RGBLED_NUM);
- }
-
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
-}
-
-bool rgb_init = false;
-
-void matrix_scan_kb(void) {
- // if LEDs were previously on before poweroff, turn them back on
- if (rgb_init == false && rgblight_config.enable) {
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
- rgb_init = true;
- }
-
- rgblight_task();
- matrix_scan_user();
-}
-
-#endif
-
-// Optional override functions below.
-// You can leave any or all of these undefined.
-// These are only required if you want to perform custom actions.
-
-/*
-
-void matrix_init_kb(void) {
- // put your keyboard start-up code here
- // runs once when the firmware starts up
-
- matrix_init_user();
-}
-
-void matrix_scan_kb(void) {
- // put your looping keyboard code here
- // runs every cycle (a lot)
-
- matrix_scan_user();
-}
-
-bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
- // put your per-action keyboard code here
- // runs for every action, just before processing by the firmware
-
- return process_record_user(keycode, record);
-}
-
-void led_set_kb(uint8_t usb_led) {
- // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
-
- led_set_user(usb_led);
-}
-
-*/
diff --git a/keyboards/exent/rules.mk b/keyboards/exent/rules.mk
index a49f32058290..10442b31ba61 100644
--- a/keyboards/exent/rules.mk
+++ b/keyboards/exent/rules.mk
@@ -19,10 +19,8 @@ CONSOLE_ENABLE = yes
COMMAND_ENABLE = yes
BACKLIGHT_ENABLE = no
RGBLIGHT_ENABLE = yes
-RGBLIGHT_CUSTOM_DRIVER = yes
+WS2812_DRIVER = i2c
OPT_DEFS = -DDEBUG_LEVEL=0
-SRC += i2c_master.c
-
LAYOUTS = 65_ansi 65_iso
diff --git a/keyboards/facew/facew.c b/keyboards/facew/facew.c
index 7ec56548b16d..fa58f0cf79a1 100644
--- a/keyboards/facew/facew.c
+++ b/keyboards/facew/facew.c
@@ -16,51 +16,31 @@ along with this program. If not, see .
*/
#include "facew.h"
-#ifdef BACKLIGHT_ENABLE
-#include "backlight.h"
-#endif
-#ifdef RGBLIGHT_ENABLE
-#include "rgblight.h"
-#endif
-
-#include
-
-#include "action_layer.h"
-#include "i2c_master.h"
-#include "quantum.h"
-
-#ifdef RGBLIGHT_ENABLE
-extern rgblight_config_t rgblight_config;
-
-void rgblight_set(void) {
- if (!rgblight_config.enable) {
- for (uint8_t i = 0; i < RGBLED_NUM; i++) {
- led[i].r = 0;
- led[i].g = 0;
- led[i].b = 0;
- }
- }
-
- i2c_init();
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
-}
-#endif
-
-__attribute__ ((weak))
-void matrix_scan_user(void) {
-}
void backlight_init_ports(void) {
- DDRD |= (1<<0 | 1<<1 | 1<<4 | 1<<6);
- PORTD &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6);
+ setPinOutput(D0);
+ setPinOutput(D1);
+ setPinOutput(D4);
+ setPinOutput(D6);
+
+ writePinLow(D0);
+ writePinLow(D1);
+ writePinLow(D4);
+ writePinLow(D6);
}
void backlight_set(uint8_t level) {
if (level == 0) {
// Turn out the lights
- PORTD &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6);
+ writePinLow(D0);
+ writePinLow(D1);
+ writePinLow(D4);
+ writePinLow(D6);
} else {
// Turn on the lights
- PORTD |= (1<<0 | 1<<1 | 1<<4 | 1<<6);
+ writePinHigh(D0);
+ writePinHigh(D1);
+ writePinHigh(D4);
+ writePinHigh(D6);
}
}
diff --git a/keyboards/facew/rules.mk b/keyboards/facew/rules.mk
index c9942e369440..c4117d15d768 100644
--- a/keyboards/facew/rules.mk
+++ b/keyboards/facew/rules.mk
@@ -1,18 +1,3 @@
-# Copyright 2017 Luiz Ribeiro
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-
# MCU name
MCU = atmega32a
@@ -34,11 +19,8 @@ CONSOLE_ENABLE = yes
COMMAND_ENABLE = yes
BACKLIGHT_ENABLE = yes
RGBLIGHT_ENABLE = yes
-RGBLIGHT_CUSTOM_DRIVER = yes
+WS2812_DRIVER = i2c
OPT_DEFS = -DDEBUG_LEVEL=0
-# custom matrix setup
-SRC = i2c_master.c
-
LAYOUTS = 60_ansi
diff --git a/keyboards/ft/mars80/mars80.c b/keyboards/ft/mars80/mars80.c
index 75434508223b..8e512740877f 100644
--- a/keyboards/ft/mars80/mars80.c
+++ b/keyboards/ft/mars80/mars80.c
@@ -16,50 +16,6 @@
#include "mars80.h"
-#include "rgblight.h"
-#include "i2c_master.h"
-#include "quantum.h"
-
-#ifdef RGBLIGHT_ENABLE
-extern rgblight_config_t rgblight_config;
-
-void rgblight_set(void) {
- if (!rgblight_config.enable) {
- for (uint8_t i = 0; i < RGBLED_NUM; i++) {
- led[i].r = 0;
- led[i].g = 0;
- led[i].b = 0;
- }
- }
-
- i2c_init();
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
-}
-#endif
-
-void matrix_init_kb(void) {
-#ifdef RGBLIGHT_ENABLE
- if (rgblight_config.enable) {
- i2c_init();
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
- }
-#endif
- // call user level keymaps, if any
- matrix_init_user();
-}
-
-void matrix_scan_kb(void) {
-#ifdef RGBLIGHT_ENABLE
- rgblight_task();
-#endif
- matrix_scan_user();
- /* Nothing else for now. */
-}
-
-__attribute__ ((weak))
-void matrix_scan_user(void) {
-}
-
void backlight_init_ports(void) {
// initialize pins D0, D1, D4 and D6 as output
setPinOutput(D0);
@@ -75,17 +31,17 @@ void backlight_init_ports(void) {
}
void backlight_set(uint8_t level) {
- if (level == 0) {
+ if (level == 0) {
// turn backlight LEDs off
writePinLow(D0);
writePinLow(D1);
writePinLow(D4);
writePinLow(D6);
- } else {
+ } else {
// turn backlight LEDs on
writePinHigh(D0);
writePinHigh(D1);
writePinHigh(D4);
writePinHigh(D6);
- }
-}
\ No newline at end of file
+ }
+}
diff --git a/keyboards/ft/mars80/rules.mk b/keyboards/ft/mars80/rules.mk
index f1c79b196c57..de85d62c8e0a 100644
--- a/keyboards/ft/mars80/rules.mk
+++ b/keyboards/ft/mars80/rules.mk
@@ -1,18 +1,3 @@
-# Copyright 2019 Luiz Ribeiro
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-
# MCU name
MCU = atmega32a
@@ -34,10 +19,8 @@ CONSOLE_ENABLE = yes
COMMAND_ENABLE = yes
BACKLIGHT_ENABLE = yes
RGBLIGHT_ENABLE = yes
-RGBLIGHT_CUSTOM_DRIVER = yes
+WS2812_DRIVER = i2c
OPT_DEFS = -DDEBUG_LEVEL=0
-SRC += i2c_master.c
-
LAYOUTS = tkl_ansi tkl_iso
diff --git a/keyboards/gray_studio/hb85/hb85.c b/keyboards/gray_studio/hb85/hb85.c
index 3e4202358786..21562b9e0f0c 100644
--- a/keyboards/gray_studio/hb85/hb85.c
+++ b/keyboards/gray_studio/hb85/hb85.c
@@ -16,33 +16,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
-#include
-
-#include "rgblight.h"
-
-#include "i2c_master.h"
-#include "quantum.h"
-
-#ifdef RGBLIGHT_ENABLE
-extern rgblight_config_t rgblight_config;
-
-void rgblight_set(void) {
- if (!rgblight_config.enable) {
- for (uint8_t i = 0; i < RGBLED_NUM; i++) {
- led[i].r = 0;
- led[i].g = 0;
- led[i].b = 0;
- }
- }
-
- i2c_init();
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
-}
-#endif
-
-__attribute__ ((weak))
-void matrix_scan_user(void) {
-}
+#include "hb85.h"
void backlight_init_ports(void) {
// initialize pins D0, D1, D4 and D6 as output
@@ -51,7 +25,7 @@ void backlight_init_ports(void) {
setPinOutput(D4);
setPinOutput(D6);
- // turn RGB LEDs on
+ // turn backlight LEDs on
writePinHigh(D0);
writePinHigh(D1);
writePinHigh(D4);
@@ -59,17 +33,17 @@ void backlight_init_ports(void) {
}
void backlight_set(uint8_t level) {
- if (level == 0) {
- // turn RGB LEDs off
+ if (level == 0) {
+ // turn backlight LEDs off
writePinLow(D0);
writePinLow(D1);
writePinLow(D4);
writePinLow(D6);
- } else {
- // turn RGB LEDs on
+ } else {
+ // turn backlight LEDs on
writePinHigh(D0);
writePinHigh(D1);
writePinHigh(D4);
writePinHigh(D6);
- }
+ }
}
diff --git a/keyboards/gray_studio/hb85/rules.mk b/keyboards/gray_studio/hb85/rules.mk
index 5339aad89cb0..ec57b03dcbce 100644
--- a/keyboards/gray_studio/hb85/rules.mk
+++ b/keyboards/gray_studio/hb85/rules.mk
@@ -1,18 +1,3 @@
-# Copyright 2019 fcoury
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-
# MCU name
MCU = atmega32a
@@ -34,8 +19,6 @@ CONSOLE_ENABLE = yes
COMMAND_ENABLE = yes
BACKLIGHT_ENABLE = no
RGBLIGHT_ENABLE = yes
-RGBLIGHT_CUSTOM_DRIVER = yes
+WS2812_DRIVER = i2c
OPT_DEFS = -DDEBUG_LEVEL=0
-
-SRC += i2c_master.c
diff --git a/keyboards/jj4x4/jj4x4.c b/keyboards/jj4x4/jj4x4.c
index 265508b2d5b4..6330c89de5c6 100644
--- a/keyboards/jj4x4/jj4x4.c
+++ b/keyboards/jj4x4/jj4x4.c
@@ -17,40 +17,3 @@ along with this program. If not, see .
*/
#include "jj4x4.h"
-
-#ifdef RGBLIGHT_ENABLE
-
-#include
-#include "i2c_master.h"
-#include "rgblight.h"
-
-extern rgblight_config_t rgblight_config;
-
-void matrix_init_kb(void) {
- i2c_init();
- // call user level keymaps, if any
- matrix_init_user();
-}
-// custom RGB driver
-void rgblight_set(void) {
- if (!rgblight_config.enable) {
- memset(led, 0, 3 * RGBLED_NUM);
- }
-
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
-}
-
-bool rgb_init = false;
-
-void matrix_scan_kb(void) {
- // if LEDs were previously on before poweroff, turn them back on
- if (rgb_init == false && rgblight_config.enable) {
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
- rgb_init = true;
- }
-
- rgblight_task();
- matrix_scan_user();
-}
-
-#endif
diff --git a/keyboards/jj4x4/rules.mk b/keyboards/jj4x4/rules.mk
index fedc525f8efc..aa74cc7c92f6 100644
--- a/keyboards/jj4x4/rules.mk
+++ b/keyboards/jj4x4/rules.mk
@@ -1,18 +1,3 @@
-# Copyright 2017 Luiz Ribeiro
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-
# MCU name
MCU = atmega32a
@@ -40,7 +25,7 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
NKRO_ENABLE = no # USB Nkey Rollover
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
-RGBLIGHT_CUSTOM_DRIVER = yes
+WS2812_DRIVER = i2c
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
@@ -48,6 +33,4 @@ AUDIO_ENABLE = no # Audio output on port C6
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
-SRC += i2c_master.c
-
LAYOUTS = ortho_4x4
diff --git a/keyboards/kbdfans/kbdpad/mk1/mk1.c b/keyboards/kbdfans/kbdpad/mk1/mk1.c
index 71a47b7ba9c0..aa781875ce06 100644
--- a/keyboards/kbdfans/kbdpad/mk1/mk1.c
+++ b/keyboards/kbdfans/kbdpad/mk1/mk1.c
@@ -14,7 +14,7 @@
* along with this program. If not, see .
*/
-#include "quantum.h"
+#include "mk1.h"
#define NUMLOCK_PIN D0
diff --git a/keyboards/kbdfans/kbdpad/mk1/rules.mk b/keyboards/kbdfans/kbdpad/mk1/rules.mk
index f1f740760a25..b4cd885b1a3c 100644
--- a/keyboards/kbdfans/kbdpad/mk1/rules.mk
+++ b/keyboards/kbdfans/kbdpad/mk1/rules.mk
@@ -1,18 +1,3 @@
-# Copyright 2017 Luiz Ribeiro
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-
# MCU name
MCU = atmega32a
diff --git a/keyboards/panc60/panc60.c b/keyboards/panc60/panc60.c
index 16674d30d266..6bd16a4bdc48 100644
--- a/keyboards/panc60/panc60.c
+++ b/keyboards/panc60/panc60.c
@@ -13,52 +13,33 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-#include "panc60.h"
-#ifdef BACKLIGHT_ENABLE
-#include "backlight.h"
-#endif
-#ifdef RGBLIGHT_ENABLE
-#include "rgblight.h"
-#endif
-
-#include
-
-#include "action_layer.h"
-#include "i2c_master.h"
-#include "quantum.h"
-
-__attribute__ ((weak))
-void matrix_scan_user(void) {
-}
-#ifdef RGBLIGHT_ENABLE
-extern rgblight_config_t rgblight_config;
-
-void rgblight_set(void) {
- if (!rgblight_config.enable) {
- for (uint8_t i = 0; i < RGBLED_NUM; i++) {
- led[i].r = 0;
- led[i].g = 0;
- led[i].b = 0;
- }
- }
-
- i2c_init();
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
-}
-#endif
+#include "panc60.h"
void backlight_init_ports(void) {
- DDRD |= (1<<0 | 1<<1 | 1<<4 | 1<<6);
- PORTD &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6);
+ setPinOutput(D0);
+ setPinOutput(D1);
+ setPinOutput(D4);
+ setPinOutput(D6);
+
+ writePinLow(D0);
+ writePinLow(D1);
+ writePinLow(D4);
+ writePinLow(D6);
}
void backlight_set(uint8_t level) {
if (level == 0) {
// Turn out the lights
- PORTD &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6);
+ writePinLow(D0);
+ writePinLow(D1);
+ writePinLow(D4);
+ writePinLow(D6);
} else {
// Turn on the lights
- PORTD |= (1<<0 | 1<<1 | 1<<4 | 1<<6);
+ writePinHigh(D0);
+ writePinHigh(D1);
+ writePinHigh(D4);
+ writePinHigh(D6);
}
}
diff --git a/keyboards/panc60/rules.mk b/keyboards/panc60/rules.mk
index cdacb4be7dbe..d3ed4998bc1d 100644
--- a/keyboards/panc60/rules.mk
+++ b/keyboards/panc60/rules.mk
@@ -1,18 +1,3 @@
-# Copyright 2017 Luiz Ribeiro
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-
# MCU name
MCU = atmega32a
@@ -34,11 +19,8 @@ CONSOLE_ENABLE = yes
COMMAND_ENABLE = no
BACKLIGHT_ENABLE = yes
RGBLIGHT_ENABLE = yes
-RGBLIGHT_CUSTOM_DRIVER = yes
+WS2812_DRIVER = i2c
OPT_DEFS = -DDEBUG_LEVEL=0
-# custom matrix setup
-SRC = i2c_master.c
-
LAYOUTS = 60_ansi 60_hhkb
diff --git a/keyboards/pearl/pearl.c b/keyboards/pearl/pearl.c
index c8cd8a8609c3..093b5fdd9378 100644
--- a/keyboards/pearl/pearl.c
+++ b/keyboards/pearl/pearl.c
@@ -15,49 +15,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
-#include "rgblight.h"
-#include "i2c_master.h"
-#include "quantum.h"
-
-#ifdef RGBLIGHT_ENABLE
-extern rgblight_config_t rgblight_config;
-
-void rgblight_set(void) {
- if (!rgblight_config.enable) {
- for (uint8_t i = 0; i < RGBLED_NUM; i++) {
- led[i].r = 0;
- led[i].g = 0;
- led[i].b = 0;
- }
- }
-
- i2c_init();
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
-}
-#endif
-
-void matrix_init_kb(void) {
-#ifdef RGBLIGHT_ENABLE
- if (rgblight_config.enable) {
- i2c_init();
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
- }
-#endif
- // call user level keymaps, if any
- matrix_init_user();
-}
-
-void matrix_scan_kb(void) {
-#ifdef RGBLIGHT_ENABLE
- rgblight_task();
-#endif
- matrix_scan_user();
- /* Nothing else for now. */
-}
-
-__attribute__ ((weak))
-void matrix_scan_user(void) {
-}
+#include "pearl.h"
void backlight_init_ports(void) {
// initialize pins D0, D1, D4 and D6 as output
@@ -74,17 +32,17 @@ void backlight_init_ports(void) {
}
void backlight_set(uint8_t level) {
- if (level == 0) {
+ if (level == 0) {
// turn backlight LEDs off
writePinLow(D0);
writePinLow(D1);
writePinLow(D4);
writePinLow(D6);
- } else {
+ } else {
// turn backlight LEDs on
writePinHigh(D0);
writePinHigh(D1);
writePinHigh(D4);
writePinHigh(D6);
- }
-}
\ No newline at end of file
+ }
+}
diff --git a/keyboards/pearl/rules.mk b/keyboards/pearl/rules.mk
index eacf8bb2c3d4..79b783e42136 100644
--- a/keyboards/pearl/rules.mk
+++ b/keyboards/pearl/rules.mk
@@ -1,18 +1,3 @@
-# Copyright 2017 Luiz Ribeiro
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-
# MCU name
MCU = atmega32a
@@ -34,9 +19,6 @@ CONSOLE_ENABLE = yes
COMMAND_ENABLE = yes
BACKLIGHT_ENABLE = yes
RGBLIGHT_ENABLE = yes
-RGBLIGHT_CUSTOM_DRIVER = yes
+WS2812_DRIVER = i2c
OPT_DEFS = -DDEBUG_LEVEL=0
-
-# custom matrix setup
-SRC = i2c_master.c
diff --git a/keyboards/percent/skog_lite/rules.mk b/keyboards/percent/skog_lite/rules.mk
index ed29c47f2c26..1d2372c77fcd 100644
--- a/keyboards/percent/skog_lite/rules.mk
+++ b/keyboards/percent/skog_lite/rules.mk
@@ -1,18 +1,3 @@
-# Copyright 2017 Luiz Ribeiro
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-
# MCU name
MCU = atmega32a
@@ -34,10 +19,8 @@ CONSOLE_ENABLE = yes
COMMAND_ENABLE = yes
BACKLIGHT_ENABLE = yes
RGBLIGHT_ENABLE = yes
-RGBLIGHT_CUSTOM_DRIVER = yes
+WS2812_DRIVER = i2c
OPT_DEFS = -DDEBUG_LEVEL=0
-SRC = i2c_master.c
-
LAYOUTS = tkl_ansi
diff --git a/keyboards/percent/skog_lite/skog_lite.c b/keyboards/percent/skog_lite/skog_lite.c
index a77fc925868d..a6c00f52931f 100644
--- a/keyboards/percent/skog_lite/skog_lite.c
+++ b/keyboards/percent/skog_lite/skog_lite.c
@@ -13,49 +13,8 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-#include "rgblight.h"
-#include "i2c_master.h"
-#include "quantum.h"
-#ifdef RGBLIGHT_ENABLE
-extern rgblight_config_t rgblight_config;
-
-void rgblight_set(void) {
- if (!rgblight_config.enable) {
- for (uint8_t i = 0; i < RGBLED_NUM; i++) {
- led[i].r = 0;
- led[i].g = 0;
- led[i].b = 0;
- }
- }
-
- i2c_init();
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
-}
-#endif
-
-void matrix_init_kb(void) {
-#ifdef RGBLIGHT_ENABLE
- if (rgblight_config.enable) {
- i2c_init();
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
- }
-#endif
- // call user level keymaps, if any
- matrix_init_user();
-}
-
-void matrix_scan_kb(void) {
-#ifdef RGBLIGHT_ENABLE
- rgblight_task();
-#endif
- matrix_scan_user();
- /* Nothing else for now. */
-}
-
-__attribute__ ((weak))
-void matrix_scan_user(void) {
-}
+#include "skog_lite.h"
void backlight_init_ports(void) {
// initialize pins D0, D1, D4 and D6 as output
@@ -72,17 +31,17 @@ void backlight_init_ports(void) {
}
void backlight_set(uint8_t level) {
- if (level == 0) {
+ if (level == 0) {
// turn backlight LEDs off
writePinLow(D0);
writePinLow(D1);
writePinLow(D4);
writePinLow(D6);
- } else {
+ } else {
// turn backlight LEDs on
writePinHigh(D0);
writePinHigh(D1);
writePinHigh(D4);
writePinHigh(D6);
- }
+ }
}
diff --git a/keyboards/singa/rules.mk b/keyboards/singa/rules.mk
index df2a59e905b4..54328d248d13 100644
--- a/keyboards/singa/rules.mk
+++ b/keyboards/singa/rules.mk
@@ -1,18 +1,3 @@
-# Copyright 2017 Luiz Ribeiro
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-
# MCU name
MCU = atmega32a
@@ -34,8 +19,6 @@ CONSOLE_ENABLE = yes
COMMAND_ENABLE = yes
BACKLIGHT_ENABLE = yes
RGBLIGHT_ENABLE = yes
-RGBLIGHT_CUSTOM_DRIVER = yes
+WS2812_DRIVER = i2c
OPT_DEFS = -DDEBUG_LEVEL=0
-
-SRC = i2c_master.c
diff --git a/keyboards/singa/singa.c b/keyboards/singa/singa.c
index ee49ba65c100..144065d02953 100644
--- a/keyboards/singa/singa.c
+++ b/keyboards/singa/singa.c
@@ -13,49 +13,8 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-#include "rgblight.h"
-#include "i2c_master.h"
-#include "quantum.h"
-#ifdef RGBLIGHT_ENABLE
-extern rgblight_config_t rgblight_config;
-
-void rgblight_set(void) {
- if (!rgblight_config.enable) {
- for (uint8_t i = 0; i < RGBLED_NUM; i++) {
- led[i].r = 0;
- led[i].g = 0;
- led[i].b = 0;
- }
- }
-
- i2c_init();
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
-}
-#endif
-
-void matrix_init_kb(void) {
-#ifdef RGBLIGHT_ENABLE
- if (rgblight_config.enable) {
- i2c_init();
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
- }
-#endif
- // call user level keymaps, if any
- matrix_init_user();
-}
-
-void matrix_scan_kb(void) {
-#ifdef RGBLIGHT_ENABLE
- rgblight_task();
-#endif
- matrix_scan_user();
- /* Nothing else for now. */
-}
-
-__attribute__ ((weak))
-void matrix_scan_user(void) {
-}
+#include "singa.h"
void backlight_init_ports(void) {
// initialize pins D0, D1, D4 and D6 as output
@@ -72,17 +31,17 @@ void backlight_init_ports(void) {
}
void backlight_set(uint8_t level) {
- if (level == 0) {
+ if (level == 0) {
// turn backlight LEDs off
writePinLow(D0);
writePinLow(D1);
writePinLow(D4);
writePinLow(D6);
- } else {
+ } else {
// turn backlight LEDs on
writePinHigh(D0);
writePinHigh(D1);
writePinHigh(D4);
writePinHigh(D6);
- }
+ }
}
diff --git a/keyboards/tgr/alice/alice.c b/keyboards/tgr/alice/alice.c
index adb88fef0a88..39aed2cf5676 100644
--- a/keyboards/tgr/alice/alice.c
+++ b/keyboards/tgr/alice/alice.c
@@ -15,41 +15,4 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
-#include
-
-#include "rgblight.h"
-
-#include "i2c_master.h"
-#include "quantum.h"
-
-#ifdef RGBLIGHT_ENABLE
-extern rgblight_config_t rgblight_config;
-
-void matrix_init_kb(void) {
- i2c_init();
- // call user level keymaps, if any
- matrix_init_user();
-}
-
-// custom RGB driver
-void rgblight_set(void) {
- if (!rgblight_config.enable) {
- memset(led, 0, 3 * RGBLED_NUM);
- }
-
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
-}
-
-bool rgb_init = false;
-
-void matrix_scan_kb(void) {
- // if LEDs were previously on before poweroff, turn them back on
- if (rgb_init == false && rgblight_config.enable) {
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
- rgb_init = true;
- }
-
- rgblight_task();
- matrix_scan_user();
-}
-#endif
+#include "alice.h"
diff --git a/keyboards/tgr/alice/rules.mk b/keyboards/tgr/alice/rules.mk
index aa141f7c3b59..530e8ea32979 100644
--- a/keyboards/tgr/alice/rules.mk
+++ b/keyboards/tgr/alice/rules.mk
@@ -1,18 +1,3 @@
-# Copyright 2017 Luiz Ribeiro
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-
# MCU name
MCU = atmega32a
@@ -34,8 +19,6 @@ CONSOLE_ENABLE = yes
COMMAND_ENABLE = yes
BACKLIGHT_ENABLE = no
RGBLIGHT_ENABLE = yes
-RGBLIGHT_CUSTOM_DRIVER = yes
+WS2812_DRIVER = i2c
OPT_DEFS = -DDEBUG_LEVEL=0
-
-SRC += i2c_master.c
diff --git a/keyboards/tgr/jane/jane.c b/keyboards/tgr/jane/jane.c
index c17cb008486f..4ab0b300735e 100644
--- a/keyboards/tgr/jane/jane.c
+++ b/keyboards/tgr/jane/jane.c
@@ -13,49 +13,8 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-#include "i2c_master.h"
-#include "quantum.h"
-#ifdef RGBLIGHT_ENABLE
-#include "rgblight.h"
-extern rgblight_config_t rgblight_config;
-
-void rgblight_set(void) {
- if (!rgblight_config.enable) {
- for (uint8_t i = 0; i < RGBLED_NUM; i++) {
- led[i].r = 0;
- led[i].g = 0;
- led[i].b = 0;
- }
- }
-
- i2c_init();
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
-}
-#endif
-
-void matrix_init_kb(void) {
-#ifdef RGBLIGHT_ENABLE
- if (rgblight_config.enable) {
- i2c_init();
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
- }
-#endif
- // call user level keymaps, if any
- matrix_init_user();
-}
-
-void matrix_scan_kb(void) {
-#ifdef RGBLIGHT_ENABLE
- rgblight_task();
-#endif
- matrix_scan_user();
- /* Nothing else for now. */
-}
-
-__attribute__ ((weak))
-void matrix_scan_user(void) {
-}
+#include "jane.h"
void backlight_init_ports(void) {
// initialize pins D0, D1, D4 and D6 as output
@@ -72,17 +31,17 @@ void backlight_init_ports(void) {
}
void backlight_set(uint8_t level) {
- if (level == 0) {
+ if (level == 0) {
// turn backlight LEDs off
writePinLow(D0);
writePinLow(D1);
writePinLow(D4);
writePinLow(D6);
- } else {
+ } else {
// turn backlight LEDs on
writePinHigh(D0);
writePinHigh(D1);
writePinHigh(D4);
writePinHigh(D6);
- }
-}
\ No newline at end of file
+ }
+}
diff --git a/keyboards/tgr/jane/rules.mk b/keyboards/tgr/jane/rules.mk
index f2b4883066d3..c6a26d4a40b8 100644
--- a/keyboards/tgr/jane/rules.mk
+++ b/keyboards/tgr/jane/rules.mk
@@ -1,18 +1,3 @@
-# Copyright 2017 Luiz Ribeiro
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-
# MCU name
MCU = atmega32a
@@ -34,10 +19,8 @@ CONSOLE_ENABLE = yes
COMMAND_ENABLE = yes
BACKLIGHT_ENABLE = yes
RGBLIGHT_ENABLE = no
-RGBLIGHT_CUSTOM_DRIVER = no
+WS2812_DRIVER = i2c
OPT_DEFS = -DDEBUG_LEVEL=0
-QUANTUM_LIB_SRC = i2c_master.c
-
LAYOUTS = tkl_ansi tkl_iso
diff --git a/keyboards/unikorn/readme.md b/keyboards/unikorn/readme.md
index 3175cddc2ded..1f8b16d649b7 100644
--- a/keyboards/unikorn/readme.md
+++ b/keyboards/unikorn/readme.md
@@ -18,7 +18,6 @@ To enable RGB lighting support, install the necessary components and set RGBLIGH
```
RGBLIGHT_ENABLE = yes
-RGBLIGHT_CUSTOM_DRIVER = yes
```
diff --git a/keyboards/unikorn/rules.mk b/keyboards/unikorn/rules.mk
index d4f4d2aaf308..e57c21c856bb 100644
--- a/keyboards/unikorn/rules.mk
+++ b/keyboards/unikorn/rules.mk
@@ -1,18 +1,3 @@
-# Copyright 2017 Luiz Ribeiro
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-
# MCU name
MCU = atmega32a
@@ -34,8 +19,6 @@ CONSOLE_ENABLE = yes
COMMAND_ENABLE = yes
BACKLIGHT_ENABLE = yes
RGBLIGHT_ENABLE = no
-RGBLIGHT_CUSTOM_DRIVER = no
+WS2812_DRIVER = i2c
OPT_DEFS = -DDEBUG_LEVEL=0
-
-SRC = i2c_master.c
diff --git a/keyboards/unikorn/unikorn.c b/keyboards/unikorn/unikorn.c
index 1bd47ef9e1af..70bc5a988f43 100644
--- a/keyboards/unikorn/unikorn.c
+++ b/keyboards/unikorn/unikorn.c
@@ -14,49 +14,7 @@
* along with this program. If not, see .
*/
-#include "i2c_master.h"
-#include "quantum.h"
-
-#ifdef RGBLIGHT_ENABLE
-#include "rgblight.h"
-extern rgblight_config_t rgblight_config;
-
-void rgblight_set(void) {
- if (!rgblight_config.enable) {
- for (uint8_t i = 0; i < RGBLED_NUM; i++) {
- led[i].r = 0;
- led[i].g = 0;
- led[i].b = 0;
- }
- }
-
- i2c_init();
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
-}
-#endif
-
-void matrix_init_kb(void) {
-#ifdef RGBLIGHT_ENABLE
- if (rgblight_config.enable) {
- i2c_init();
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
- }
-#endif
- // call user level keymaps, if any
- matrix_init_user();
-}
-
-void matrix_scan_kb(void) {
-#ifdef RGBLIGHT_ENABLE
- rgblight_task();
-#endif
- matrix_scan_user();
- /* Nothing else for now. */
-}
-
-__attribute__ ((weak))
-void matrix_scan_user(void) {
-}
+#include "unikorn.h"
void backlight_init_ports(void) {
// initialize pins D0, D1, D4 and D6 as output
@@ -73,17 +31,17 @@ void backlight_init_ports(void) {
}
void backlight_set(uint8_t level) {
- if (level == 0) {
+ if (level == 0) {
// turn backlight LEDs off
writePinLow(D0);
writePinLow(D1);
writePinLow(D4);
writePinLow(D6);
- } else {
+ } else {
// turn backlight LEDs on
writePinHigh(D0);
writePinHigh(D1);
writePinHigh(D4);
writePinHigh(D6);
- }
+ }
}
diff --git a/keyboards/winkeyless/bface/bface.c b/keyboards/winkeyless/bface/bface.c
index 1c83be4b8d57..8cb5b600cdd7 100644
--- a/keyboards/winkeyless/bface/bface.c
+++ b/keyboards/winkeyless/bface/bface.c
@@ -13,49 +13,8 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-#include "rgblight.h"
-#include "i2c_master.h"
-#include "quantum.h"
-#ifdef RGBLIGHT_ENABLE
-extern rgblight_config_t rgblight_config;
-
-void rgblight_set(void) {
- if (!rgblight_config.enable) {
- for (uint8_t i = 0; i < RGBLED_NUM; i++) {
- led[i].r = 0;
- led[i].g = 0;
- led[i].b = 0;
- }
- }
-
- i2c_init();
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
-}
-#endif
-
-void matrix_init_kb(void) {
-#ifdef RGBLIGHT_ENABLE
- if (rgblight_config.enable) {
- i2c_init();
- i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
- }
-#endif
- // call user level keymaps, if any
- matrix_init_user();
-}
-
-void matrix_scan_kb(void) {
-#ifdef RGBLIGHT_ENABLE
- rgblight_task();
-#endif
- matrix_scan_user();
- /* Nothing else for now. */
-}
-
-__attribute__ ((weak))
-void matrix_scan_user(void) {
-}
+#include "bface.h"
void backlight_init_ports(void) {
// initialize pins D0, D1, D4 and D6 as output
@@ -72,17 +31,17 @@ void backlight_init_ports(void) {
}
void backlight_set(uint8_t level) {
- if (level == 0) {
+ if (level == 0) {
// turn backlight LEDs off
writePinLow(D0);
writePinLow(D1);
writePinLow(D4);
writePinLow(D6);
- } else {
+ } else {
// turn backlight LEDs on
writePinHigh(D0);
writePinHigh(D1);
writePinHigh(D4);
writePinHigh(D6);
- }
+ }
}
diff --git a/keyboards/winkeyless/bface/bface.h b/keyboards/winkeyless/bface/bface.h
index f7a3b9521f48..bca0c24c1afb 100644
--- a/keyboards/winkeyless/bface/bface.h
+++ b/keyboards/winkeyless/bface/bface.h
@@ -18,9 +18,7 @@ along with this program. If not, see .
#pragma once
-#include "quantum_keycodes.h"
-#include "keycode.h"
-#include "action.h"
+#include "quantum.h"
#define LAYOUT_60_ansi( \
K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, \
diff --git a/keyboards/winkeyless/bface/rules.mk b/keyboards/winkeyless/bface/rules.mk
index 12b502785584..506e37ac9c02 100644
--- a/keyboards/winkeyless/bface/rules.mk
+++ b/keyboards/winkeyless/bface/rules.mk
@@ -1,18 +1,3 @@
-# Copyright 2017 Luiz Ribeiro
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-
# MCU name
MCU = atmega32a
@@ -36,9 +21,6 @@ BACKLIGHT_ENABLE = yes
BACKLIGHT_CUSTOM_DRIVER = yes
BACKLIGHT_BREATHING = no
RGBLIGHT_ENABLE = yes
-RGBLIGHT_CUSTOM_DRIVER = yes
+WS2812_DRIVER = i2c
OPT_DEFS = -DDEBUG_LEVEL=0
-
-# custom matrix setup
-SRC = i2c_master.c
From d382eeeb9d3b795c16533c5f64ab1455e774f925 Mon Sep 17 00:00:00 2001
From: Joel Challis
Date: Tue, 5 Nov 2019 00:18:57 +0000
Subject: [PATCH 09/16] CI - Fix change detection (#7038)
* Fix travis change detection
* Fix travis change detection - add back python ignore
---
.travis.yml | 1 +
util/travis_build.sh | 79 +++++++++++++++---------------------
util/travis_compiled_push.sh | 1 +
util/travis_docs.sh | 1 +
util/travis_push.sh | 5 ---
util/travis_test.sh | 27 +++---------
util/travis_utils.sh | 24 +++++++++++
7 files changed, 64 insertions(+), 74 deletions(-)
create mode 100755 util/travis_utils.sh
diff --git a/.travis.yml b/.travis.yml
index 84fa63faf3d3..bfac998c11ed 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -16,6 +16,7 @@ install:
- npm install -g moxygen
script:
- git rev-parse --short HEAD
+ - git diff --name-only HEAD $TRAVIS_BRANCH
- bash util/travis_test.sh
- bash util/travis_build.sh
- bash util/travis_docs.sh
diff --git a/util/travis_build.sh b/util/travis_build.sh
index 225c8548f525..6d5dbed6843d 100755
--- a/util/travis_build.sh
+++ b/util/travis_build.sh
@@ -1,57 +1,42 @@
#!/bin/bash
-# if docker is installed - patch calls to within the qmk docker image
-if command -v docker >/dev/null; then
- function make() {
- docker run --rm -e MAKEFLAGS="$MAKEFLAGS" -w /qmk_firmware/ -v "$PWD":/qmk_firmware --user $(id -u):$(id -g) qmkfm/base_container make "$@"
- }
+source util/travis_utils.sh
+
+NUM_CORE_CHANGES=$(echo "$QMK_CHANGES" | grep -Ecv -e '^(docs/)' -e '^(keyboards/)' -e '^(layouts/)' -e '^(util/)' -e '^(lib/python/)' -e '^(bin/qmk)' -e '^(requirements.txt)' -e '(.travis.yml)')
+
+if [[ "$TRAVIS_COMMIT_MESSAGE" == *"[skip build]"* ]]; then
+ echo "Skipping due to commit message"
+ exit 0
fi
-# test force push
-#TRAVIS_COMMIT_RANGE="c287f1bfc5c8...81f62atc4c1d"
+if [ "$LOCAL_BRANCH" == "master" ] || [ "$NUM_CORE_CHANGES" != "0" ]; then
+ echo "Making default keymaps for all keyboards"
+ make all:default
+ exit $?
+fi
-TRAVIS_COMMIT_MESSAGE="${TRAVIS_COMMIT_MESSAGE:-none}"
-TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE:-HEAD~1..HEAD}"
-MAKE_ALL="make all:default"
+exit_code=0
-if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip build]"* ]] ; then
- exit_code=0
- git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE}
- if [ $? -eq 128 ]; then
- # We don't know what changed so just build the default keymaps
- echo "Making default keymaps for all keyboards (fallback)"
- eval $MAKE_ALL
+for KB in $(make list-keyboards); do
+ KEYBOARD_CHANGES=$(echo "$QMK_CHANGES" | grep -E '^(keyboards/'${KB}'/)')
+ if [[ -z "$KEYBOARD_CHANGES" ]]; then
+ # skip as no changes for this keyboard
+ continue
+ fi
+
+ KEYMAP_ONLY=$(echo "$KEYBOARD_CHANGES" | grep -cv /keymaps/)
+ if [[ $KEYMAP_ONLY -gt 0 ]]; then
+ echo "Making all keymaps for $KB"
+ make ${KB}:all
: $((exit_code = $exit_code + $?))
else
- NEFM=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -Ev '^(keyboards/)' | grep -Ev '^(docs/)' | grep -Ev '^(lib/python/)' | grep -Ev '^(bin/qmk)' | grep -Ev '^(requirements.txt)' | grep -Ev '^(util/)' | wc -l)
- BRANCH=$(git rev-parse --abbrev-ref HEAD)
- # is this branch master or a "non docs, non keyboards" change
- if [ $NEFM -gt 0 -o "$BRANCH" = "master" ]; then
- echo "Making default keymaps for all keyboards"
- eval $MAKE_ALL
+ CHANGED_KEYMAPS=$(echo "$KEYBOARD_CHANGES" | grep -oP '(?<=keyboards/'${KB}'/keymaps/)([a-zA-Z0-9_-]+)(?=\/)')
+ for KM in $CHANGED_KEYMAPS ; do
+ echo "Making $KM for $KB"
+ make ${KB}:${KM}
: $((exit_code = $exit_code + $?))
- else
- # keyboards project format
- # /keyboards/board1/rev/keymaps/
- # /keyboards/board2/keymaps/
- # ensure we strip everything off after and including the keymaps folder to get board and/or revision
- MKB=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -oP '(?<=keyboards\/)([a-zA-Z0-9_\/]+)(?=\/)' | sed 's^/keymaps/.*^^' | sort -u)
- for KB in $MKB ; do
- KEYMAP_ONLY=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -Ev '^(keyboards/'${KB}'/keymaps/)' | wc -l)
- if [[ $KEYMAP_ONLY -gt 0 ]]; then
- echo "Making all keymaps for $KB"
- make ${KB}:all
- : $((exit_code = $exit_code + $?))
- else
- MKM=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -oP '(?<=keyboards/'${KB}'/keymaps/)([a-zA-Z0-9_]+)(?=\/)' | sort -u)
- for KM in $MKM ; do
- echo "Making $KM for $KB"
- make ${KB}:${KM}
- : $((exit_code = $exit_code + $?))
- done
- fi
- done
- fi
+ done
fi
- exit $exit_code
-fi
+done
+
+exit $exit_code
diff --git a/util/travis_compiled_push.sh b/util/travis_compiled_push.sh
index 8ca65f21a05d..e0490cd702a9 100755
--- a/util/travis_compiled_push.sh
+++ b/util/travis_compiled_push.sh
@@ -1,5 +1,6 @@
#!/bin/bash
+source util/travis_utils.sh
source util/travis_push.sh
set -o errexit -o nounset
diff --git a/util/travis_docs.sh b/util/travis_docs.sh
index 5cfd63466d22..93c2d7186729 100755
--- a/util/travis_docs.sh
+++ b/util/travis_docs.sh
@@ -1,5 +1,6 @@
#!/bin/bash
+source util/travis_utils.sh
source util/travis_push.sh
if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip docs]"* ]] ; then
diff --git a/util/travis_push.sh b/util/travis_push.sh
index d100f9d48f7a..7f7d4c2c647d 100755
--- a/util/travis_push.sh
+++ b/util/travis_push.sh
@@ -1,10 +1,5 @@
# Use this by sourcing it in your script.
-TRAVIS_BRANCH="${TRAVIS_BRANCH:master}"
-TRAVIS_PULL_REQUEST="${TRAVIS_PULL_REQUEST:false}"
-TRAVIS_COMMIT_MESSAGE="${TRAVIS_COMMIT_MESSAGE:-none}"
-TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE:-HEAD~1..HEAD}"
-
if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]] ; then
git config --global user.name "QMK Bot"
git config --global user.email "hello@qmk.fm"
diff --git a/util/travis_test.sh b/util/travis_test.sh
index 9b7402c28241..95991907ef35 100644
--- a/util/travis_test.sh
+++ b/util/travis_test.sh
@@ -1,26 +1,9 @@
#!/bin/bash
-# if docker is installed - patch calls to within the qmk docker image
-if command -v docker >/dev/null; then
- function make() {
- docker run --rm -e MAKEFLAGS="$MAKEFLAGS" -w /qmk_firmware/ -v "$PWD":/qmk_firmware --user $(id -u):$(id -g) qmkfm/base_container make "$@"
- }
- function qmk() {
- docker run --rm -w /qmk_firmware/ -v "$PWD":/qmk_firmware --user $(id -u):$(id -g) qmkfm/base_container bin/qmk "$@"
- }
-fi
-
-TRAVIS_COMMIT_MESSAGE="${TRAVIS_COMMIT_MESSAGE:-none}"
-TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE:-HEAD~1..HEAD}"
-
-# test force push
-#TRAVIS_COMMIT_RANGE="c287f1bfc5c8...81f62atc4c1d"
-
-BRANCH=$(git rev-parse --abbrev-ref HEAD)
-CHANGES=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE})
+source util/travis_utils.sh
-NUM_CORE_CHANGES=$(echo "$CHANGES" | grep -Ecv -e '^(docs/)' -e '^(keyboards/)' -e '^(layouts/)')
-NUM_PY_CHANGES=$(echo "$CHANGES" | grep -Ec -e '^(lib/python/)' -e '^(bin/qmk)')
+NUM_CORE_CHANGES=$(echo "$QMK_CHANGES" | grep -Ecv -e '^(docs/)' -e '^(keyboards/)' -e '^(layouts/)' -e '^(util/)' -e '^(lib/python/)' -e '^(bin/qmk)' -e '^(requirements.txt)' -e '(.travis.yml)')
+NUM_PY_CHANGES=$(echo "$QMK_CHANGES" | grep -Ec -e '^(lib/python/)' -e '^(bin/qmk)')
if [[ "$TRAVIS_COMMIT_MESSAGE" == *"[skip test]"* ]]; then
echo "Skipping due to commit message"
@@ -29,14 +12,14 @@ fi
exit_code=0
-if [ "$BRANCH" == "master" ] || [ "$NUM_CORE_CHANGES" != "0" ]; then
+if [ "$LOCAL_BRANCH" == "master" ] || [ "$NUM_CORE_CHANGES" != "0" ]; then
echo "Running tests."
make test:all
: $((exit_code = $exit_code + $?))
fi
-if [ "$BRANCH" == "master" ] || [ "$NUM_PY_CHANGES" != "0" ]; then
+if [ "$LOCAL_BRANCH" == "master" ] || [ "$NUM_PY_CHANGES" != "0" ]; then
echo "Running python tests."
qmk pytest
: $((exit_code = $exit_code + $?))
diff --git a/util/travis_utils.sh b/util/travis_utils.sh
new file mode 100755
index 000000000000..031bcda1a82c
--- /dev/null
+++ b/util/travis_utils.sh
@@ -0,0 +1,24 @@
+# Use this by sourcing it in your script.
+
+# Provide sane defaults for travis environment
+TRAVIS_BRANCH="${TRAVIS_BRANCH:master}"
+TRAVIS_PULL_REQUEST="${TRAVIS_PULL_REQUEST:false}"
+TRAVIS_COMMIT_MESSAGE="${TRAVIS_COMMIT_MESSAGE:-none}"
+TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE:-HEAD~1..HEAD}"
+
+# test force push
+#TRAVIS_COMMIT_RANGE="c287f1bfc5c8...81f62atc4c1d"
+
+# Extra variables
+LOCAL_BRANCH=${TRAVIS_PULL_REQUEST_BRANCH:-${TRAVIS_BRANCH}}
+QMK_CHANGES=$(git diff --name-only HEAD ${TRAVIS_BRANCH})
+
+# if docker is installed - patch calls to within the qmk docker image
+if command -v docker >/dev/null; then
+ function make() {
+ docker run --rm -e MAKEFLAGS="$MAKEFLAGS" -w /qmk_firmware/ -v "$PWD":/qmk_firmware --user $(id -u):$(id -g) qmkfm/base_container make "$@"
+ }
+ function qmk() {
+ docker run --rm -w /qmk_firmware/ -v "$PWD":/qmk_firmware --user $(id -u):$(id -g) qmkfm/base_container bin/qmk "$@"
+ }
+fi
From 0e664f92c4d61d685259607d7257c53f60da5fc0 Mon Sep 17 00:00:00 2001
From: Jonathan Rascher
Date: Tue, 5 Nov 2019 00:37:54 -0600
Subject: [PATCH 10/16] Switch Quefrency to serial for independent halves
(#7262)
---
keyboards/keebio/quefrency/keymaps/bcat/config.h | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/keyboards/keebio/quefrency/keymaps/bcat/config.h b/keyboards/keebio/quefrency/keymaps/bcat/config.h
index 87eaa6a7837f..071856f10b2c 100644
--- a/keyboards/keebio/quefrency/keymaps/bcat/config.h
+++ b/keyboards/keebio/quefrency/keymaps/bcat/config.h
@@ -1,6 +1,12 @@
#pragma once
-#define USE_I2C
+/*
+ * Quefrency lacks I2C resistors on the right PCB, so the right half doesn't
+ * work independently. (Presumably the floating I2C lines cause a problem.)
+ * Using serial seems sufficiently fast in practice and allows both halves to
+ * be used independently.
+ */
+#define USE_SERIAL
/* Use an extra LED on the right side since it's wider on the 65% PCB. */
#undef RGBLED_NUM
From 542cb0a8ce3f324c6bd46751d733daf86384a8f6 Mon Sep 17 00:00:00 2001
From: Drashna Jaelre
Date: Mon, 4 Nov 2019 22:59:13 -0800
Subject: [PATCH 11/16] [Core] Convert Dynamic Macro to a Core Feature (#5948)
* Convert Dynamic Macro to a Core Feature
This imports the code from Dynamic Macro into the core code, and handles it, as such.
This deprecates the old method but does not remove it, for legacy support. This way, no existing user files need to be touched.
Additionally, this reorganizes the documentation to better reflect the changes.
Also, it adds user hooks to the feature so users can customize the existing functionality.
Based heavily on and closes #2976
* Apply suggestions from code review
Co-Authored-By: fauxpark
Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>
* Cleanup based on feedback
* Add short-form keycodes and document them
- add short-form keycodes to quantum/quantum_keycodes.h
- document the new aliases in docs/feature_dynamic_macros.md
* Add Dynamic Macros section and keycodes to docs/keycodes.md
* Make anti-nesting optional
* Add documentation for DYNAMIC_MACRO_NO_NESTING option
* Fix Merge artifacts
* Fix formatting typo in docs
Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com>
* Remove DYNAMIC_MACRO_RANGE as it's not needed
* Fix includes and layer var type
---
common_features.mk | 6 +-
docs/feature_dynamic_macros.md | 75 ++---
docs/keycodes.md | 10 +
quantum/dynamic_macro.h | 20 +-
.../process_keycode/process_dynamic_macro.c | 257 ++++++++++++++++++
.../process_keycode/process_dynamic_macro.h | 41 +++
quantum/quantum.c | 14 +-
quantum/quantum.h | 4 +
quantum/quantum_keycodes.h | 16 +-
9 files changed, 384 insertions(+), 59 deletions(-)
create mode 100644 quantum/process_keycode/process_dynamic_macro.c
create mode 100644 quantum/process_keycode/process_dynamic_macro.h
diff --git a/common_features.mk b/common_features.mk
index a1f95955a60c..e50207b0b4b5 100644
--- a/common_features.mk
+++ b/common_features.mk
@@ -407,8 +407,12 @@ ifeq ($(strip $(SPACE_CADET_ENABLE)), yes)
OPT_DEFS += -DSPACE_CADET_ENABLE
endif
-
ifeq ($(strip $(DIP_SWITCH_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/dip_switch.c
OPT_DEFS += -DDIP_SWITCH_ENABLE
endif
+
+ifeq ($(strip $(DYNAMIC_MACRO_ENABLE)), yes)
+ SRC += $(QUANTUM_DIR)/process_keycode/process_dynamic_macro.c
+ OPT_DEFS += -DDYNAMIC_MACRO_ENABLE
+endif
diff --git a/docs/feature_dynamic_macros.md b/docs/feature_dynamic_macros.md
index 0d11a28641a6..b86df6c60ffe 100644
--- a/docs/feature_dynamic_macros.md
+++ b/docs/feature_dynamic_macros.md
@@ -4,51 +4,45 @@ QMK supports temporary macros created on the fly. We call these Dynamic Macros.
You can store one or two macros and they may have a combined total of 128 keypresses. You can increase this size at the cost of RAM.
-To enable them, first add a new element to the end of your `keycodes` enum — `DYNAMIC_MACRO_RANGE`:
+To enable them, first include `DYNAMIC_MACRO_ENABLE = yes` in your `rules.mk`. Then, add the following keys to your keymap:
-```c
-enum keycodes {
- QWERTY = SAFE_RANGE,
- COLEMAK,
- DVORAK,
- PLOVER,
- LOWER,
- RAISE,
- BACKLIT,
- EXT_PLV,
- DYNAMIC_MACRO_RANGE,
-};
-```
+|Key |Alias |Description |
+|------------------|----------|---------------------------------------------------|
+|`DYN_REC_START1` |`DM_REC1` |Start recording Macro 1 |
+|`DYN_REC_START2` |`DM_REC2` |Start recording Macro 2 |
+|`DYN_MACRO_PLAY1` |`DM_PLY1` |Replay Macro 1 |
+|`DYN_MACRO_PLAY2` |`DM_PLY2` |Replay Macro 2 |
+|`DYN_REC_STOP` |`DM_RSTP` |Finish the macro that is currently being recorded. |
-Your `keycodes` enum may have a slightly different name. You must add `DYNAMIC_MACRO_RANGE` as the last element because `dynamic_macros.h` will add some more keycodes after it.
+That should be everything necessary.
-Below it, include the `dynamic_macro.h` header:
+To start recording the macro, press either `DYN_REC_START1` or `DYN_REC_START2`.
-```c
- #include "dynamic_macro.h"`
-```
+To finish the recording, press the `DYN_REC_STOP` layer button.
-Add the following keys to your keymap:
+To replay the macro, press either `DYN_MACRO_PLAY1` or `DYN_MACRO_PLAY2`.
-* `DYN_REC_START1` — start recording the macro 1,
-* `DYN_REC_START2` — start recording the macro 2,
-* `DYN_MACRO_PLAY1` — replay the macro 1,
-* `DYN_MACRO_PLAY2` — replay the macro 2,
-* `DYN_REC_STOP` — finish the macro that is currently being recorded.
+It is possible to replay a macro as part of a macro. It's ok to replay macro 2 while recording macro 1 and vice versa but never create recursive macros i.e. macro 1 that replays macro 1. If you do so and the keyboard will get unresponsive, unplug the keyboard and plug it again. You can disable this completly by defining `DYNAMIC_MACRO_NO_NESTING` in your `config.h` file.
-Add the following code to the very beginning of your `process_record_user()` function:
+?> For the details about the internals of the dynamic macros, please read the comments in the `process_dynamic_macro.h` and `process_dynamic_macro.c` files.
-```c
- if (!process_record_dynamic_macro(keycode, record)) {
- return false;
- }
-```
+## Customization
-That should be everything necessary. To start recording the macro, press either `DYN_REC_START1` or `DYN_REC_START2`. To finish the recording, press the `DYN_REC_STOP` layer button. To replay the macro, press either `DYN_MACRO_PLAY1` or `DYN_MACRO_PLAY2`.
+There are a number of options added that should allow some additional degree of customization
-Note that it's possible to replay a macro as part of a macro. It's ok to replay macro 2 while recording macro 1 and vice versa but never create recursive macros i.e. macro 1 that replays macro 1. If you do so and the keyboard will get unresponsive, unplug the keyboard and plug it again.
+|Define |Default |Description |
+|----------------------------|----------------|-----------------------------------------------------------------------------------------------------------------|
+|`DYNAMIC_MACRO_SIZE` |128 |Sets the amount of memory that Dynamic Macros can use. This is a limited resource, dependent on the controller. |
+|`DYNAMIC_MACRO_USER_CALL` |*Not defined* |Defining this falls back to using the user `keymap.c` file to trigger the macro behavior. |
+|`DYNAMIC_MACRO_NO_NESTING` |*Not Defined* |Defining this disables the ability to call a macro from another macro (nested macros). |
-For users of the earlier versions of dynamic macros: It is still possible to finish the macro recording using just the layer modifier used to access the dynamic macro keys, without a dedicated `DYN_REC_STOP` key. If you want this behavior back, use the following snippet instead of the one above:
+
+If the LEDs start blinking during the recording with each keypress, it means there is no more space for the macro in the macro buffer. To fit the macro in, either make the other macro shorter (they share the same buffer) or increase the buffer size by adding the `DYNAMIC_MACRO_SIZE` define in your `config.h` (default value: 128; please read the comments for it in the header).
+
+
+### DYNAMIC_MACRO_USER_CALL
+
+For users of the earlier versions of dynamic macros: It is still possible to finish the macro recording using just the layer modifier used to access the dynamic macro keys, without a dedicated `DYN_REC_STOP` key. If you want this behavior back, add `#define DYNAMIC_MACRO_USER_CALL` to your `config.h` and insert the following snippet at the beginning of your `process_record_user()` function:
```c
uint16_t macro_kc = (keycode == MO(_DYN) ? DYN_REC_STOP : keycode);
@@ -58,6 +52,15 @@ For users of the earlier versions of dynamic macros: It is still possible to fin
}
```
-If the LEDs start blinking during the recording with each keypress, it means there is no more space for the macro in the macro buffer. To fit the macro in, either make the other macro shorter (they share the same buffer) or increase the buffer size by setting the `DYNAMIC_MACRO_SIZE` preprocessor macro (default value: 128; please read the comments for it in the header).
+### User Hooks
+
+There are a number of hooks that you can use to add custom functionality and feedback options to Dynamic Macro feature. This allows for some additional degree of customization.
+
+Note, that direction indicates which macro it is, with `1` being Macro 1, `-1` being Macro 2, and 0 being no macro.
+
+* `dynamic_macro_record_start_user(void)` - Triggered when you start recording a macro.
+* `dynamic_macro_play_user(int8_t direction)` - Triggered when you play back a macro.
+* `dynamic_macro_record_key_user(int8_t direction, keyrecord_t *record)` - Triggered on each keypress while recording a macro.
+* `dynamic_macro_record_end_user(int8_t direction)` - Triggered when the macro recording is stopped.
-For the details about the internals of the dynamic macros, please read the comments in the `dynamic_macro.h` header.
+Additionally, you can call `dynamic_macro_led_blink()` to flash the backlights if that feature is enabled.
diff --git a/docs/keycodes.md b/docs/keycodes.md
index 7dcff03fd549..fa01df63dca7 100644
--- a/docs/keycodes.md
+++ b/docs/keycodes.md
@@ -297,6 +297,16 @@ This is a reference only. Each group of keys links to the page documenting their
|`OUT_USB` |USB only |
|`OUT_BT` |Bluetooth only |
+## [Dynamic Macros](feature_dynamic_macros.md)
+
+|Key |Alias |Description |
+|-----------------|---------|--------------------------------------------------|
+|`DYN_REC_START1` |`DM_REC1`|Start recording Macro 1 |
+|`DYN_REC_START2` |`DM_REC2`|Start recording Macro 2 |
+|`DYN_MACRO_PLAY1`|`DM_PLY1`|Replay Macro 1 |
+|`DYN_MACRO_PLAY2`|`DM_PLY2`|Replay Macro 2 |
+|`DYN_REC_STOP` |`DM_RSTP`|Finish the macro that is currently being recorded.|
+
## [Layer Switching](feature_advanced_keycodes.md#switching-and-toggling-layers)
|Key |Description |
diff --git a/quantum/dynamic_macro.h b/quantum/dynamic_macro.h
index c7632c004b1c..fe9de6fa6516 100644
--- a/quantum/dynamic_macro.h
+++ b/quantum/dynamic_macro.h
@@ -15,8 +15,10 @@
*/
/* Author: Wojciech Siewierski < wojciech dot siewierski at onet dot pl > */
-#ifndef DYNAMIC_MACROS_H
-#define DYNAMIC_MACROS_H
+#pragma once
+
+/* Warn users that this is now deprecated and they should use the core feature instead. */
+#pragma message "Dynamic Macros is now a core feature. See updated documentation to see how to configure it: https://docs.qmk.fm/#/feature_dynamic_macros"
#include "action_layer.h"
@@ -33,18 +35,6 @@
# define DYNAMIC_MACRO_SIZE 128
#endif
-/* DYNAMIC_MACRO_RANGE must be set as the last element of user's
- * "planck_keycodes" enum prior to including this header. This allows
- * us to 'extend' it.
- */
-enum dynamic_macro_keycodes {
- DYN_REC_START1 = DYNAMIC_MACRO_RANGE,
- DYN_REC_START2,
- DYN_REC_STOP,
- DYN_MACRO_PLAY1,
- DYN_MACRO_PLAY2,
-};
-
/* Blink the LEDs to notify the user about some event. */
void dynamic_macro_led_blink(void) {
#ifdef BACKLIGHT_ENABLE
@@ -272,5 +262,3 @@ bool process_record_dynamic_macro(uint16_t keycode, keyrecord_t *record) {
#undef DYNAMIC_MACRO_CURRENT_SLOT
#undef DYNAMIC_MACRO_CURRENT_LENGTH
#undef DYNAMIC_MACRO_CURRENT_CAPACITY
-
-#endif
diff --git a/quantum/process_keycode/process_dynamic_macro.c b/quantum/process_keycode/process_dynamic_macro.c
new file mode 100644
index 000000000000..2065f242db9e
--- /dev/null
+++ b/quantum/process_keycode/process_dynamic_macro.c
@@ -0,0 +1,257 @@
+/* Copyright 2016 Jack Humbert
+ * Copyright 2019 Drashna Jael're (@drashna, aka Christopher Courtney)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+/* Author: Wojciech Siewierski < wojciech dot siewierski at onet dot pl > */
+#include "process_dynamic_macro.h"
+
+// default feedback method
+void dynamic_macro_led_blink(void) {
+#ifdef BACKLIGHT_ENABLE
+ backlight_toggle();
+ wait_ms(100);
+ backlight_toggle();
+#endif
+}
+
+/* User hooks for Dynamic Macros */
+
+__attribute__((weak)) void dynamic_macro_record_start_user(void) { dynamic_macro_led_blink(); }
+
+__attribute__((weak)) void dynamic_macro_play_user(int8_t direction) { dynamic_macro_led_blink(); }
+
+__attribute__((weak)) void dynamic_macro_record_key_user(int8_t direction, keyrecord_t *record) { dynamic_macro_led_blink(); }
+
+__attribute__((weak)) void dynamic_macro_record_end_user(int8_t direction) { dynamic_macro_led_blink(); }
+
+/* Convenience macros used for retrieving the debug info. All of them
+ * need a `direction` variable accessible at the call site.
+ */
+#define DYNAMIC_MACRO_CURRENT_SLOT() (direction > 0 ? 1 : 2)
+#define DYNAMIC_MACRO_CURRENT_LENGTH(BEGIN, POINTER) ((int)(direction * ((POINTER) - (BEGIN))))
+#define DYNAMIC_MACRO_CURRENT_CAPACITY(BEGIN, END2) ((int)(direction * ((END2) - (BEGIN)) + 1))
+
+/**
+ * Start recording of the dynamic macro.
+ *
+ * @param[out] macro_pointer The new macro buffer iterator.
+ * @param[in] macro_buffer The macro buffer used to initialize macro_pointer.
+ */
+void dynamic_macro_record_start(keyrecord_t **macro_pointer, keyrecord_t *macro_buffer) {
+ dprintln("dynamic macro recording: started");
+
+ dynamic_macro_record_start_user();
+
+ clear_keyboard();
+ layer_clear();
+ *macro_pointer = macro_buffer;
+}
+
+/**
+ * Play the dynamic macro.
+ *
+ * @param macro_buffer[in] The beginning of the macro buffer being played.
+ * @param macro_end[in] The element after the last macro buffer element.
+ * @param direction[in] Either +1 or -1, which way to iterate the buffer.
+ */
+void dynamic_macro_play(keyrecord_t *macro_buffer, keyrecord_t *macro_end, int8_t direction) {
+ dprintf("dynamic macro: slot %d playback\n", DYNAMIC_MACRO_CURRENT_SLOT());
+
+ layer_state_t saved_layer_state = layer_state;
+
+ clear_keyboard();
+ layer_clear();
+
+ while (macro_buffer != macro_end) {
+ process_record(macro_buffer);
+ macro_buffer += direction;
+ }
+
+ clear_keyboard();
+
+ layer_state = saved_layer_state;
+
+ dynamic_macro_play_user(direction);
+}
+
+/**
+ * Record a single key in a dynamic macro.
+ *
+ * @param macro_buffer[in] The start of the used macro buffer.
+ * @param macro_pointer[in,out] The current buffer position.
+ * @param macro2_end[in] The end of the other macro.
+ * @param direction[in] Either +1 or -1, which way to iterate the buffer.
+ * @param record[in] The current keypress.
+ */
+void dynamic_macro_record_key(keyrecord_t *macro_buffer, keyrecord_t **macro_pointer, keyrecord_t *macro2_end, int8_t direction, keyrecord_t *record) {
+ /* If we've just started recording, ignore all the key releases. */
+ if (!record->event.pressed && *macro_pointer == macro_buffer) {
+ dprintln("dynamic macro: ignoring a leading key-up event");
+ return;
+ }
+
+ /* The other end of the other macro is the last buffer element it
+ * is safe to use before overwriting the other macro.
+ */
+ if (*macro_pointer - direction != macro2_end) {
+ **macro_pointer = *record;
+ *macro_pointer += direction;
+ } else {
+ dynamic_macro_record_key_user(direction, record);
+ }
+
+ dprintf("dynamic macro: slot %d length: %d/%d\n", DYNAMIC_MACRO_CURRENT_SLOT(), DYNAMIC_MACRO_CURRENT_LENGTH(macro_buffer, *macro_pointer), DYNAMIC_MACRO_CURRENT_CAPACITY(macro_buffer, macro2_end));
+}
+
+/**
+ * End recording of the dynamic macro. Essentially just update the
+ * pointer to the end of the macro.
+ */
+void dynamic_macro_record_end(keyrecord_t *macro_buffer, keyrecord_t *macro_pointer, int8_t direction, keyrecord_t **macro_end) {
+ dynamic_macro_record_end_user(direction);
+
+ /* Do not save the keys being held when stopping the recording,
+ * i.e. the keys used to access the layer DYN_REC_STOP is on.
+ */
+ while (macro_pointer != macro_buffer && (macro_pointer - direction)->event.pressed) {
+ dprintln("dynamic macro: trimming a trailing key-down event");
+ macro_pointer -= direction;
+ }
+
+ dprintf("dynamic macro: slot %d saved, length: %d\n", DYNAMIC_MACRO_CURRENT_SLOT(), DYNAMIC_MACRO_CURRENT_LENGTH(macro_buffer, macro_pointer));
+
+ *macro_end = macro_pointer;
+}
+
+/* Handle the key events related to the dynamic macros. Should be
+ * called from process_record_user() like this:
+ *
+ * bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ * if (!process_record_dynamic_macro(keycode, record)) {
+ * return false;
+ * }
+ * <...THE REST OF THE FUNCTION...>
+ * }
+ */
+bool process_dynamic_macro(uint16_t keycode, keyrecord_t *record) {
+ /* Both macros use the same buffer but read/write on different
+ * ends of it.
+ *
+ * Macro1 is written left-to-right starting from the beginning of
+ * the buffer.
+ *
+ * Macro2 is written right-to-left starting from the end of the
+ * buffer.
+ *
+ * ¯o_buffer macro_end
+ * v v
+ * +------------------------------------------------------------+
+ * |>>>>>> MACRO1 >>>>>> <<<<<<<<<<<<< MACRO2 <<<<<<<<<<<<<|
+ * +------------------------------------------------------------+
+ * ^ ^
+ * r_macro_end r_macro_buffer
+ *
+ * During the recording when one macro encounters the end of the
+ * other macro, the recording is stopped. Apart from this, there
+ * are no arbitrary limits for the macros' length in relation to
+ * each other: for example one can either have two medium sized
+ * macros or one long macro and one short macro. Or even one empty
+ * and one using the whole buffer.
+ */
+ static keyrecord_t macro_buffer[DYNAMIC_MACRO_SIZE];
+
+ /* Pointer to the first buffer element after the first macro.
+ * Initially points to the very beginning of the buffer since the
+ * macro is empty. */
+ static keyrecord_t *macro_end = macro_buffer;
+
+ /* The other end of the macro buffer. Serves as the beginning of
+ * the second macro. */
+ static keyrecord_t *const r_macro_buffer = macro_buffer + DYNAMIC_MACRO_SIZE - 1;
+
+ /* Like macro_end but for the second macro. */
+ static keyrecord_t *r_macro_end = r_macro_buffer;
+
+ /* A persistent pointer to the current macro position (iterator)
+ * used during the recording. */
+ static keyrecord_t *macro_pointer = NULL;
+
+ /* 0 - no macro is being recorded right now
+ * 1,2 - either macro 1 or 2 is being recorded */
+ static uint8_t macro_id = 0;
+
+ if (macro_id == 0) {
+ /* No macro recording in progress. */
+ if (!record->event.pressed) {
+ switch (keycode) {
+ case DYN_REC_START1:
+ dynamic_macro_record_start(¯o_pointer, macro_buffer);
+ macro_id = 1;
+ return false;
+ case DYN_REC_START2:
+ dynamic_macro_record_start(¯o_pointer, r_macro_buffer);
+ macro_id = 2;
+ return false;
+ case DYN_MACRO_PLAY1:
+ dynamic_macro_play(macro_buffer, macro_end, +1);
+ return false;
+ case DYN_MACRO_PLAY2:
+ dynamic_macro_play(r_macro_buffer, r_macro_end, -1);
+ return false;
+ }
+ }
+ } else {
+ /* A macro is being recorded right now. */
+ switch (keycode) {
+ case DYN_REC_STOP:
+ /* Stop the macro recording. */
+ if (record->event.pressed) { /* Ignore the initial release
+ * just after the recoding
+ * starts. */
+ switch (macro_id) {
+ case 1:
+ dynamic_macro_record_end(macro_buffer, macro_pointer, +1, ¯o_end);
+ break;
+ case 2:
+ dynamic_macro_record_end(r_macro_buffer, macro_pointer, -1, &r_macro_end);
+ break;
+ }
+ macro_id = 0;
+ }
+ return false;
+#ifdef DYNAMIC_MACRO_NO_NESTING
+ case DYN_MACRO_PLAY1:
+ case DYN_MACRO_PLAY2:
+ dprintln("dynamic macro: ignoring macro play key while recording");
+ return false;
+#endif
+ default:
+ /* Store the key in the macro buffer and process it normally. */
+ switch (macro_id) {
+ case 1:
+ dynamic_macro_record_key(macro_buffer, ¯o_pointer, r_macro_end, +1, record);
+ break;
+ case 2:
+ dynamic_macro_record_key(r_macro_buffer, ¯o_pointer, macro_end, -1, record);
+ break;
+ }
+ return true;
+ break;
+ }
+ }
+
+ return true;
+}
diff --git a/quantum/process_keycode/process_dynamic_macro.h b/quantum/process_keycode/process_dynamic_macro.h
new file mode 100644
index 000000000000..39036541b8d9
--- /dev/null
+++ b/quantum/process_keycode/process_dynamic_macro.h
@@ -0,0 +1,41 @@
+/* Copyright 2016 Jack Humbert
+ * Copyright 2019 Drashna Jael're (@drashna, aka Christopher Courtney)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+/* Author: Wojciech Siewierski < wojciech dot siewierski at onet dot pl > */
+#pragma once
+
+#include "quantum.h"
+
+/* May be overridden with a custom value. Be aware that the effective
+ * macro length is half of this value: each keypress is recorded twice
+ * because of the down-event and up-event. This is not a bug, it's the
+ * intended behavior.
+ *
+ * Usually it should be fine to set the macro size to at least 256 but
+ * there have been reports of it being too much in some users' cases,
+ * so 128 is considered a safe default.
+ */
+#ifndef DYNAMIC_MACRO_SIZE
+# define DYNAMIC_MACRO_SIZE 128
+#endif
+
+void dynamic_macro_led_blink(void);
+bool process_dynamic_macro(uint16_t keycode, keyrecord_t *record);
+void dynamic_macro_record_start_user(void);
+void dynamic_macro_play_user(int8_t direction);
+void dynamic_macro_record_key_user(int8_t direction, keyrecord_t *record);
+void dynamic_macro_record_end_user(int8_t direction);
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 571dda4c5bed..1f17c6ff71d4 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -26,7 +26,7 @@
#ifdef BACKLIGHT_ENABLE
# include "backlight.h"
- extern backlight_config_t backlight_config;
+extern backlight_config_t backlight_config;
#endif
#ifdef FAUXCLICKY_ENABLE
@@ -89,7 +89,7 @@ static void do_code16(uint16_t code, void (*f)(uint8_t)) {
uint8_t mods_to_send = 0;
- if (code & QK_RMODS_MIN) { // Right mod flag is set
+ if (code & QK_RMODS_MIN) { // Right mod flag is set
if (code & QK_LCTL) mods_to_send |= MOD_BIT(KC_RCTL);
if (code & QK_LSFT) mods_to_send |= MOD_BIT(KC_RSFT);
if (code & QK_LALT) mods_to_send |= MOD_BIT(KC_RALT);
@@ -222,6 +222,10 @@ bool process_record_quantum(keyrecord_t *record) {
// Must run first to be able to mask key_up events.
process_key_lock(&keycode, record) &&
#endif
+#if defined(DYNAMIC_MACRO_ENABLE) && !defined(DYNAMIC_MACRO_USER_CALL)
+ // Must run asap to ensure all keypresses are recorded.
+ process_dynamic_macro(keycode, record) &&
+#endif
#if defined(AUDIO_ENABLE) && defined(AUDIO_CLICKY)
process_clicky(keycode, record) &&
#endif // AUDIO_CLICKY
@@ -563,7 +567,7 @@ bool process_record_quantum(keyrecord_t *record) {
keymap_config.swap_backslash_backspace = true;
break;
case MAGIC_HOST_NKRO:
- clear_keyboard(); // clear first buffer to prevent stuck keys
+ clear_keyboard(); // clear first buffer to prevent stuck keys
keymap_config.nkro = true;
break;
case MAGIC_SWAP_ALT_GUI:
@@ -606,7 +610,7 @@ bool process_record_quantum(keyrecord_t *record) {
keymap_config.swap_backslash_backspace = false;
break;
case MAGIC_UNHOST_NKRO:
- clear_keyboard(); // clear first buffer to prevent stuck keys
+ clear_keyboard(); // clear first buffer to prevent stuck keys
keymap_config.nkro = false;
break;
case MAGIC_UNSWAP_ALT_GUI:
@@ -644,7 +648,7 @@ bool process_record_quantum(keyrecord_t *record) {
#endif
break;
case MAGIC_TOGGLE_NKRO:
- clear_keyboard(); // clear first buffer to prevent stuck keys
+ clear_keyboard(); // clear first buffer to prevent stuck keys
keymap_config.nkro = !keymap_config.nkro;
break;
case MAGIC_EE_HANDS_LEFT:
diff --git a/quantum/quantum.h b/quantum/quantum.h
index 01abe1c0a137..87343a15df6c 100644
--- a/quantum/quantum.h
+++ b/quantum/quantum.h
@@ -149,6 +149,10 @@ extern layer_state_t layer_state;
#include "dip_switch.h"
#endif
+#ifdef DYNAMIC_MACRO_ENABLE
+ #include "process_dynamic_macro.h"
+#endif
+
// Function substitutions to ease GPIO manipulation
#if defined(__AVR__)
diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h
index 5fac6a5cae88..51a7e290fa62 100644
--- a/quantum/quantum_keycodes.h
+++ b/quantum/quantum_keycodes.h
@@ -505,6 +505,13 @@ enum quantum_keycodes {
MAGIC_EE_HANDS_LEFT,
MAGIC_EE_HANDS_RIGHT,
+ // Dynamic Macros
+ DYN_REC_START1,
+ DYN_REC_START2,
+ DYN_REC_STOP,
+ DYN_MACRO_PLAY1,
+ DYN_MACRO_PLAY2,
+
// always leave at the end
SAFE_RANGE
};
@@ -757,4 +764,11 @@ enum quantum_keycodes {
# define SH_OFF (QK_SWAP_HANDS | OP_SH_OFF)
#endif
-#endif // QUANTUM_KEYCODES_H
+// Dynamic Macros aliases
+#define DM_REC1 DYN_REC_START1
+#define DM_REC2 DYN_REC_START2
+#define DM_RSTP DYN_REC_STOP
+#define DM_PLY1 DYN_MACRO_PLAY1
+#define DM_PLY2 DYN_MACRO_PLAY2
+
+#endif // QUANTUM_KEYCODES_H
From 1244d0e266dad4170ed0c63e68e00c74c87367b2 Mon Sep 17 00:00:00 2001
From: fauxpark
Date: Tue, 5 Nov 2019 18:04:58 +1100
Subject: [PATCH 12/16] Un-clang-format usb_descriptor.h (#7216)
Preserves readability of the file, making it easier to understand and modify.
---
tmk_core/protocol/usb_descriptor.c | 1048 +++++++++++++++++++---------
1 file changed, 701 insertions(+), 347 deletions(-)
diff --git a/tmk_core/protocol/usb_descriptor.c b/tmk_core/protocol/usb_descriptor.c
index e93ce87df28c..70032d69fa52 100644
--- a/tmk_core/protocol/usb_descriptor.c
+++ b/tmk_core/protocol/usb_descriptor.c
@@ -40,6 +40,8 @@
#include "report.h"
#include "usb_descriptor.h"
+// clang-format off
+
/*
* HID report descriptors
*/
@@ -49,46 +51,46 @@ const USB_Descriptor_HIDReport_Datatype_t PROGMEM SharedReport[] = {
#else
const USB_Descriptor_HIDReport_Datatype_t PROGMEM KeyboardReport[] = {
#endif
- HID_RI_USAGE_PAGE(8, 0x01), // Generic Desktop
- HID_RI_USAGE(8, 0x06), // Keyboard
- HID_RI_COLLECTION(8, 0x01), // Application
+ HID_RI_USAGE_PAGE(8, 0x01), // Generic Desktop
+ HID_RI_USAGE(8, 0x06), // Keyboard
+ HID_RI_COLLECTION(8, 0x01), // Application
#ifdef KEYBOARD_SHARED_EP
- HID_RI_REPORT_ID(8, REPORT_ID_KEYBOARD),
+ HID_RI_REPORT_ID(8, REPORT_ID_KEYBOARD),
#endif
- // Modifiers (8 bits)
- HID_RI_USAGE_PAGE(8, 0x07), // Keyboard/Keypad
- HID_RI_USAGE_MINIMUM(8, 0xE0), // Keyboard Left Control
- HID_RI_USAGE_MAXIMUM(8, 0xE7), // Keyboard Right GUI
- HID_RI_LOGICAL_MINIMUM(8, 0x00),
- HID_RI_LOGICAL_MAXIMUM(8, 0x01),
- HID_RI_REPORT_COUNT(8, 0x08),
- HID_RI_REPORT_SIZE(8, 0x01),
- HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE),
- // Reserved (1 byte)
- HID_RI_REPORT_COUNT(8, 0x01),
- HID_RI_REPORT_SIZE(8, 0x08),
- HID_RI_INPUT(8, HID_IOF_CONSTANT),
- // Keycodes (6 bytes)
- HID_RI_USAGE_PAGE(8, 0x07), // Keyboard/Keypad
- HID_RI_USAGE_MINIMUM(8, 0x00),
- HID_RI_USAGE_MAXIMUM(8, 0xFF),
- HID_RI_LOGICAL_MINIMUM(8, 0x00),
- HID_RI_LOGICAL_MAXIMUM(16, 0x00FF),
- HID_RI_REPORT_COUNT(8, 0x06),
- HID_RI_REPORT_SIZE(8, 0x08),
- HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_ARRAY | HID_IOF_ABSOLUTE),
-
- // Status LEDs (5 bits)
- HID_RI_USAGE_PAGE(8, 0x08), // LED
- HID_RI_USAGE_MINIMUM(8, 0x01), // Num Lock
- HID_RI_USAGE_MAXIMUM(8, 0x05), // Kana
- HID_RI_REPORT_COUNT(8, 0x05),
- HID_RI_REPORT_SIZE(8, 0x01),
- HID_RI_OUTPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_NON_VOLATILE),
- // LED padding (3 bits)
- HID_RI_REPORT_COUNT(8, 0x01),
- HID_RI_REPORT_SIZE(8, 0x03),
- HID_RI_OUTPUT(8, HID_IOF_CONSTANT),
+ // Modifiers (8 bits)
+ HID_RI_USAGE_PAGE(8, 0x07), // Keyboard/Keypad
+ HID_RI_USAGE_MINIMUM(8, 0xE0), // Keyboard Left Control
+ HID_RI_USAGE_MAXIMUM(8, 0xE7), // Keyboard Right GUI
+ HID_RI_LOGICAL_MINIMUM(8, 0x00),
+ HID_RI_LOGICAL_MAXIMUM(8, 0x01),
+ HID_RI_REPORT_COUNT(8, 0x08),
+ HID_RI_REPORT_SIZE(8, 0x01),
+ HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE),
+ // Reserved (1 byte)
+ HID_RI_REPORT_COUNT(8, 0x01),
+ HID_RI_REPORT_SIZE(8, 0x08),
+ HID_RI_INPUT(8, HID_IOF_CONSTANT),
+ // Keycodes (6 bytes)
+ HID_RI_USAGE_PAGE(8, 0x07), // Keyboard/Keypad
+ HID_RI_USAGE_MINIMUM(8, 0x00),
+ HID_RI_USAGE_MAXIMUM(8, 0xFF),
+ HID_RI_LOGICAL_MINIMUM(8, 0x00),
+ HID_RI_LOGICAL_MAXIMUM(16, 0x00FF),
+ HID_RI_REPORT_COUNT(8, 0x06),
+ HID_RI_REPORT_SIZE(8, 0x08),
+ HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_ARRAY | HID_IOF_ABSOLUTE),
+
+ // Status LEDs (5 bits)
+ HID_RI_USAGE_PAGE(8, 0x08), // LED
+ HID_RI_USAGE_MINIMUM(8, 0x01), // Num Lock
+ HID_RI_USAGE_MAXIMUM(8, 0x05), // Kana
+ HID_RI_REPORT_COUNT(8, 0x05),
+ HID_RI_REPORT_SIZE(8, 0x01),
+ HID_RI_OUTPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_NON_VOLATILE),
+ // LED padding (3 bits)
+ HID_RI_REPORT_COUNT(8, 0x01),
+ HID_RI_REPORT_SIZE(8, 0x03),
+ HID_RI_OUTPUT(8, HID_IOF_CONSTANT),
HID_RI_END_COLLECTION(0),
#ifndef KEYBOARD_SHARED_EP
};
@@ -101,54 +103,54 @@ const USB_Descriptor_HIDReport_Datatype_t PROGMEM MouseReport[] = {
const USB_Descriptor_HIDReport_Datatype_t PROGMEM SharedReport[] = {
# define SHARED_REPORT_STARTED
# endif
- HID_RI_USAGE_PAGE(8, 0x01), // Generic Desktop
- HID_RI_USAGE(8, 0x02), // Mouse
- HID_RI_COLLECTION(8, 0x01), // Application
+ HID_RI_USAGE_PAGE(8, 0x01), // Generic Desktop
+ HID_RI_USAGE(8, 0x02), // Mouse
+ HID_RI_COLLECTION(8, 0x01), // Application
# ifdef MOUSE_SHARED_EP
- HID_RI_REPORT_ID(8, REPORT_ID_MOUSE),
+ HID_RI_REPORT_ID(8, REPORT_ID_MOUSE),
# endif
- HID_RI_USAGE(8, 0x01), // Pointer
- HID_RI_COLLECTION(8, 0x00), // Physical
- // Buttons (5 bits)
- HID_RI_USAGE_PAGE(8, 0x09), // Button
- HID_RI_USAGE_MINIMUM(8, 0x01), // Button 1
- HID_RI_USAGE_MAXIMUM(8, 0x05), // Button 5
- HID_RI_LOGICAL_MINIMUM(8, 0x00),
- HID_RI_LOGICAL_MAXIMUM(8, 0x01),
- HID_RI_REPORT_COUNT(8, 0x05),
- HID_RI_REPORT_SIZE(8, 0x01),
- HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE),
- // Button padding (3 bits)
- HID_RI_REPORT_COUNT(8, 0x01),
- HID_RI_REPORT_SIZE(8, 0x03),
- HID_RI_INPUT(8, HID_IOF_CONSTANT),
-
- // X/Y position (2 bytes)
- HID_RI_USAGE_PAGE(8, 0x01), // Generic Desktop
- HID_RI_USAGE(8, 0x30), // X
- HID_RI_USAGE(8, 0x31), // Y
- HID_RI_LOGICAL_MINIMUM(8, -127),
- HID_RI_LOGICAL_MAXIMUM(8, 127),
- HID_RI_REPORT_COUNT(8, 0x02),
- HID_RI_REPORT_SIZE(8, 0x08),
- HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_RELATIVE),
-
- // Vertical wheel (1 byte)
- HID_RI_USAGE(8, 0x38), // Wheel
- HID_RI_LOGICAL_MINIMUM(8, -127),
- HID_RI_LOGICAL_MAXIMUM(8, 127),
- HID_RI_REPORT_COUNT(8, 0x01),
- HID_RI_REPORT_SIZE(8, 0x08),
- HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_RELATIVE),
- // Horizontal wheel (1 byte)
- HID_RI_USAGE_PAGE(8, 0x0C), // Consumer
- HID_RI_USAGE(16, 0x0238), // AC Pan
- HID_RI_LOGICAL_MINIMUM(8, -127),
- HID_RI_LOGICAL_MAXIMUM(8, 127),
- HID_RI_REPORT_COUNT(8, 0x01),
- HID_RI_REPORT_SIZE(8, 0x08),
- HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_RELATIVE),
- HID_RI_END_COLLECTION(0),
+ HID_RI_USAGE(8, 0x01), // Pointer
+ HID_RI_COLLECTION(8, 0x00), // Physical
+ // Buttons (5 bits)
+ HID_RI_USAGE_PAGE(8, 0x09), // Button
+ HID_RI_USAGE_MINIMUM(8, 0x01), // Button 1
+ HID_RI_USAGE_MAXIMUM(8, 0x05), // Button 5
+ HID_RI_LOGICAL_MINIMUM(8, 0x00),
+ HID_RI_LOGICAL_MAXIMUM(8, 0x01),
+ HID_RI_REPORT_COUNT(8, 0x05),
+ HID_RI_REPORT_SIZE(8, 0x01),
+ HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE),
+ // Button padding (3 bits)
+ HID_RI_REPORT_COUNT(8, 0x01),
+ HID_RI_REPORT_SIZE(8, 0x03),
+ HID_RI_INPUT(8, HID_IOF_CONSTANT),
+
+ // X/Y position (2 bytes)
+ HID_RI_USAGE_PAGE(8, 0x01), // Generic Desktop
+ HID_RI_USAGE(8, 0x30), // X
+ HID_RI_USAGE(8, 0x31), // Y
+ HID_RI_LOGICAL_MINIMUM(8, -127),
+ HID_RI_LOGICAL_MAXIMUM(8, 127),
+ HID_RI_REPORT_COUNT(8, 0x02),
+ HID_RI_REPORT_SIZE(8, 0x08),
+ HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_RELATIVE),
+
+ // Vertical wheel (1 byte)
+ HID_RI_USAGE(8, 0x38), // Wheel
+ HID_RI_LOGICAL_MINIMUM(8, -127),
+ HID_RI_LOGICAL_MAXIMUM(8, 127),
+ HID_RI_REPORT_COUNT(8, 0x01),
+ HID_RI_REPORT_SIZE(8, 0x08),
+ HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_RELATIVE),
+ // Horizontal wheel (1 byte)
+ HID_RI_USAGE_PAGE(8, 0x0C), // Consumer
+ HID_RI_USAGE(16, 0x0238), // AC Pan
+ HID_RI_LOGICAL_MINIMUM(8, -127),
+ HID_RI_LOGICAL_MAXIMUM(8, 127),
+ HID_RI_REPORT_COUNT(8, 0x01),
+ HID_RI_REPORT_SIZE(8, 0x08),
+ HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_RELATIVE),
+ HID_RI_END_COLLECTION(0),
HID_RI_END_COLLECTION(0),
# ifndef MOUSE_SHARED_EP
};
@@ -160,68 +162,68 @@ const USB_Descriptor_HIDReport_Datatype_t PROGMEM SharedReport[] = {
#endif
#ifdef EXTRAKEY_ENABLE
- HID_RI_USAGE_PAGE(8, 0x01), // Generic Desktop
- HID_RI_USAGE(8, 0x80), // System Control
- HID_RI_COLLECTION(8, 0x01), // Application
- HID_RI_REPORT_ID(8, REPORT_ID_SYSTEM),
- HID_RI_USAGE_MINIMUM(16, 0x0081), // System Power Down
- HID_RI_USAGE_MAXIMUM(16, 0x0083), // System Wake Up
- HID_RI_LOGICAL_MINIMUM(16, 0x0001),
- HID_RI_LOGICAL_MAXIMUM(16, 0x0003),
- HID_RI_REPORT_COUNT(8, 1),
- HID_RI_REPORT_SIZE(8, 16),
- HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_ARRAY | HID_IOF_ABSOLUTE),
+ HID_RI_USAGE_PAGE(8, 0x01), // Generic Desktop
+ HID_RI_USAGE(8, 0x80), // System Control
+ HID_RI_COLLECTION(8, 0x01), // Application
+ HID_RI_REPORT_ID(8, REPORT_ID_SYSTEM),
+ HID_RI_USAGE_MINIMUM(16, 0x0081), // System Power Down
+ HID_RI_USAGE_MAXIMUM(16, 0x0083), // System Wake Up
+ HID_RI_LOGICAL_MINIMUM(16, 0x0001),
+ HID_RI_LOGICAL_MAXIMUM(16, 0x0003),
+ HID_RI_REPORT_COUNT(8, 1),
+ HID_RI_REPORT_SIZE(8, 16),
+ HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_ARRAY | HID_IOF_ABSOLUTE),
HID_RI_END_COLLECTION(0),
- HID_RI_USAGE_PAGE(8, 0x0C), // Consumer
- HID_RI_USAGE(8, 0x01), // Consumer Control
- HID_RI_COLLECTION(8, 0x01), // Application
- HID_RI_REPORT_ID(8, REPORT_ID_CONSUMER),
- HID_RI_USAGE_MINIMUM(16, 0x0001), // Consumer Control
- HID_RI_USAGE_MAXIMUM(16, 0x029C), // AC Distribute Vertically
- HID_RI_LOGICAL_MINIMUM(16, 0x0001),
- HID_RI_LOGICAL_MAXIMUM(16, 0x029C),
- HID_RI_REPORT_COUNT(8, 1),
- HID_RI_REPORT_SIZE(8, 16),
- HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_ARRAY | HID_IOF_ABSOLUTE),
+ HID_RI_USAGE_PAGE(8, 0x0C), // Consumer
+ HID_RI_USAGE(8, 0x01), // Consumer Control
+ HID_RI_COLLECTION(8, 0x01), // Application
+ HID_RI_REPORT_ID(8, REPORT_ID_CONSUMER),
+ HID_RI_USAGE_MINIMUM(16, 0x0001), // Consumer Control
+ HID_RI_USAGE_MAXIMUM(16, 0x029C), // AC Distribute Vertically
+ HID_RI_LOGICAL_MINIMUM(16, 0x0001),
+ HID_RI_LOGICAL_MAXIMUM(16, 0x029C),
+ HID_RI_REPORT_COUNT(8, 1),
+ HID_RI_REPORT_SIZE(8, 16),
+ HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_ARRAY | HID_IOF_ABSOLUTE),
HID_RI_END_COLLECTION(0),
#endif
#ifdef NKRO_ENABLE
- HID_RI_USAGE_PAGE(8, 0x01), // Generic Desktop
- HID_RI_USAGE(8, 0x06), // Keyboard
- HID_RI_COLLECTION(8, 0x01), // Application
- HID_RI_REPORT_ID(8, REPORT_ID_NKRO),
- // Modifiers (8 bits)
- HID_RI_USAGE_PAGE(8, 0x07), // Keyboard/Keypad
- HID_RI_USAGE_MINIMUM(8, 0xE0), // Keyboard Left Control
- HID_RI_USAGE_MAXIMUM(8, 0xE7), // Keyboard Right GUI
- HID_RI_LOGICAL_MINIMUM(8, 0x00),
- HID_RI_LOGICAL_MAXIMUM(8, 0x01),
- HID_RI_REPORT_COUNT(8, 0x08),
- HID_RI_REPORT_SIZE(8, 0x01),
- HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE),
- // Keycodes
- HID_RI_USAGE_PAGE(8, 0x07), // Keyboard/Keypad
- HID_RI_USAGE_MINIMUM(8, 0x00),
- HID_RI_USAGE_MAXIMUM(8, KEYBOARD_REPORT_BITS * 8 - 1),
- HID_RI_LOGICAL_MINIMUM(8, 0x00),
- HID_RI_LOGICAL_MAXIMUM(8, 0x01),
- HID_RI_REPORT_COUNT(8, KEYBOARD_REPORT_BITS * 8),
- HID_RI_REPORT_SIZE(8, 0x01),
- HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE),
-
- // Status LEDs (5 bits)
- HID_RI_USAGE_PAGE(8, 0x08), // LED
- HID_RI_USAGE_MINIMUM(8, 0x01), // Num Lock
- HID_RI_USAGE_MAXIMUM(8, 0x05), // Kana
- HID_RI_REPORT_COUNT(8, 0x05),
- HID_RI_REPORT_SIZE(8, 0x01),
- HID_RI_OUTPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_NON_VOLATILE),
- // LED padding (3 bits)
- HID_RI_REPORT_COUNT(8, 0x01),
- HID_RI_REPORT_SIZE(8, 0x03),
- HID_RI_OUTPUT(8, HID_IOF_CONSTANT),
+ HID_RI_USAGE_PAGE(8, 0x01), // Generic Desktop
+ HID_RI_USAGE(8, 0x06), // Keyboard
+ HID_RI_COLLECTION(8, 0x01), // Application
+ HID_RI_REPORT_ID(8, REPORT_ID_NKRO),
+ // Modifiers (8 bits)
+ HID_RI_USAGE_PAGE(8, 0x07), // Keyboard/Keypad
+ HID_RI_USAGE_MINIMUM(8, 0xE0), // Keyboard Left Control
+ HID_RI_USAGE_MAXIMUM(8, 0xE7), // Keyboard Right GUI
+ HID_RI_LOGICAL_MINIMUM(8, 0x00),
+ HID_RI_LOGICAL_MAXIMUM(8, 0x01),
+ HID_RI_REPORT_COUNT(8, 0x08),
+ HID_RI_REPORT_SIZE(8, 0x01),
+ HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE),
+ // Keycodes
+ HID_RI_USAGE_PAGE(8, 0x07), // Keyboard/Keypad
+ HID_RI_USAGE_MINIMUM(8, 0x00),
+ HID_RI_USAGE_MAXIMUM(8, KEYBOARD_REPORT_BITS * 8 - 1),
+ HID_RI_LOGICAL_MINIMUM(8, 0x00),
+ HID_RI_LOGICAL_MAXIMUM(8, 0x01),
+ HID_RI_REPORT_COUNT(8, KEYBOARD_REPORT_BITS * 8),
+ HID_RI_REPORT_SIZE(8, 0x01),
+ HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE),
+
+ // Status LEDs (5 bits)
+ HID_RI_USAGE_PAGE(8, 0x08), // LED
+ HID_RI_USAGE_MINIMUM(8, 0x01), // Num Lock
+ HID_RI_USAGE_MAXIMUM(8, 0x05), // Kana
+ HID_RI_REPORT_COUNT(8, 0x05),
+ HID_RI_REPORT_SIZE(8, 0x01),
+ HID_RI_OUTPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_NON_VOLATILE),
+ // LED padding (3 bits)
+ HID_RI_REPORT_COUNT(8, 0x01),
+ HID_RI_REPORT_SIZE(8, 0x03),
+ HID_RI_OUTPUT(8, HID_IOF_CONSTANT),
HID_RI_END_COLLECTION(0),
#endif
#ifdef SHARED_EP_ENABLE
@@ -230,46 +232,48 @@ const USB_Descriptor_HIDReport_Datatype_t PROGMEM SharedReport[] = {
#ifdef RAW_ENABLE
const USB_Descriptor_HIDReport_Datatype_t PROGMEM RawReport[] = {
- HID_RI_USAGE_PAGE(16, 0xFF60), // Vendor Defined
- HID_RI_USAGE(8, 0x61), // Vendor Defined
- HID_RI_COLLECTION(8, 0x01), // Application
- // Data to host
- HID_RI_USAGE(8, 0x62), // Vendor Defined
- HID_RI_LOGICAL_MINIMUM(8, 0x00),
- HID_RI_LOGICAL_MAXIMUM(16, 0x00FF),
- HID_RI_REPORT_COUNT(8, RAW_EPSIZE),
- HID_RI_REPORT_SIZE(8, 0x08),
- HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE),
- // Data from host
- HID_RI_USAGE(8, 0x63), // Vendor Defined
- HID_RI_LOGICAL_MINIMUM(8, 0x00),
- HID_RI_LOGICAL_MAXIMUM(16, 0x00FF),
- HID_RI_REPORT_COUNT(8, RAW_EPSIZE),
- HID_RI_REPORT_SIZE(8, 0x08),
- HID_RI_OUTPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_NON_VOLATILE),
+ HID_RI_USAGE_PAGE(16, 0xFF60), // Vendor Defined
+ HID_RI_USAGE(8, 0x61), // Vendor Defined
+ HID_RI_COLLECTION(8, 0x01), // Application
+ // Data to host
+ HID_RI_USAGE(8, 0x62), // Vendor Defined
+ HID_RI_LOGICAL_MINIMUM(8, 0x00),
+ HID_RI_LOGICAL_MAXIMUM(16, 0x00FF),
+ HID_RI_REPORT_COUNT(8, RAW_EPSIZE),
+ HID_RI_REPORT_SIZE(8, 0x08),
+ HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE),
+
+ // Data from host
+ HID_RI_USAGE(8, 0x63), // Vendor Defined
+ HID_RI_LOGICAL_MINIMUM(8, 0x00),
+ HID_RI_LOGICAL_MAXIMUM(16, 0x00FF),
+ HID_RI_REPORT_COUNT(8, RAW_EPSIZE),
+ HID_RI_REPORT_SIZE(8, 0x08),
+ HID_RI_OUTPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_NON_VOLATILE),
HID_RI_END_COLLECTION(0),
};
#endif
#ifdef CONSOLE_ENABLE
const USB_Descriptor_HIDReport_Datatype_t PROGMEM ConsoleReport[] = {
- HID_RI_USAGE_PAGE(16, 0xFF31), // Vendor Defined (PJRC Teensy compatible)
- HID_RI_USAGE(8, 0x74), // Vendor Defined (PJRC Teensy compatible)
- HID_RI_COLLECTION(8, 0x01), // Application
- // Data to host
- HID_RI_USAGE(8, 0x75), // Vendor Defined
- HID_RI_LOGICAL_MINIMUM(8, 0x00),
- HID_RI_LOGICAL_MAXIMUM(16, 0x00FF),
- HID_RI_REPORT_COUNT(8, CONSOLE_EPSIZE),
- HID_RI_REPORT_SIZE(8, 0x08),
- HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE),
- // Data from host
- HID_RI_USAGE(8, 0x76), // Vendor Defined
- HID_RI_LOGICAL_MINIMUM(8, 0x00),
- HID_RI_LOGICAL_MAXIMUM(16, 0x00FF),
- HID_RI_REPORT_COUNT(8, CONSOLE_EPSIZE),
- HID_RI_REPORT_SIZE(8, 0x08),
- HID_RI_OUTPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_NON_VOLATILE),
+ HID_RI_USAGE_PAGE(16, 0xFF31), // Vendor Defined (PJRC Teensy compatible)
+ HID_RI_USAGE(8, 0x74), // Vendor Defined (PJRC Teensy compatible)
+ HID_RI_COLLECTION(8, 0x01), // Application
+ // Data to host
+ HID_RI_USAGE(8, 0x75), // Vendor Defined
+ HID_RI_LOGICAL_MINIMUM(8, 0x00),
+ HID_RI_LOGICAL_MAXIMUM(16, 0x00FF),
+ HID_RI_REPORT_COUNT(8, CONSOLE_EPSIZE),
+ HID_RI_REPORT_SIZE(8, 0x08),
+ HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE),
+
+ // Data from host
+ HID_RI_USAGE(8, 0x76), // Vendor Defined
+ HID_RI_LOGICAL_MINIMUM(8, 0x00),
+ HID_RI_LOGICAL_MAXIMUM(16, 0x00FF),
+ HID_RI_REPORT_COUNT(8, CONSOLE_EPSIZE),
+ HID_RI_REPORT_SIZE(8, 0x08),
+ HID_RI_OUTPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_NON_VOLATILE),
HID_RI_END_COLLECTION(0),
};
#endif
@@ -277,26 +281,33 @@ const USB_Descriptor_HIDReport_Datatype_t PROGMEM ConsoleReport[] = {
/*
* Device descriptor
*/
-const USB_Descriptor_Device_t PROGMEM DeviceDescriptor = {.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
- .USBSpecification = VERSION_BCD(1, 1, 0),
+const USB_Descriptor_Device_t PROGMEM DeviceDescriptor = {
+ .Header = {
+ .Size = sizeof(USB_Descriptor_Device_t),
+ .Type = DTYPE_Device
+ },
+ .USBSpecification = VERSION_BCD(1, 1, 0),
+
#if VIRTSER_ENABLE
- .Class = USB_CSCP_IADDeviceClass,
- .SubClass = USB_CSCP_IADDeviceSubclass,
- .Protocol = USB_CSCP_IADDeviceProtocol,
+ .Class = USB_CSCP_IADDeviceClass,
+ .SubClass = USB_CSCP_IADDeviceSubclass,
+ .Protocol = USB_CSCP_IADDeviceProtocol,
#else
- .Class = USB_CSCP_NoDeviceClass,
- .SubClass = USB_CSCP_NoDeviceSubclass,
- .Protocol = USB_CSCP_NoDeviceProtocol,
+ .Class = USB_CSCP_NoDeviceClass,
+ .SubClass = USB_CSCP_NoDeviceSubclass,
+ .Protocol = USB_CSCP_NoDeviceProtocol,
#endif
- .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE,
- // Specified in config.h
- .VendorID = VENDOR_ID,
- .ProductID = PRODUCT_ID,
- .ReleaseNumber = DEVICE_VER,
- .ManufacturerStrIndex = 0x01,
- .ProductStrIndex = 0x02,
- .SerialNumStrIndex = 0x03,
- .NumberOfConfigurations = FIXED_NUM_CONFIGURATIONS};
+
+ .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE,
+ // Specified in config.h
+ .VendorID = VENDOR_ID,
+ .ProductID = PRODUCT_ID,
+ .ReleaseNumber = DEVICE_VER,
+ .ManufacturerStrIndex = 0x01,
+ .ProductStrIndex = 0x02,
+ .SerialNumStrIndex = 0x03,
+ .NumberOfConfigurations = FIXED_NUM_CONFIGURATIONS
+};
#ifndef USB_MAX_POWER_CONSUMPTION
# define USB_MAX_POWER_CONSUMPTION 500
@@ -309,197 +320,540 @@ const USB_Descriptor_Device_t PROGMEM DeviceDescriptor = {.Header = {.
/*
* Configuration descriptors
*/
-const USB_Descriptor_Configuration_t PROGMEM
- ConfigurationDescriptor =
- {
- .Config = {.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration}, .TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t), .TotalInterfaces = TOTAL_INTERFACES, .ConfigurationNumber = 1, .ConfigurationStrIndex = NO_DESCRIPTOR, .ConfigAttributes = (USB_CONFIG_ATTR_RESERVED | USB_CONFIG_ATTR_REMOTEWAKEUP), .MaxPowerConsumption = USB_CONFIG_POWER_MA(USB_MAX_POWER_CONSUMPTION)},
-
+const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = {
+ .Config = {
+ .Header = {
+ .Size = sizeof(USB_Descriptor_Configuration_Header_t),
+ .Type = DTYPE_Configuration
+ },
+ .TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
+ .TotalInterfaces = TOTAL_INTERFACES,
+ .ConfigurationNumber = 1,
+ .ConfigurationStrIndex = NO_DESCRIPTOR,
+ .ConfigAttributes = (USB_CONFIG_ATTR_RESERVED | USB_CONFIG_ATTR_REMOTEWAKEUP),
+ .MaxPowerConsumption = USB_CONFIG_POWER_MA(USB_MAX_POWER_CONSUMPTION)
+ },
#ifndef KEYBOARD_SHARED_EP
- /*
- * Keyboard
- */
- .Keyboard_Interface = {.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
- .InterfaceNumber = KEYBOARD_INTERFACE,
- .AlternateSetting = 0x00,
- .TotalEndpoints = 1,
- .Class = HID_CSCP_HIDClass,
- .SubClass = HID_CSCP_BootSubclass,
- .Protocol = HID_CSCP_KeyboardBootProtocol,
-
- .InterfaceStrIndex = NO_DESCRIPTOR},
- .Keyboard_HID = {.Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID}, .HIDSpec = VERSION_BCD(1, 1, 1), .CountryCode = 0x00, .TotalReportDescriptors = 1, .HIDReportType = HID_DTYPE_Report, .HIDReportLength = sizeof(KeyboardReport)},
- .Keyboard_INEndpoint = {.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, .EndpointAddress = (ENDPOINT_DIR_IN | KEYBOARD_IN_EPNUM), .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = KEYBOARD_EPSIZE, .PollingIntervalMS = USB_POLLING_INTERVAL_MS},
+ /*
+ * Keyboard
+ */
+ .Keyboard_Interface = {
+ .Header = {
+ .Size = sizeof(USB_Descriptor_Interface_t),
+ .Type = DTYPE_Interface
+ },
+ .InterfaceNumber = KEYBOARD_INTERFACE,
+ .AlternateSetting = 0x00,
+ .TotalEndpoints = 1,
+ .Class = HID_CSCP_HIDClass,
+ .SubClass = HID_CSCP_BootSubclass,
+ .Protocol = HID_CSCP_KeyboardBootProtocol,
+ .InterfaceStrIndex = NO_DESCRIPTOR
+ },
+ .Keyboard_HID = {
+ .Header = {
+ .Size = sizeof(USB_HID_Descriptor_HID_t),
+ .Type = HID_DTYPE_HID
+ },
+ .HIDSpec = VERSION_BCD(1, 1, 1),
+ .CountryCode = 0x00,
+ .TotalReportDescriptors = 1,
+ .HIDReportType = HID_DTYPE_Report,
+ .HIDReportLength = sizeof(KeyboardReport)
+ },
+ .Keyboard_INEndpoint = {
+ .Header = {
+ .Size = sizeof(USB_Descriptor_Endpoint_t),
+ .Type = DTYPE_Endpoint
+ },
+ .EndpointAddress = (ENDPOINT_DIR_IN | KEYBOARD_IN_EPNUM),
+ .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
+ .EndpointSize = KEYBOARD_EPSIZE,
+ .PollingIntervalMS = USB_POLLING_INTERVAL_MS
+ },
#endif
#ifdef RAW_ENABLE
- /*
- * Raw HID
- */
- .Raw_Interface = {.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .InterfaceNumber = RAW_INTERFACE, .AlternateSetting = 0x00, .TotalEndpoints = 2, .Class = HID_CSCP_HIDClass, .SubClass = HID_CSCP_NonBootSubclass, .Protocol = HID_CSCP_NonBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR},
- .Raw_HID = {.Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID}, .HIDSpec = VERSION_BCD(1, 1, 1), .CountryCode = 0x00, .TotalReportDescriptors = 1, .HIDReportType = HID_DTYPE_Report, .HIDReportLength = sizeof(RawReport)},
- .Raw_INEndpoint = {.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, .EndpointAddress = (ENDPOINT_DIR_IN | RAW_IN_EPNUM), .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = RAW_EPSIZE, .PollingIntervalMS = 0x01},
- .Raw_OUTEndpoint = {.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, .EndpointAddress = (ENDPOINT_DIR_OUT | RAW_OUT_EPNUM), .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = RAW_EPSIZE, .PollingIntervalMS = 0x01},
+ /*
+ * Raw HID
+ */
+ .Raw_Interface = {
+ .Header = {
+ .Size = sizeof(USB_Descriptor_Interface_t),
+ .Type = DTYPE_Interface
+ },
+ .InterfaceNumber = RAW_INTERFACE,
+ .AlternateSetting = 0x00,
+ .TotalEndpoints = 2,
+ .Class = HID_CSCP_HIDClass,
+ .SubClass = HID_CSCP_NonBootSubclass,
+ .Protocol = HID_CSCP_NonBootProtocol,
+ .InterfaceStrIndex = NO_DESCRIPTOR
+ },
+ .Raw_HID = {
+ .Header = {
+ .Size = sizeof(USB_HID_Descriptor_HID_t),
+ .Type = HID_DTYPE_HID
+ },
+ .HIDSpec = VERSION_BCD(1, 1, 1),
+ .CountryCode = 0x00,
+ .TotalReportDescriptors = 1,
+ .HIDReportType = HID_DTYPE_Report,
+ .HIDReportLength = sizeof(RawReport)
+ },
+ .Raw_INEndpoint = {
+ .Header = {
+ .Size = sizeof(USB_Descriptor_Endpoint_t),
+ .Type = DTYPE_Endpoint
+ },
+ .EndpointAddress = (ENDPOINT_DIR_IN | RAW_IN_EPNUM),
+ .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
+ .EndpointSize = RAW_EPSIZE,
+ .PollingIntervalMS = 0x01
+ },
+ .Raw_OUTEndpoint = {
+ .Header = {
+ .Size = sizeof(USB_Descriptor_Endpoint_t),
+ .Type = DTYPE_Endpoint
+ },
+ .EndpointAddress = (ENDPOINT_DIR_OUT | RAW_OUT_EPNUM),
+ .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
+ .EndpointSize = RAW_EPSIZE,
+ .PollingIntervalMS = 0x01
+ },
#endif
#if defined(MOUSE_ENABLE) && !defined(MOUSE_SHARED_EP)
- /*
- * Mouse
- */
- .Mouse_Interface = {.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .InterfaceNumber = MOUSE_INTERFACE, .AlternateSetting = 0x00, .TotalEndpoints = 1, .Class = HID_CSCP_HIDClass, .SubClass = HID_CSCP_BootSubclass, .Protocol = HID_CSCP_MouseBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR},
- .Mouse_HID = {.Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID}, .HIDSpec = VERSION_BCD(1, 1, 1), .CountryCode = 0x00, .TotalReportDescriptors = 1, .HIDReportType = HID_DTYPE_Report, .HIDReportLength = sizeof(MouseReport)},
- .Mouse_INEndpoint = {.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, .EndpointAddress = (ENDPOINT_DIR_IN | MOUSE_IN_EPNUM), .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MOUSE_EPSIZE, .PollingIntervalMS = USB_POLLING_INTERVAL_MS},
+ /*
+ * Mouse
+ */
+ .Mouse_Interface = {
+ .Header = {
+ .Size = sizeof(USB_Descriptor_Interface_t),
+ .Type = DTYPE_Interface
+ },
+ .InterfaceNumber = MOUSE_INTERFACE,
+ .AlternateSetting = 0x00,
+ .TotalEndpoints = 1,
+ .Class = HID_CSCP_HIDClass,
+ .SubClass = HID_CSCP_BootSubclass,
+ .Protocol = HID_CSCP_MouseBootProtocol,
+ .InterfaceStrIndex = NO_DESCRIPTOR
+ },
+ .Mouse_HID = {
+ .Header = {
+ .Size = sizeof(USB_HID_Descriptor_HID_t),
+ .Type = HID_DTYPE_HID
+ },
+ .HIDSpec = VERSION_BCD(1, 1, 1),
+ .CountryCode = 0x00,
+ .TotalReportDescriptors = 1,
+ .HIDReportType = HID_DTYPE_Report,
+ .HIDReportLength = sizeof(MouseReport)
+ },
+ .Mouse_INEndpoint = {
+ .Header = {
+ .Size = sizeof(USB_Descriptor_Endpoint_t),
+ .Type = DTYPE_Endpoint
+ },
+ .EndpointAddress = (ENDPOINT_DIR_IN | MOUSE_IN_EPNUM),
+ .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
+ .EndpointSize = MOUSE_EPSIZE,
+ .PollingIntervalMS = USB_POLLING_INTERVAL_MS
+ },
#endif
#ifdef SHARED_EP_ENABLE
- /*
- * Shared
- */
- .Shared_Interface = {.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
- .InterfaceNumber = SHARED_INTERFACE,
- .AlternateSetting = 0x00,
- .TotalEndpoints = 1,
- .Class = HID_CSCP_HIDClass,
+ /*
+ * Shared
+ */
+ .Shared_Interface = {
+ .Header = {
+ .Size = sizeof(USB_Descriptor_Interface_t),
+ .Type = DTYPE_Interface
+ },
+ .InterfaceNumber = SHARED_INTERFACE,
+ .AlternateSetting = 0x00,
+ .TotalEndpoints = 1,
+ .Class = HID_CSCP_HIDClass,
# ifdef KEYBOARD_SHARED_EP
- .SubClass = HID_CSCP_BootSubclass,
- .Protocol = HID_CSCP_KeyboardBootProtocol,
+ .SubClass = HID_CSCP_BootSubclass,
+ .Protocol = HID_CSCP_KeyboardBootProtocol,
# else
- .SubClass = HID_CSCP_NonBootSubclass,
- .Protocol = HID_CSCP_NonBootProtocol,
+ .SubClass = HID_CSCP_NonBootSubclass,
+ .Protocol = HID_CSCP_NonBootProtocol,
# endif
- .InterfaceStrIndex = NO_DESCRIPTOR},
- .Shared_HID = {.Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID}, .HIDSpec = VERSION_BCD(1, 1, 1), .CountryCode = 0x00, .TotalReportDescriptors = 1, .HIDReportType = HID_DTYPE_Report, .HIDReportLength = sizeof(SharedReport)},
- .Shared_INEndpoint = {.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, .EndpointAddress = (ENDPOINT_DIR_IN | SHARED_IN_EPNUM), .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = SHARED_EPSIZE, .PollingIntervalMS = USB_POLLING_INTERVAL_MS},
+ .InterfaceStrIndex = NO_DESCRIPTOR
+ },
+ .Shared_HID = {
+ .Header = {
+ .Size = sizeof(USB_HID_Descriptor_HID_t),
+ .Type = HID_DTYPE_HID
+ },
+ .HIDSpec = VERSION_BCD(1, 1, 1),
+ .CountryCode = 0x00,
+ .TotalReportDescriptors = 1,
+ .HIDReportType = HID_DTYPE_Report,
+ .HIDReportLength = sizeof(SharedReport)
+ },
+ .Shared_INEndpoint = {
+ .Header = {
+ .Size = sizeof(USB_Descriptor_Endpoint_t),
+ .Type = DTYPE_Endpoint
+ },
+ .EndpointAddress = (ENDPOINT_DIR_IN | SHARED_IN_EPNUM),
+ .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
+ .EndpointSize = SHARED_EPSIZE,
+ .PollingIntervalMS = USB_POLLING_INTERVAL_MS
+ },
#endif
#ifdef CONSOLE_ENABLE
- /*
- * Console
- */
- .Console_Interface = {.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .InterfaceNumber = CONSOLE_INTERFACE, .AlternateSetting = 0x00, .TotalEndpoints = 2, .Class = HID_CSCP_HIDClass, .SubClass = HID_CSCP_NonBootSubclass, .Protocol = HID_CSCP_NonBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR},
- .Console_HID = {.Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID}, .HIDSpec = VERSION_BCD(1, 1, 1), .CountryCode = 0x00, .TotalReportDescriptors = 1, .HIDReportType = HID_DTYPE_Report, .HIDReportLength = sizeof(ConsoleReport)},
- .Console_INEndpoint = {.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, .EndpointAddress = (ENDPOINT_DIR_IN | CONSOLE_IN_EPNUM), .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CONSOLE_EPSIZE, .PollingIntervalMS = 0x01},
- .Console_OUTEndpoint = {.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, .EndpointAddress = (ENDPOINT_DIR_OUT | CONSOLE_OUT_EPNUM), .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CONSOLE_EPSIZE, .PollingIntervalMS = 0x01},
+ /*
+ * Console
+ */
+ .Console_Interface = {
+ .Header = {
+ .Size = sizeof(USB_Descriptor_Interface_t),
+ .Type = DTYPE_Interface
+ },
+ .InterfaceNumber = CONSOLE_INTERFACE,
+ .AlternateSetting = 0x00,
+ .TotalEndpoints = 2,
+ .Class = HID_CSCP_HIDClass,
+ .SubClass = HID_CSCP_NonBootSubclass,
+ .Protocol = HID_CSCP_NonBootProtocol,
+ .InterfaceStrIndex = NO_DESCRIPTOR
+ },
+ .Console_HID = {
+ .Header = {
+ .Size = sizeof(USB_HID_Descriptor_HID_t),
+ .Type = HID_DTYPE_HID
+ },
+ .HIDSpec = VERSION_BCD(1, 1, 1),
+ .CountryCode = 0x00,
+ .TotalReportDescriptors = 1,
+ .HIDReportType = HID_DTYPE_Report,
+ .HIDReportLength = sizeof(ConsoleReport)
+ },
+ .Console_INEndpoint = {
+ .Header = {
+ .Size = sizeof(USB_Descriptor_Endpoint_t),
+ .Type = DTYPE_Endpoint
+ },
+ .EndpointAddress = (ENDPOINT_DIR_IN | CONSOLE_IN_EPNUM),
+ .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
+ .EndpointSize = CONSOLE_EPSIZE,
+ .PollingIntervalMS = 0x01
+ },
+ .Console_OUTEndpoint = {
+ .Header = {
+ .Size = sizeof(USB_Descriptor_Endpoint_t),
+ .Type = DTYPE_Endpoint
+ },
+ .EndpointAddress = (ENDPOINT_DIR_OUT | CONSOLE_OUT_EPNUM),
+ .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
+ .EndpointSize = CONSOLE_EPSIZE,
+ .PollingIntervalMS = 0x01
+ },
#endif
#ifdef MIDI_ENABLE
- /*
- * MIDI
- */
- .Audio_Interface_Association =
- {
- .Header = {.Size = sizeof(USB_Descriptor_Interface_Association_t), .Type = DTYPE_InterfaceAssociation},
- .FirstInterfaceIndex = AC_INTERFACE,
- .TotalInterfaces = 2,
- .Class = AUDIO_CSCP_AudioClass,
- .SubClass = AUDIO_CSCP_ControlSubclass,
- .Protocol = AUDIO_CSCP_ControlProtocol,
- .IADStrIndex = NO_DESCRIPTOR,
- },
- .Audio_ControlInterface = {.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
-
- .InterfaceNumber = AC_INTERFACE,
- .AlternateSetting = 0,
- .TotalEndpoints = 0,
- .Class = AUDIO_CSCP_AudioClass,
- .SubClass = AUDIO_CSCP_ControlSubclass,
- .Protocol = AUDIO_CSCP_ControlProtocol,
- .InterfaceStrIndex = NO_DESCRIPTOR},
- .Audio_ControlInterface_SPC =
- {
- .Header = {.Size = sizeof(USB_Audio_Descriptor_Interface_AC_t), .Type = AUDIO_DTYPE_CSInterface},
- .Subtype = AUDIO_DSUBTYPE_CSInterface_Header,
- .ACSpecification = VERSION_BCD(1, 0, 0),
- .TotalLength = sizeof(USB_Audio_Descriptor_Interface_AC_t),
- .InCollection = 1,
- .InterfaceNumber = AS_INTERFACE,
- },
- .Audio_StreamInterface = {.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
-
- .InterfaceNumber = AS_INTERFACE,
- .AlternateSetting = 0,
- .TotalEndpoints = 2,
- .Class = AUDIO_CSCP_AudioClass,
- .SubClass = AUDIO_CSCP_MIDIStreamingSubclass,
- .Protocol = AUDIO_CSCP_StreamingProtocol,
- .InterfaceStrIndex = NO_DESCRIPTOR},
- .Audio_StreamInterface_SPC = {.Header = {.Size = sizeof(USB_MIDI_Descriptor_AudioInterface_AS_t), .Type = AUDIO_DTYPE_CSInterface}, .Subtype = AUDIO_DSUBTYPE_CSInterface_General, .AudioSpecification = VERSION_BCD(1, 0, 0), .TotalLength = offsetof(USB_Descriptor_Configuration_t, MIDI_Out_Jack_Endpoint_SPC) + sizeof(USB_MIDI_Descriptor_Jack_Endpoint_t) - offsetof(USB_Descriptor_Configuration_t, Audio_StreamInterface_SPC)},
- .MIDI_In_Jack_Emb = {.Header = {.Size = sizeof(USB_MIDI_Descriptor_InputJack_t), .Type = AUDIO_DTYPE_CSInterface}, .Subtype = AUDIO_DSUBTYPE_CSInterface_InputTerminal, .JackType = MIDI_JACKTYPE_Embedded, .JackID = 0x01, .JackStrIndex = NO_DESCRIPTOR},
- .MIDI_In_Jack_Ext = {.Header = {.Size = sizeof(USB_MIDI_Descriptor_InputJack_t), .Type = AUDIO_DTYPE_CSInterface}, .Subtype = AUDIO_DSUBTYPE_CSInterface_InputTerminal, .JackType = MIDI_JACKTYPE_External, .JackID = 0x02, .JackStrIndex = NO_DESCRIPTOR},
- .MIDI_Out_Jack_Emb = {.Header = {.Size = sizeof(USB_MIDI_Descriptor_OutputJack_t), .Type = AUDIO_DTYPE_CSInterface}, .Subtype = AUDIO_DSUBTYPE_CSInterface_OutputTerminal, .JackType = MIDI_JACKTYPE_Embedded, .JackID = 0x03, .NumberOfPins = 1, .SourceJackID = {0x02}, .SourcePinID = {0x01}, .JackStrIndex = NO_DESCRIPTOR},
- .MIDI_Out_Jack_Ext = {.Header = {.Size = sizeof(USB_MIDI_Descriptor_OutputJack_t), .Type = AUDIO_DTYPE_CSInterface}, .Subtype = AUDIO_DSUBTYPE_CSInterface_OutputTerminal, .JackType = MIDI_JACKTYPE_External, .JackID = 0x04, .NumberOfPins = 1, .SourceJackID = {0x01}, .SourcePinID = {0x01}, .JackStrIndex = NO_DESCRIPTOR},
- .MIDI_In_Jack_Endpoint = {.Endpoint = {.Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint}, .EndpointAddress = MIDI_STREAM_OUT_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MIDI_STREAM_EPSIZE, .PollingIntervalMS = 0x05},
-
- .Refresh = 0,
- .SyncEndpointNumber = 0},
- .MIDI_In_Jack_Endpoint_SPC = {.Header = {.Size = sizeof(USB_MIDI_Descriptor_Jack_Endpoint_t), .Type = AUDIO_DTYPE_CSEndpoint}, .Subtype = AUDIO_DSUBTYPE_CSEndpoint_General, .TotalEmbeddedJacks = 0x01, .AssociatedJackID = {0x01}},
- .MIDI_Out_Jack_Endpoint = {.Endpoint = {.Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint}, .EndpointAddress = MIDI_STREAM_IN_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MIDI_STREAM_EPSIZE, .PollingIntervalMS = 0x05},
-
- .Refresh = 0,
- .SyncEndpointNumber = 0},
- .MIDI_Out_Jack_Endpoint_SPC = {.Header = {.Size = sizeof(USB_MIDI_Descriptor_Jack_Endpoint_t), .Type = AUDIO_DTYPE_CSEndpoint}, .Subtype = AUDIO_DSUBTYPE_CSEndpoint_General, .TotalEmbeddedJacks = 0x01, .AssociatedJackID = {0x03}},
+ /*
+ * MIDI
+ */
+ .Audio_Interface_Association = {
+ .Header = {
+ .Size = sizeof(USB_Descriptor_Interface_Association_t),
+ .Type = DTYPE_InterfaceAssociation
+ },
+ .FirstInterfaceIndex = AC_INTERFACE,
+ .TotalInterfaces = 2,
+ .Class = AUDIO_CSCP_AudioClass,
+ .SubClass = AUDIO_CSCP_ControlSubclass,
+ .Protocol = AUDIO_CSCP_ControlProtocol,
+ .IADStrIndex = NO_DESCRIPTOR,
+ },
+ .Audio_ControlInterface = {
+ .Header = {
+ .Size = sizeof(USB_Descriptor_Interface_t),
+ .Type = DTYPE_Interface
+ },
+ .InterfaceNumber = AC_INTERFACE,
+ .AlternateSetting = 0,
+ .TotalEndpoints = 0,
+ .Class = AUDIO_CSCP_AudioClass,
+ .SubClass = AUDIO_CSCP_ControlSubclass,
+ .Protocol = AUDIO_CSCP_ControlProtocol,
+ .InterfaceStrIndex = NO_DESCRIPTOR
+ },
+ .Audio_ControlInterface_SPC = {
+ .Header = {
+ .Size = sizeof(USB_Audio_Descriptor_Interface_AC_t),
+ .Type = AUDIO_DTYPE_CSInterface
+ },
+ .Subtype = AUDIO_DSUBTYPE_CSInterface_Header,
+ .ACSpecification = VERSION_BCD(1, 0, 0),
+ .TotalLength = sizeof(USB_Audio_Descriptor_Interface_AC_t),
+ .InCollection = 1,
+ .InterfaceNumber = AS_INTERFACE,
+ },
+ .Audio_StreamInterface = {
+ .Header = {
+ .Size = sizeof(USB_Descriptor_Interface_t),
+ .Type = DTYPE_Interface
+ },
+ .InterfaceNumber = AS_INTERFACE,
+ .AlternateSetting = 0,
+ .TotalEndpoints = 2,
+ .Class = AUDIO_CSCP_AudioClass,
+ .SubClass = AUDIO_CSCP_MIDIStreamingSubclass,
+ .Protocol = AUDIO_CSCP_StreamingProtocol,
+ .InterfaceStrIndex = NO_DESCRIPTOR
+ },
+ .Audio_StreamInterface_SPC = {
+ .Header = {
+ .Size = sizeof(USB_MIDI_Descriptor_AudioInterface_AS_t),
+ .Type = AUDIO_DTYPE_CSInterface
+ },
+ .Subtype = AUDIO_DSUBTYPE_CSInterface_General,
+ .AudioSpecification = VERSION_BCD(1, 0, 0),
+ .TotalLength = offsetof(USB_Descriptor_Configuration_t, MIDI_Out_Jack_Endpoint_SPC) + sizeof(USB_MIDI_Descriptor_Jack_Endpoint_t) - offsetof(USB_Descriptor_Configuration_t, Audio_StreamInterface_SPC)
+ },
+ .MIDI_In_Jack_Emb = {
+ .Header = {
+ .Size = sizeof(USB_MIDI_Descriptor_InputJack_t),
+ .Type = AUDIO_DTYPE_CSInterface
+ },
+ .Subtype = AUDIO_DSUBTYPE_CSInterface_InputTerminal,
+ .JackType = MIDI_JACKTYPE_Embedded,
+ .JackID = 0x01,
+ .JackStrIndex = NO_DESCRIPTOR
+ },
+ .MIDI_In_Jack_Ext = {
+ .Header = {
+ .Size = sizeof(USB_MIDI_Descriptor_InputJack_t),
+ .Type = AUDIO_DTYPE_CSInterface
+ },
+ .Subtype = AUDIO_DSUBTYPE_CSInterface_InputTerminal,
+ .JackType = MIDI_JACKTYPE_External,
+ .JackID = 0x02,
+ .JackStrIndex = NO_DESCRIPTOR
+ },
+ .MIDI_Out_Jack_Emb = {
+ .Header = {
+ .Size = sizeof(USB_MIDI_Descriptor_OutputJack_t),
+ .Type = AUDIO_DTYPE_CSInterface
+ },
+ .Subtype = AUDIO_DSUBTYPE_CSInterface_OutputTerminal,
+ .JackType = MIDI_JACKTYPE_Embedded,
+ .JackID = 0x03,
+ .NumberOfPins = 1,
+ .SourceJackID = {0x02},
+ .SourcePinID = {0x01},
+ .JackStrIndex = NO_DESCRIPTOR
+ },
+ .MIDI_Out_Jack_Ext = {
+ .Header = {
+ .Size = sizeof(USB_MIDI_Descriptor_OutputJack_t),
+ .Type = AUDIO_DTYPE_CSInterface
+ },
+ .Subtype = AUDIO_DSUBTYPE_CSInterface_OutputTerminal,
+ .JackType = MIDI_JACKTYPE_External,
+ .JackID = 0x04,
+ .NumberOfPins = 1,
+ .SourceJackID = {0x01},
+ .SourcePinID = {0x01},
+ .JackStrIndex = NO_DESCRIPTOR
+ },
+ .MIDI_In_Jack_Endpoint = {
+ .Endpoint = {
+ .Header = {
+ .Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t),
+ .Type = DTYPE_Endpoint
+ },
+ .EndpointAddress = MIDI_STREAM_OUT_EPADDR,
+ .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
+ .EndpointSize = MIDI_STREAM_EPSIZE,
+ .PollingIntervalMS = 0x05
+ },
+ .Refresh = 0,
+ .SyncEndpointNumber = 0
+ },
+ .MIDI_In_Jack_Endpoint_SPC = {
+ .Header = {
+ .Size = sizeof(USB_MIDI_Descriptor_Jack_Endpoint_t),
+ .Type = AUDIO_DTYPE_CSEndpoint
+ },
+ .Subtype = AUDIO_DSUBTYPE_CSEndpoint_General,
+ .TotalEmbeddedJacks = 0x01,
+ .AssociatedJackID = {0x01}
+ },
+ .MIDI_Out_Jack_Endpoint = {
+ .Endpoint = {
+ .Header = {
+ .Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t),
+ .Type = DTYPE_Endpoint
+ },
+ .EndpointAddress = MIDI_STREAM_IN_EPADDR,
+ .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
+ .EndpointSize = MIDI_STREAM_EPSIZE,
+ .PollingIntervalMS = 0x05
+ },
+ .Refresh = 0,
+ .SyncEndpointNumber = 0
+ },
+ .MIDI_Out_Jack_Endpoint_SPC = {
+ .Header = {
+ .Size = sizeof(USB_MIDI_Descriptor_Jack_Endpoint_t),
+ .Type = AUDIO_DTYPE_CSEndpoint
+ },
+ .Subtype = AUDIO_DSUBTYPE_CSEndpoint_General,
+ .TotalEmbeddedJacks = 0x01,
+ .AssociatedJackID = {0x03}
+ },
#endif
#ifdef VIRTSER_ENABLE
- /*
- * Virtual Serial
- */
- .CDC_Interface_Association =
- {
- .Header = {.Size = sizeof(USB_Descriptor_Interface_Association_t), .Type = DTYPE_InterfaceAssociation},
- .FirstInterfaceIndex = CCI_INTERFACE,
- .TotalInterfaces = 2,
- .Class = CDC_CSCP_CDCClass,
- .SubClass = CDC_CSCP_ACMSubclass,
- .Protocol = CDC_CSCP_ATCommandProtocol,
- .IADStrIndex = NO_DESCRIPTOR,
- },
- .CDC_CCI_Interface = {.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .InterfaceNumber = CCI_INTERFACE, .AlternateSetting = 0, .TotalEndpoints = 1, .Class = CDC_CSCP_CDCClass, .SubClass = CDC_CSCP_ACMSubclass, .Protocol = CDC_CSCP_ATCommandProtocol, .InterfaceStrIndex = NO_DESCRIPTOR},
- .CDC_Functional_Header =
- {
- .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = CDC_DTYPE_CSInterface},
- .Subtype = 0x00,
- .CDCSpecification = VERSION_BCD(1, 1, 0),
- },
- .CDC_Functional_ACM =
- {
- .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = CDC_DTYPE_CSInterface},
- .Subtype = 0x02,
- .Capabilities = 0x02,
- },
- .CDC_Functional_Union =
- {
- .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = CDC_DTYPE_CSInterface},
- .Subtype = 0x06,
- .MasterInterfaceNumber = CCI_INTERFACE,
- .SlaveInterfaceNumber = CDI_INTERFACE,
- },
- .CDC_NotificationEndpoint = {.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, .EndpointAddress = CDC_NOTIFICATION_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_NOTIFICATION_EPSIZE, .PollingIntervalMS = 0xFF},
- .CDC_DCI_Interface = {.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .InterfaceNumber = CDI_INTERFACE, .AlternateSetting = 0, .TotalEndpoints = 2, .Class = CDC_CSCP_CDCDataClass, .SubClass = CDC_CSCP_NoDataSubclass, .Protocol = CDC_CSCP_NoDataProtocol, .InterfaceStrIndex = NO_DESCRIPTOR},
- .CDC_DataOutEndpoint = {.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, .EndpointAddress = CDC_OUT_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_EPSIZE, .PollingIntervalMS = 0x05},
- .CDC_DataInEndpoint = {.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, .EndpointAddress = CDC_IN_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_EPSIZE, .PollingIntervalMS = 0x05},
+ /*
+ * Virtual Serial
+ */
+ .CDC_Interface_Association = {
+ .Header = {
+ .Size = sizeof(USB_Descriptor_Interface_Association_t),
+ .Type = DTYPE_InterfaceAssociation
+ },
+ .FirstInterfaceIndex = CCI_INTERFACE,
+ .TotalInterfaces = 2,
+ .Class = CDC_CSCP_CDCClass,
+ .SubClass = CDC_CSCP_ACMSubclass,
+ .Protocol = CDC_CSCP_ATCommandProtocol,
+ .IADStrIndex = NO_DESCRIPTOR,
+ },
+ .CDC_CCI_Interface = {
+ .Header = {
+ .Size = sizeof(USB_Descriptor_Interface_t),
+ .Type = DTYPE_Interface
+ },
+ .InterfaceNumber = CCI_INTERFACE,
+ .AlternateSetting = 0,
+ .TotalEndpoints = 1,
+ .Class = CDC_CSCP_CDCClass,
+ .SubClass = CDC_CSCP_ACMSubclass,
+ .Protocol = CDC_CSCP_ATCommandProtocol,
+ .InterfaceStrIndex = NO_DESCRIPTOR
+ },
+ .CDC_Functional_Header = {
+ .Header = {
+ .Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t),
+ .Type = CDC_DTYPE_CSInterface
+ },
+ .Subtype = 0x00,
+ .CDCSpecification = VERSION_BCD(1, 1, 0),
+ },
+ .CDC_Functional_ACM = {
+ .Header = {
+ .Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t),
+ .Type = CDC_DTYPE_CSInterface
+ },
+ .Subtype = 0x02,
+ .Capabilities = 0x02,
+ },
+ .CDC_Functional_Union = {
+ .Header = {
+ .Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t),
+ .Type = CDC_DTYPE_CSInterface
+ },
+ .Subtype = 0x06,
+ .MasterInterfaceNumber = CCI_INTERFACE,
+ .SlaveInterfaceNumber = CDI_INTERFACE,
+ },
+ .CDC_NotificationEndpoint = {
+ .Header = {
+ .Size = sizeof(USB_Descriptor_Endpoint_t),
+ .Type = DTYPE_Endpoint
+ },
+ .EndpointAddress = CDC_NOTIFICATION_EPADDR,
+ .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
+ .EndpointSize = CDC_NOTIFICATION_EPSIZE,
+ .PollingIntervalMS = 0xFF
+ },
+ .CDC_DCI_Interface = {
+ .Header = {
+ .Size = sizeof(USB_Descriptor_Interface_t),
+ .Type = DTYPE_Interface
+ },
+ .InterfaceNumber = CDI_INTERFACE,
+ .AlternateSetting = 0,
+ .TotalEndpoints = 2,
+ .Class = CDC_CSCP_CDCDataClass,
+ .SubClass = CDC_CSCP_NoDataSubclass,
+ .Protocol = CDC_CSCP_NoDataProtocol,
+ .InterfaceStrIndex = NO_DESCRIPTOR
+ },
+ .CDC_DataOutEndpoint = {
+ .Header = {
+ .Size = sizeof(USB_Descriptor_Endpoint_t),
+ .Type = DTYPE_Endpoint
+ },
+ .EndpointAddress = CDC_OUT_EPADDR,
+ .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
+ .EndpointSize = CDC_EPSIZE,
+ .PollingIntervalMS = 0x05
+ },
+ .CDC_DataInEndpoint = {
+ .Header = {
+ .Size = sizeof(USB_Descriptor_Endpoint_t),
+ .Type = DTYPE_Endpoint
+ },
+ .EndpointAddress = CDC_IN_EPADDR,
+ .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
+ .EndpointSize = CDC_EPSIZE,
+ .PollingIntervalMS = 0x05
+ },
#endif
};
/*
* String descriptors
*/
-const USB_Descriptor_String_t PROGMEM LanguageString = {.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String}, .UnicodeString = {LANGUAGE_ID_ENG}};
+const USB_Descriptor_String_t PROGMEM LanguageString = {
+ .Header = {
+ .Size = USB_STRING_LEN(1),
+ .Type = DTYPE_String
+ },
+ .UnicodeString = {LANGUAGE_ID_ENG}
+};
-const USB_Descriptor_String_t PROGMEM ManufacturerString = {.Header = {.Size = USB_STRING_LEN(sizeof(STR(MANUFACTURER)) - 1), // Subtract 1 for null terminator
- .Type = DTYPE_String},
- .UnicodeString = LSTR(MANUFACTURER)};
+const USB_Descriptor_String_t PROGMEM ManufacturerString = {
+ .Header = {
+ .Size = USB_STRING_LEN(sizeof(STR(MANUFACTURER)) - 1), // Subtract 1 for null terminator
+ .Type = DTYPE_String
+ },
+ .UnicodeString = LSTR(MANUFACTURER)
+};
-const USB_Descriptor_String_t PROGMEM ProductString = {.Header = {.Size = USB_STRING_LEN(sizeof(STR(PRODUCT)) - 1), // Subtract 1 for null terminator
- .Type = DTYPE_String},
- .UnicodeString = LSTR(PRODUCT)};
+const USB_Descriptor_String_t PROGMEM ProductString = {
+ .Header = {
+ .Size = USB_STRING_LEN(sizeof(STR(PRODUCT)) - 1), // Subtract 1 for null terminator
+ .Type = DTYPE_String
+ },
+ .UnicodeString = LSTR(PRODUCT)
+};
#ifndef SERIAL_NUMBER
# define SERIAL_NUMBER 0
#endif
-const USB_Descriptor_String_t PROGMEM SerialNumberString = {.Header = {.Size = USB_STRING_LEN(sizeof(STR(SERIAL_NUMBER)) - 1), // Subtract 1 for null terminator
- .Type = DTYPE_String},
- .UnicodeString = LSTR(SERIAL_NUMBER)};
+const USB_Descriptor_String_t PROGMEM SerialNumberString = {
+ .Header = {
+ .Size = USB_STRING_LEN(sizeof(STR(SERIAL_NUMBER)) - 1), // Subtract 1 for null terminator
+ .Type = DTYPE_String
+ },
+ .UnicodeString = LSTR(SERIAL_NUMBER)
+};
+
+// clang-format on
/**
* This function is called by the library when in device mode, and must be overridden (see library "USB Descriptors"
From dc1137129d063975b3191853dc96d0095fcf94d6 Mon Sep 17 00:00:00 2001
From: James Young <18669334+noroadsleft@users.noreply.github.com>
Date: Mon, 4 Nov 2019 23:05:51 -0800
Subject: [PATCH 13/16] [Keyboard] Add LAYOUT_60_iso to XD60 (#7263)
* refactor iso keymap
- remove redundant action_layer.h include
- use enum for layer management
- QMK coding conventions (four-space indent)
* add LAYOUT_60_iso macro
* enable 60_iso community layout for both revisions
* swap KC_HOME to KC_RSFT
* update ISO keymap readme
* update default keymap readme
`make` command no longer valid.
* refactor keyboard readme
Update to reflect current QMK template.
* add LAYOUT_60_iso data to info.json
* use #pragma once in header files
---
keyboards/xd60/info.json | 4 +++
keyboards/xd60/keymaps/default/readme.md | 6 +++-
keyboards/xd60/keymaps/iso/keymap.c | 39 +++++++++++++-----------
keyboards/xd60/keymaps/iso/readme.md | 19 +++++++++---
keyboards/xd60/readme.md | 19 +++++-------
keyboards/xd60/rev2/config.h | 5 +--
keyboards/xd60/rev2/rules.mk | 2 +-
keyboards/xd60/rev3/rules.mk | 2 +-
keyboards/xd60/xd60.h | 18 ++++++++---
9 files changed, 69 insertions(+), 45 deletions(-)
diff --git a/keyboards/xd60/info.json b/keyboards/xd60/info.json
index ba3c4b5413e0..c69e8a78872f 100644
--- a/keyboards/xd60/info.json
+++ b/keyboards/xd60/info.json
@@ -10,6 +10,10 @@
"LAYOUT_60_ansi": {
"layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}]
+ },
+
+ "LAYOUT_60_iso": {
+ "layout": [{"label":"\u00ac", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"\u00a3", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"GUI", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"label":"Space", "x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"GUI", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}]
}
}
}
diff --git a/keyboards/xd60/keymaps/default/readme.md b/keyboards/xd60/keymaps/default/readme.md
index 248e0a60673c..7d6bc75365ce 100644
--- a/keyboards/xd60/keymaps/default/readme.md
+++ b/keyboards/xd60/keymaps/default/readme.md
@@ -6,4 +6,8 @@
Default Keymap for XD60 as indicated on the original sale page.
## Build
-To build the default keymap, simply run `make xd60:default`.
+
+To build the default keymap, simply run:
+
+ make xd60/rev2:default # XD60 rev2
+ make xd60/rev3:default # XD60 rev3
diff --git a/keyboards/xd60/keymaps/iso/keymap.c b/keyboards/xd60/keymaps/iso/keymap.c
index bb4f8eff8494..0f4694ca6319 100644
--- a/keyboards/xd60/keymaps/iso/keymap.c
+++ b/keyboards/xd60/keymaps/iso/keymap.c
@@ -1,30 +1,33 @@
#include QMK_KEYBOARD_H
-#include "action_layer.h"
-#define _BL 0
-#define _FL 1
+enum layer_names {
+ _BL,
+ _FL,
+};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
- // 0: Base Layer
- [_BL] = LAYOUT_all(
- 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_NO, \
- 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_NO, \
- KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \
- KC_LSFT, KC_BSLS, 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, \
- KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RGUI, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT),
+ //,: Base Layer
+ [_BL] = LAYOUT_60_iso(
+ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,
+ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,
+ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT,
+ KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
+ KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL
+ ),
- // 1: Function Layer
- [_FL] = LAYOUT_all(
- RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_NO, \
- KC_NO, KC_VOLD, KC_MUTE, KC_VOLU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, BL_TOGG, BL_DEC, BL_INC, KC_NO, \
- KC_NO, KC_MPLY, KC_MSTP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_ENT, \
- KC_LSFT, RGB_TOG, RGB_MOD, KC_CUT, KC_COPY,KC_PASTE,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD, KC_HOME, KC_PGUP, KC_END, \
- KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RGUI, MO(1), KC_NO, KC_PGDOWN, KC_NO),
+ //,: Function Layer
+ [_FL] = LAYOUT_60_iso(
+ RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL,
+ XXXXXXX, KC_VOLD, KC_MUTE, KC_VOLU, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_TOGG, BL_DEC, BL_INC,
+ XXXXXXX, KC_MPLY, KC_MSTP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_ENT,
+ KC_LSFT, RGB_TOG, RGB_MOD, KC_CUT, KC_COPY, KC_PSTE, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_RSFT,
+ KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL
+ )
};
// Loop
void matrix_scan_user(void) {
- // Empty
+ // Empty
};
diff --git a/keyboards/xd60/keymaps/iso/readme.md b/keyboards/xd60/keymaps/iso/readme.md
index 82c575d981da..84374fa1858d 100644
--- a/keyboards/xd60/keymaps/iso/readme.md
+++ b/keyboards/xd60/keymaps/iso/readme.md
@@ -1,9 +1,20 @@
# iso Keymap for XIUDI's 60% XD60 PCB
-![iso Keymap for XD60]()
-
-## Additional Notes
iso Keymap for XD60.
+## Keymap
+
+### Base Layer
+
+![Layer 0](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/xd60/keymaps/iso/layer0.png)
+
+### Function Layer
+
+![Layer 1](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/xd60/keymaps/iso/layer1.png)
+
## Build
-To build the default keymap, simply run `make xd60:iso`.
+
+To build the default keymap, simply run:
+
+ make xd60/rev2:iso # XD60 rev2
+ make xd60/rev3:iso # XD60 rev3
diff --git a/keyboards/xd60/readme.md b/keyboards/xd60/readme.md
index b9862428c777..4280414827be 100644
--- a/keyboards/xd60/readme.md
+++ b/keyboards/xd60/readme.md
@@ -1,21 +1,16 @@
-XD60
-==
+# XD60
Compact 60% with arrows.
![Top View of a pair of XD60 Keyboard](https://i.imgur.com/3Jq2743.jpg)
-Keyboard Maintainer: QMK Community
-Hardware Supported: XD60 PCB rev2 & rev3
-Hardware Availability: https://www.massdrop.com/buy/xd60-xd64-custom-mechanical-keyboard-kit?mode=guest_open
+* Keyboard Maintainer: QMK Community
+* Hardware Supported: XD60 PCB rev2 & rev3
+* Hardware Availability: [Drop.com](https://www.drop.com/buy/xd60-xd64-custom-mechanical-keyboard-kit?mode=guest_open), [KPRepublic on AliExpress](https://www.aliexpress.com/item/32814945677.html)
-With the implementation of Rev3 you need to specify the Rev you want to build.
-To build for a Rev2 with a default keymap:
+Make example for this keyboard (after setting up your build environment):
-```make xd60/rev2:default```
-
-To build for a Rev3 with a default keymap:
-
-```make xd60/rev3:default```
+ make xd60/rev2:default # rev2
+ make xd60/rev3:default # rev3
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
diff --git a/keyboards/xd60/rev2/config.h b/keyboards/xd60/rev2/config.h
index 5f23f6eac31b..26dbb50e30b6 100644
--- a/keyboards/xd60/rev2/config.h
+++ b/keyboards/xd60/rev2/config.h
@@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
-#ifndef CONFIG_H
-#define CONFIG_H
+#pragma once
#include "config_common.h"
@@ -70,5 +69,3 @@ along with this program. If not, see .
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE
-
-#endif
diff --git a/keyboards/xd60/rev2/rules.mk b/keyboards/xd60/rev2/rules.mk
index 37f281b0cc43..b6a8c05d2ff0 100644
--- a/keyboards/xd60/rev2/rules.mk
+++ b/keyboards/xd60/rev2/rules.mk
@@ -26,4 +26,4 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
-LAYOUTS = 60_ansi
+LAYOUTS = 60_ansi 60_iso
diff --git a/keyboards/xd60/rev3/rules.mk b/keyboards/xd60/rev3/rules.mk
index 8e1fd415b1ca..7cff162c9f96 100644
--- a/keyboards/xd60/rev3/rules.mk
+++ b/keyboards/xd60/rev3/rules.mk
@@ -26,4 +26,4 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
-LAYOUTS = 60_ansi
+LAYOUTS = 60_ansi 60_iso
diff --git a/keyboards/xd60/xd60.h b/keyboards/xd60/xd60.h
index 579d67dd3436..3946138c3810 100644
--- a/keyboards/xd60/xd60.h
+++ b/keyboards/xd60/xd60.h
@@ -1,8 +1,6 @@
-#ifndef XD60_H
-#define XD60_H
+#pragma once
#include "quantum.h"
-#include "led.h"
/* XD60 LEDs
* GPIO pads
@@ -48,4 +46,16 @@ inline void xd60_bl_led_off(void) { DDRF &= ~(1<<5); PORTF &= ~(1<<5); }
{ K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D } \
}
-#endif
+#define LAYOUT_60_iso( \
+ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
+ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \
+ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \
+ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \
+ K40, K41, K42, K45, K4A, K4B, K4C, K4D \
+) { \
+ { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
+ { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, KC_NO }, \
+ { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \
+ { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D }, \
+ { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D } \
+}
From dcb2d63302fefe1b37b8ca606ce7241ae8655389 Mon Sep 17 00:00:00 2001
From: x1
Date: Tue, 5 Nov 2019 16:07:31 +0900
Subject: [PATCH 14/16] [Keyboard] Add Kudox Rev2 (#7253)
* Add a directory as rev2 in keybords/kudox.
* Modified default keymap of Kudox.
* Modified JIS keymap of Kudox.
* Changed kudox default from rev1 to rev2.
* Modified a keymap of kudox/x1.
* Move keyboards/kudox/keymaps to keyboards/kudox/rev1/.
* Remove keyboards/kudox/info.json.
* Modified kudox's READMEs.
* Remove unnecessary codes.
---
keyboards/kudox/kudox.h | 3 +
keyboards/kudox/readme.md | 11 ++-
keyboards/kudox/{ => rev1}/info.json | 6 +-
.../kudox/{ => rev1}/keymaps/default/config.h | 0
.../kudox/{ => rev1}/keymaps/default/keymap.c | 0
.../{ => rev1}/keymaps/default/readme.md | 0
.../kudox/{ => rev1}/keymaps/jis/config.h | 0
.../kudox/{ => rev1}/keymaps/jis/keymap.c | 0
.../kudox/{ => rev1}/keymaps/jis/readme.md | 0
.../kudox/{ => rev1}/keymaps/jis/rules.mk | 0
.../kudox/{ => rev1}/keymaps/x1/config.h | 0
.../kudox/{ => rev1}/keymaps/x1/keymap.c | 0
.../kudox/{ => rev1}/keymaps/x1/readme.md | 0
.../kudox/{ => rev1}/keymaps/x1/rules.mk | 0
keyboards/kudox/rev2/config.h | 91 +++++++++++++++++++
keyboards/kudox/rev2/info.json | 77 ++++++++++++++++
keyboards/kudox/rev2/keymaps/default/config.h | 17 ++++
keyboards/kudox/rev2/keymaps/default/keymap.c | 49 ++++++++++
.../kudox/rev2/keymaps/default/readme.md | 3 +
keyboards/kudox/rev2/keymaps/jis/config.h | 17 ++++
keyboards/kudox/rev2/keymaps/jis/keymap.c | 48 ++++++++++
keyboards/kudox/rev2/keymaps/jis/readme.md | 3 +
keyboards/kudox/rev2/keymaps/jis/rules.mk | 0
keyboards/kudox/rev2/rev2.c | 0
keyboards/kudox/rev2/rev2.h | 23 +++++
keyboards/kudox/rev2/rules.mk | 0
keyboards/kudox/rules.mk | 2 +-
27 files changed, 341 insertions(+), 9 deletions(-)
rename keyboards/kudox/{ => rev1}/info.json (97%)
rename keyboards/kudox/{ => rev1}/keymaps/default/config.h (100%)
rename keyboards/kudox/{ => rev1}/keymaps/default/keymap.c (100%)
rename keyboards/kudox/{ => rev1}/keymaps/default/readme.md (100%)
rename keyboards/kudox/{ => rev1}/keymaps/jis/config.h (100%)
rename keyboards/kudox/{ => rev1}/keymaps/jis/keymap.c (100%)
rename keyboards/kudox/{ => rev1}/keymaps/jis/readme.md (100%)
rename keyboards/kudox/{ => rev1}/keymaps/jis/rules.mk (100%)
rename keyboards/kudox/{ => rev1}/keymaps/x1/config.h (100%)
rename keyboards/kudox/{ => rev1}/keymaps/x1/keymap.c (100%)
rename keyboards/kudox/{ => rev1}/keymaps/x1/readme.md (100%)
rename keyboards/kudox/{ => rev1}/keymaps/x1/rules.mk (100%)
create mode 100644 keyboards/kudox/rev2/config.h
create mode 100644 keyboards/kudox/rev2/info.json
create mode 100644 keyboards/kudox/rev2/keymaps/default/config.h
create mode 100644 keyboards/kudox/rev2/keymaps/default/keymap.c
create mode 100644 keyboards/kudox/rev2/keymaps/default/readme.md
create mode 100644 keyboards/kudox/rev2/keymaps/jis/config.h
create mode 100644 keyboards/kudox/rev2/keymaps/jis/keymap.c
create mode 100644 keyboards/kudox/rev2/keymaps/jis/readme.md
create mode 100644 keyboards/kudox/rev2/keymaps/jis/rules.mk
create mode 100644 keyboards/kudox/rev2/rev2.c
create mode 100644 keyboards/kudox/rev2/rev2.h
create mode 100644 keyboards/kudox/rev2/rules.mk
diff --git a/keyboards/kudox/kudox.h b/keyboards/kudox/kudox.h
index 8ff75559d1fd..176f02fb5f98 100644
--- a/keyboards/kudox/kudox.h
+++ b/keyboards/kudox/kudox.h
@@ -19,5 +19,8 @@
#ifdef KEYBOARD_kudox_rev1
#include "rev1.h"
#endif
+#ifdef KEYBOARD_kudox_rev2
+ #include "rev2.h"
+#endif
#include "quantum.h"
diff --git a/keyboards/kudox/readme.md b/keyboards/kudox/readme.md
index 42e1ed937202..cc97bf83b0a7 100644
--- a/keyboards/kudox/readme.md
+++ b/keyboards/kudox/readme.md
@@ -5,22 +5,25 @@
-
+
- Keyboard Maintainer: [Kumao Kobo](https://github.com/kumaokobo)
-- Hardware Supported: Kudox PCB rev1.0 w/ Pro Micro
+- Hardware Supported: Kudox PCB rev1.0 rev2.0 w/ Pro Micro
Make example for this keyboard (after setting up your build environment):
```sh
-make kudox/rev1:default
+make kudox/rev2:default
```
+
Example of flashing this keyboard:
```sh
-make kudox/rev1:default:avrdude
+make kudox/rev2:default:flash
```
+*keymaps/default is for rev2.0. If you want to use rev1.0, you should remove Left-06 key and Right-06 key.*
+
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
diff --git a/keyboards/kudox/info.json b/keyboards/kudox/rev1/info.json
similarity index 97%
rename from keyboards/kudox/info.json
rename to keyboards/kudox/rev1/info.json
index 842fb655c6a0..f92d525838a0 100644
--- a/keyboards/kudox/info.json
+++ b/keyboards/kudox/rev1/info.json
@@ -1,9 +1,7 @@
{
- "keyboard_name": "Kudox Keyboard",
- "url": "",
+ "url": "http://kumaokobo.com/",
"maintainer": "Kumao Kobo",
- "width": 17,
- "height": 6,
+ "keyboard_name": "Kudox Keyboard Rev1",
"layouts": {
"LAYOUT": {
"layout": [
diff --git a/keyboards/kudox/keymaps/default/config.h b/keyboards/kudox/rev1/keymaps/default/config.h
similarity index 100%
rename from keyboards/kudox/keymaps/default/config.h
rename to keyboards/kudox/rev1/keymaps/default/config.h
diff --git a/keyboards/kudox/keymaps/default/keymap.c b/keyboards/kudox/rev1/keymaps/default/keymap.c
similarity index 100%
rename from keyboards/kudox/keymaps/default/keymap.c
rename to keyboards/kudox/rev1/keymaps/default/keymap.c
diff --git a/keyboards/kudox/keymaps/default/readme.md b/keyboards/kudox/rev1/keymaps/default/readme.md
similarity index 100%
rename from keyboards/kudox/keymaps/default/readme.md
rename to keyboards/kudox/rev1/keymaps/default/readme.md
diff --git a/keyboards/kudox/keymaps/jis/config.h b/keyboards/kudox/rev1/keymaps/jis/config.h
similarity index 100%
rename from keyboards/kudox/keymaps/jis/config.h
rename to keyboards/kudox/rev1/keymaps/jis/config.h
diff --git a/keyboards/kudox/keymaps/jis/keymap.c b/keyboards/kudox/rev1/keymaps/jis/keymap.c
similarity index 100%
rename from keyboards/kudox/keymaps/jis/keymap.c
rename to keyboards/kudox/rev1/keymaps/jis/keymap.c
diff --git a/keyboards/kudox/keymaps/jis/readme.md b/keyboards/kudox/rev1/keymaps/jis/readme.md
similarity index 100%
rename from keyboards/kudox/keymaps/jis/readme.md
rename to keyboards/kudox/rev1/keymaps/jis/readme.md
diff --git a/keyboards/kudox/keymaps/jis/rules.mk b/keyboards/kudox/rev1/keymaps/jis/rules.mk
similarity index 100%
rename from keyboards/kudox/keymaps/jis/rules.mk
rename to keyboards/kudox/rev1/keymaps/jis/rules.mk
diff --git a/keyboards/kudox/keymaps/x1/config.h b/keyboards/kudox/rev1/keymaps/x1/config.h
similarity index 100%
rename from keyboards/kudox/keymaps/x1/config.h
rename to keyboards/kudox/rev1/keymaps/x1/config.h
diff --git a/keyboards/kudox/keymaps/x1/keymap.c b/keyboards/kudox/rev1/keymaps/x1/keymap.c
similarity index 100%
rename from keyboards/kudox/keymaps/x1/keymap.c
rename to keyboards/kudox/rev1/keymaps/x1/keymap.c
diff --git a/keyboards/kudox/keymaps/x1/readme.md b/keyboards/kudox/rev1/keymaps/x1/readme.md
similarity index 100%
rename from keyboards/kudox/keymaps/x1/readme.md
rename to keyboards/kudox/rev1/keymaps/x1/readme.md
diff --git a/keyboards/kudox/keymaps/x1/rules.mk b/keyboards/kudox/rev1/keymaps/x1/rules.mk
similarity index 100%
rename from keyboards/kudox/keymaps/x1/rules.mk
rename to keyboards/kudox/rev1/keymaps/x1/rules.mk
diff --git a/keyboards/kudox/rev2/config.h b/keyboards/kudox/rev2/config.h
new file mode 100644
index 000000000000..3a0d608c226d
--- /dev/null
+++ b/keyboards/kudox/rev2/config.h
@@ -0,0 +1,91 @@
+/* Copyright 2019 Kumao Kobo
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+#pragma once
+
+#include "config_common.h"
+
+/* USB Device descriptor parameter */
+#define VENDOR_ID 0xFEED
+#define PRODUCT_ID 0x9690
+#define DEVICE_VER 0x0200
+#define MANUFACTURER Kumao Kobo
+#define PRODUCT The Kudox Keyboard
+#define DESCRIPTION Split row staggered 5x7 custom keyboard
+
+/* key matrix size */
+// Rows are doubled-up
+#define MATRIX_ROWS 10
+#define MATRIX_COLS 7
+
+// wiring of each half
+#define MATRIX_ROW_PINS { D4, D7, E6, B4, B5 }
+#define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2, B6 }
+// #define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6, F5} //uncomment this line and comment line above if you need to reverse left-to-right key order
+
+/* COL2ROW or ROW2COL */
+#define DIODE_DIRECTION COL2ROW
+
+/* define if matrix has ghost */
+//#define MATRIX_HAS_GHOST
+
+/* number of backlight levels */
+// #define BACKLIGHT_LEVELS 3
+
+/* Set 0 if debouncing isn't needed */
+#define DEBOUNCE 5
+
+/* serial.c configuration for split keyboard */
+#define SOFT_SERIAL_PIN D0
+
+/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
+#define LOCKING_SUPPORT_ENABLE
+/* Locking resynchronize hack */
+#define LOCKING_RESYNC_ENABLE
+
+/* ws2812 RGB LED */
+#define RGB_DI_PIN D3
+
+#undef RGBLED_NUM
+#define RGBLED_NUM 14 // Number of LEDs
+#define RGBLIGHT_ANIMATIONS
+#define RGBLIGHT_HUE_STEP 8
+#define RGBLIGHT_SAT_STEP 8
+#define RGBLIGHT_VAL_STEP 8
+
+/*
+ * Feature disable options
+ * These options are also useful to firmware size reduction.
+ */
+
+/* disable debug print */
+// #define NO_DEBUG
+
+/* disable print */
+// #define NO_PRINT
+
+/* disable action features */
+//#define NO_ACTION_LAYER
+//#define NO_ACTION_TAPPING
+//#define NO_ACTION_ONESHOT
+//#define NO_ACTION_MACRO
+//#define NO_ACTION_FUNCTION
+
+#define MOUSEKEY_INTERVAL 20
+#define MOUSEKEY_DELAY 0
+#define MOUSEKEY_TIME_TO_MAX 60
+#define MOUSEKEY_MAX_SPEED 7
+#define MOUSEKEY_WHEEL_DELAY 0
diff --git a/keyboards/kudox/rev2/info.json b/keyboards/kudox/rev2/info.json
new file mode 100644
index 000000000000..73cb5a525aa4
--- /dev/null
+++ b/keyboards/kudox/rev2/info.json
@@ -0,0 +1,77 @@
+{
+ "url": "http://kumaokobo.com/",
+ "maintainer": "Kumao Kobo",
+ "keyboard_name": "Kudox Keyboard Rev2",
+ "layouts": {
+ "LAYOUT": {
+ "layout": [
+ {"label":"Esc", "x":0, "y":0},
+ {"label":"1", "x":1, "y":0},
+ {"label":"2", "x":2, "y":0},
+ {"label":"3", "x":3, "y":0},
+ {"label":"4", "x":4, "y":0},
+ {"label":"5", "x":5, "y":0},
+ {"label":"`", "x":6, "y":0},
+ {"label":"6", "x":10, "y":0},
+ {"label":"7", "x":11, "y":0},
+ {"label":"8", "x":12, "y":0},
+ {"label":"9", "x":13, "y":0},
+ {"label":"0", "x":14, "y":0},
+ {"label":"-", "x":15, "y":0},
+ {"label":"\u2190", "x":16, "y":0},
+ {"label":"Tab", "x":0, "y":1, "w":1.25},
+ {"label":"Q", "x":1.25, "y":1},
+ {"label":"W", "x":2.25, "y":1},
+ {"label":"E", "x":3.25, "y":1},
+ {"label":"R", "x":4.25, "y":1},
+ {"label":"T", "x":5.25, "y":1},
+ {"label":"LANG2", "x":6.25, "y":1},
+ {"label":"Y", "x":9.75, "y":1},
+ {"label":"U", "x":10.75, "y":1},
+ {"label":"I", "x":11.75, "y":1},
+ {"label":"O", "x":12.75, "y":1},
+ {"label":"P", "x":13.75, "y":1},
+ {"label":"/", "x":14.75, "y":1},
+ {"label":"\\", "x":15.75, "y":1, "w":1.25},
+ {"label":"Ctrl", "x":0, "y":2, "w":1.75},
+ {"label":"A", "x":1.75, "y":2},
+ {"label":"S", "x":2.75, "y":2},
+ {"label":"D", "x":3.75, "y":2},
+ {"label":"F", "x":4.75, "y":2},
+ {"label":"G", "x":5.75, "y":2},
+ {"label":"H", "x":10.25, "y":2},
+ {"label":"J", "x":11.25, "y":2},
+ {"label":"K", "x":12.25, "y":2},
+ {"label":"L", "x":13.25, "y":2},
+ {"label":";", "x":14.25, "y":2},
+ {"label":"Enter", "x":15.25, "y":2, "w":1.75},
+ {"label":"Shift", "x":0, "y":3, "w":2.25},
+ {"label":"Z", "x":2.25, "y":3},
+ {"label":"X", "x":3.25, "y":3},
+ {"label":"C", "x":4.25, "y":3},
+ {"label":"V", "x":5.25, "y":3},
+ {"label":"B", "x":6.25, "y":3},
+ {"label":"LANG1", "x":9.75, "y":3},
+ {"label":"N", "x":10.75, "y":3},
+ {"label":"M", "x":11.75, "y":3},
+ {"label":",", "x":12.75, "y":3},
+ {"label":".", "x":13.75, "y":3},
+ {"label":"Shift", "x":14.75, "y":3, "w":2.25},
+ {"label":"Alt", "x":0, "y":4, "w":1.25},
+ {"label":"'", "x":1.25, "y":4},
+ {"label":"-", "x":2.25, "y":4},
+ {"label":"=", "x":3.25, "y":4},
+ {"label":"layer", "x":4.25, "y":4.33, "w":1.25},
+ {"label":"GUI", "x":5.5, "y":4.67},
+ {"label":"Space", "x":6.5, "y":5},
+ {"label":"Enter", "x":9.5, "y":5},
+ {"label":"Del", "x":10.5, "y":4.67},
+ {"label":"layer", "x":11.5, "y":4.33, "w":1.25},
+ {"label":"\u2190", "x":12.75, "y":4},
+ {"label":"\u2193", "x":13.75, "y":4},
+ {"label":"\u2191", "x":14.75, "y":4},
+ {"label":"\u2192", "x":15.75, "y":4, "w":1.25}
+ ]
+ }
+ }
+}
diff --git a/keyboards/kudox/rev2/keymaps/default/config.h b/keyboards/kudox/rev2/keymaps/default/config.h
new file mode 100644
index 000000000000..f5bf85cca0ab
--- /dev/null
+++ b/keyboards/kudox/rev2/keymaps/default/config.h
@@ -0,0 +1,17 @@
+/* Copyright 2019 Kumao Kobo
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+#pragma once
diff --git a/keyboards/kudox/rev2/keymaps/default/keymap.c b/keyboards/kudox/rev2/keymaps/default/keymap.c
new file mode 100644
index 000000000000..138a725a8cc5
--- /dev/null
+++ b/keyboards/kudox/rev2/keymaps/default/keymap.c
@@ -0,0 +1,49 @@
+#include QMK_KEYBOARD_H
+
+// Each layer gets a name for readability, which is then used in the keymap matrix below.
+// The underscores don't mean anything - you can have a layer called STUFF or any other name.
+// Layer names don't all need to be of the same length, obviously, and you can also skip them
+// entirely and just use numbers.
+#define _QWERTY 0
+#define _SYMB 1
+
+// Shortcut to make keymap more readable
+#define SYM_L MO(_SYMB)
+
+#define KC_ALES LALT_T(KC_ESC)
+
+#define KC_RGENT MT(KC_RGUI, KC_ENT)
+
+#define KC_L1SYM LT(_SYMB, KC_LANG1)
+#define KC_L2SYM LT(_SYMB, KC_LANG2)
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+ [_QWERTY] = LAYOUT(
+ //┌────────┬────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┐
+ KC_ESC ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_GRV , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_MINS ,KC_BSPC ,
+ //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤
+ KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_L2SYM, KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_SLSH ,KC_BSLS ,
+ //├────────┼────────┼────────┼────────┼────────┼────────┼────────┘ └────────┼────────┼────────┼────────┼────────┼────────┼────────┤
+ KC_LCTL ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G , KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,KC_ENT ,
+ //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
+ KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B , KC_L1SYM,KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_RSFT ,
+ //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┴────────┼────────┼────────┼────────┤
+ KC_ALES ,KC_QUOT ,KC_MINS ,KC_EQL ,KC_ENT ,KC_LGUI ,KC_SPC , KC_RGENT,KC_DEL ,SYM_L ,KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT
+ //└────────┴────────┴────────┴────────┴────────┴────────┴────────┘ └────────┴────────┴────────┴────────┴────────┴────────┴────────┘
+ ),
+
+ [_SYMB] = LAYOUT(
+ //┌────────┬────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┐
+ KC_ESC ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,_______ , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,
+ //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤
+ _______ ,KC_DQUO ,KC_QUOT ,KC_GRV ,KC_ASTR ,KC_PLUS ,KC_EQL , KC_LPRN ,KC_RPRN ,KC_PIPE ,KC_ASTR ,KC_TILD ,KC_CIRC ,KC_JYEN ,
+ //├────────┼────────┼────────┼────────┼────────┼────────┼────────┘ └────────┼────────┼────────┼────────┼────────┼────────┼────────┤
+ _______ ,KC_AT ,KC_COLN ,KC_GRV ,_______ ,KC_MINS , KC_LBRC ,KC_RBRC ,KC_DOT ,KC_SLSH ,KC_MINS ,_______ ,
+ //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
+ _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,KC_DOT ,KC_SLSH , _______ ,KC_LCBR ,KC_RCBR ,KC_DOT ,KC_SLSH ,_______ ,
+ //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┴────────┼────────┼────────┼────────┤
+ _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,KC_LT ,KC_UNDS ,KC_CIRC ,KC_GT
+ //└────────┴────────┴────────┴────────┴────────┴────────┴────────┘ └────────┴────────┴────────┴────────┴────────┴────────┴────────┘
+ )
+};
diff --git a/keyboards/kudox/rev2/keymaps/default/readme.md b/keyboards/kudox/rev2/keymaps/default/readme.md
new file mode 100644
index 000000000000..9bc4ca505136
--- /dev/null
+++ b/keyboards/kudox/rev2/keymaps/default/readme.md
@@ -0,0 +1,3 @@
+# The default keymap for Kudox Keyboard Rev2.0
+
+Left-06 key and Right-06 key are different between Rev1.0 and Rev2.0.
diff --git a/keyboards/kudox/rev2/keymaps/jis/config.h b/keyboards/kudox/rev2/keymaps/jis/config.h
new file mode 100644
index 000000000000..f5bf85cca0ab
--- /dev/null
+++ b/keyboards/kudox/rev2/keymaps/jis/config.h
@@ -0,0 +1,17 @@
+/* Copyright 2019 Kumao Kobo
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+#pragma once
diff --git a/keyboards/kudox/rev2/keymaps/jis/keymap.c b/keyboards/kudox/rev2/keymaps/jis/keymap.c
new file mode 100644
index 000000000000..c78cea2331b4
--- /dev/null
+++ b/keyboards/kudox/rev2/keymaps/jis/keymap.c
@@ -0,0 +1,48 @@
+#include QMK_KEYBOARD_H
+#include"keymap_jp.h"
+
+// Each layer gets a name for readability, which is then used in the keymap matrix below.
+// The underscores don't mean anything - you can have a layer called STUFF or any other name.
+// Layer names don't all need to be of the same length, obviously, and you can also skip them
+// entirely and just use numbers.
+#define _QWERTY 0
+#define _SYMB 1
+
+// Shortcut to make keymap more readable
+#define SYM_L MO(_SYMB)
+
+#define KC_ALES LALT_T(KC_ESC)
+
+#define KC_L1SYM LT(_SYMB, KC_LANG1)
+#define KC_L2SYM LT(_SYMB, KC_LANG2)
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+[_QWERTY] = LAYOUT(
+ //┌────────┬────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┐
+ KC_GRV ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_ESC , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_MINS ,KC_BSPC ,
+ //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤
+ KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_LANG2, KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,JP_AT ,JP_COLN ,
+ //├────────┼────────┼────────┼────────┼────────┼────────┼────────┘ └────────┼────────┼────────┼────────┼────────┼────────┼────────┤
+ KC_LCTL ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G , KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,KC_ENT ,
+ //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
+ KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B , KC_UP ,KC_N ,KC_M ,KC_SLSH ,JP_UNDS ,KC_RSFT ,
+ //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┴────────┼────────┼────────┼────────┤
+ KC_ALES ,KC_LGUI ,KC_LALT ,KC_DEL ,KC_L2SYM,KC_SPC ,KC_ENT , KC_LEFT ,KC_DOWN ,KC_RGHT ,KC_COMM ,KC_DOT ,KC_L1SYM,JP_BSLS
+ //└────────┴────────┴────────┴────────┴────────┴────────┴────────┘ └────────┴────────┴────────┴────────┴────────┴────────┴────────┘
+ ),
+
+ [_SYMB] = LAYOUT(
+ //┌────────┬────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┐
+ KC_ESC ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,_______ , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,
+ //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤
+ _______ ,JP_LPRN ,JP_RPRN ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ , JP_HASH ,JP_DLR ,JP_PERC ,JP_PLUS ,KC_MINS ,JP_CIRC ,JP_YEN ,
+ //├────────┼────────┼────────┼────────┼────────┼────────┼────────┘ └────────┼────────┼────────┼────────┼────────┼────────┼────────┤
+ _______ ,JP_LBRC ,JP_RBRC ,XXXXXXX ,XXXXXXX ,XXXXXXX , JP_AMPR ,KC_SLSH ,JP_ASTR ,KC_SCLN ,JP_COLN ,_______ ,
+ //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
+ _______ ,JP_LCBR ,JP_RCBR ,XXXXXXX ,XXXXXXX ,XXXXXXX , KC_VOLU ,XXXXXXX ,XXXXXXX ,KC_LT ,KC_GT ,_______ ,
+ //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┴────────┼────────┼────────┼────────┤
+ _______ ,_______ ,KC_LT ,KC_GT ,KC_LANG2,_______ ,_______ , KC_MUTE ,KC_VOLD ,KC_LANG1,_______ ,_______ ,_______ ,KC_DEL
+ //└────────┴────────┴────────┴────────┴────────┴────────┴────────┘ └────────┴────────┴────────┴────────┴────────┴────────┴────────┘
+ )
+};
diff --git a/keyboards/kudox/rev2/keymaps/jis/readme.md b/keyboards/kudox/rev2/keymaps/jis/readme.md
new file mode 100644
index 000000000000..ddf27339d1f8
--- /dev/null
+++ b/keyboards/kudox/rev2/keymaps/jis/readme.md
@@ -0,0 +1,3 @@
+# The JIS keymap for Kudox Keyboard Rev2.0
+
+Left-06 key and Right-06 key are different between Rev1.0 and Rev2.0.
diff --git a/keyboards/kudox/rev2/keymaps/jis/rules.mk b/keyboards/kudox/rev2/keymaps/jis/rules.mk
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/keyboards/kudox/rev2/rev2.c b/keyboards/kudox/rev2/rev2.c
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/keyboards/kudox/rev2/rev2.h b/keyboards/kudox/rev2/rev2.h
new file mode 100644
index 000000000000..dcc745ddb799
--- /dev/null
+++ b/keyboards/kudox/rev2/rev2.h
@@ -0,0 +1,23 @@
+#pragma once
+
+#include "quantum.h"
+
+#define LAYOUT( \
+ L00, L01, L02, L03, L04, L05, L06, R06, R05, R04, R03, R02, R01, R00, \
+ L10, L11, L12, L13, L14, L15, L16, R16, R15, R14, R13, R12, R11, R10, \
+ L20, L21, L22, L23, L24, L25, R25, R24, R23, R22, R21, R20, \
+ L30, L31, L32, L33, L34, L35, R35, R34, R33, R32, R31, R30, \
+ L40, L41, L42, L43, L44, L45, L46, R46, R45, R44, R43, R42, R41, R40 \
+) \
+{ \
+ { L00, L01, L02, L03, L04, L05, L06 }, \
+ { L10, L11, L12, L13, L14, L15, L16 }, \
+ { L20, L21, L22, L23, L24, L25 }, \
+ { L30, L31, L32, L33, L34, L35 }, \
+ { L40, L41, L42, L43, L44, L45, L46 }, \
+ { R00, R01, R02, R03, R04, R05, R06 }, \
+ { R10, R11, R12, R13, R14, R15, R16 }, \
+ { R20, R21, R22, R23, R24, R25 }, \
+ { R30, R31, R32, R33, R34, R35 }, \
+ { R40, R41, R42, R43, R44, R45, R46 } \
+}
diff --git a/keyboards/kudox/rev2/rules.mk b/keyboards/kudox/rev2/rules.mk
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/keyboards/kudox/rules.mk b/keyboards/kudox/rules.mk
index 68a434feb12c..5d8c2b2bb381 100644
--- a/keyboards/kudox/rules.mk
+++ b/keyboards/kudox/rules.mk
@@ -33,4 +33,4 @@ RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
SPLIT_KEYBOARD = yes
-DEFAULT_FOLDER = kudox/rev1
+DEFAULT_FOLDER = kudox/rev2
From 8b832c494cd6d50e4f9c8384ce54733308eda95f Mon Sep 17 00:00:00 2001
From: Tsan-Kuang Lee <1425438+tsankuanglee@users.noreply.github.com>
Date: Tue, 5 Nov 2019 01:14:15 -0600
Subject: [PATCH 15/16] [Keyboard] add keymap beautifier for Ergodox EZ (#4393)
* add beautifier
* add example
* Update keyboards/ergodox_ez/util/keymap_beautifier.py
Co-Authored-By: tsankuanglee <1425438+tsankuanglee@users.noreply.github.com>
* Update keyboards/ergodox_ez/util/keymap_beautifier.py
Co-Authored-By: tsankuanglee <1425438+tsankuanglee@users.noreply.github.com>
* works for regular layout
* all planned features implemented
* add justification switch
* docker support
* doc and starting script
* clean up the container after done
---
keyboards/ergodox_ez/util/compile_keymap.py | 0
.../util/keymap_beautifier/Dockerfile | 8 +
.../keymap_beautifier/KeymapBeautifier.py | 399 ++++++++++++++++++
.../util/keymap_beautifier/README.md | 139 ++++++
.../util/keymap_beautifier/docker_run.sh | 3 +
.../util/keymap_beautifier/requirements.txt | 1 +
keyboards/ergodox_ez/util/readme.md | 8 +
7 files changed, 558 insertions(+)
mode change 100644 => 100755 keyboards/ergodox_ez/util/compile_keymap.py
create mode 100644 keyboards/ergodox_ez/util/keymap_beautifier/Dockerfile
create mode 100755 keyboards/ergodox_ez/util/keymap_beautifier/KeymapBeautifier.py
create mode 100644 keyboards/ergodox_ez/util/keymap_beautifier/README.md
create mode 100755 keyboards/ergodox_ez/util/keymap_beautifier/docker_run.sh
create mode 100644 keyboards/ergodox_ez/util/keymap_beautifier/requirements.txt
diff --git a/keyboards/ergodox_ez/util/compile_keymap.py b/keyboards/ergodox_ez/util/compile_keymap.py
old mode 100644
new mode 100755
diff --git a/keyboards/ergodox_ez/util/keymap_beautifier/Dockerfile b/keyboards/ergodox_ez/util/keymap_beautifier/Dockerfile
new file mode 100644
index 000000000000..fbee1d0df8b4
--- /dev/null
+++ b/keyboards/ergodox_ez/util/keymap_beautifier/Dockerfile
@@ -0,0 +1,8 @@
+FROM python:3.7.4-alpine3.10
+
+WORKDIR /usr/src/app
+COPY requirements.txt ./
+RUN pip install --no-cache-dir -r requirements.txt
+COPY ./KeymapBeautifier.py ./KeymapBeautifier.py
+
+CMD [ "python", "./KeymapBeautifier.py", "-h" ]
diff --git a/keyboards/ergodox_ez/util/keymap_beautifier/KeymapBeautifier.py b/keyboards/ergodox_ez/util/keymap_beautifier/KeymapBeautifier.py
new file mode 100755
index 000000000000..b96e4c96cde8
--- /dev/null
+++ b/keyboards/ergodox_ez/util/keymap_beautifier/KeymapBeautifier.py
@@ -0,0 +1,399 @@
+#!/usr/bin/env python
+
+import argparse
+import pycparser
+import re
+
+class KeymapBeautifier:
+ justify_toward_center = False
+ filename_in = None
+ filename_out = None
+ output_layout = None
+ output = None
+
+ column_max_widths = {}
+
+ KEY_ALIASES = {
+ "KC_TRANSPARENT": "_______",
+ "KC_TRNS": "_______",
+ "KC_NO": "XXXXXXX",
+ }
+ KEYMAP_START = 'const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {\n'
+ KEYMAP_END = '};\n'
+ KEYMAP_START_REPLACEMENT = "const int keymaps[]={\n"
+ KEY_CHART = """
+ /*
+ * ,--------------------------------------------------. ,--------------------------------------------------.
+ * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | | 38 | 39 | 40 | 41 | 42 | 43 | 44 |
+ * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------|
+ * | 7 | 8 | 9 | 10 | 11 | 12 | 13 | | 45 | 46 | 47 | 48 | 49 | 50 | 51 |
+ * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
+ * | 14 | 15 | 16 | 17 | 18 | 19 |------| |------| 52 | 53 | 54 | 55 | 56 | 57 |
+ * |--------+------+------+------+------+------| 26 | | 58 |------+------+------+------+------+--------|
+ * | 20 | 21 | 22 | 23 | 24 | 25 | | | | 59 | 60 | 61 | 62 | 63 | 64 |
+ * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
+ * | 27 | 28 | 29 | 30 | 31 | | 65 | 66 | 67 | 68 | 69 |
+ * `----------------------------------' `----------------------------------'
+ * ,-------------. ,-------------.
+ * | 32 | 33 | | 70 | 71 |
+ * ,------+------+------| |------+------+------.
+ * | | | 34 | | 72 | | |
+ * | 35 | 36 |------| |------| 74 | 75 |
+ * | | | 37 | | 73 | | |
+ * `--------------------' `--------------------'
+ */
+"""
+ KEY_COORDINATES = {
+ 'LAYOUT_ergodox': [
+ # left hand
+ (0,0), (0,1), (0,2), (0,3), (0,4), (0,5), (0,6),
+ (1,0), (1,1), (1,2), (1,3), (1,4), (1,5), (1,6),
+ (2,0), (2,1), (2,2), (2,3), (2,4), (2,5),
+ (3,0), (3,1), (3,2), (3,3), (3,4), (3,5), (3,6),
+ (4,0), (4,1), (4,2), (4,3), (4,4),
+ # left thumb
+ (5,5), (5,6),
+ (6,6),
+ (7,4), (7,5), (7,6),
+ # right hand
+ (8,0), (8,1), (8,2), (8,3), (8,4), (8,5), (8,6),
+ (9,0), (9,1), (9,2), (9,3), (9,4), (9,5), (9,6),
+ (10,1), (10,2), (10,3), (10,4), (10,5), (10,6),
+ (11,0), (11,1), (11,2), (11,3), (11,4), (11,5), (11,6),
+ (12,2), (12,3), (12,4), (12,5), (12,6),
+ # right thumb
+ (13,0), (13,1),
+ (14,0),
+ (15,0), (15,1), (15,2)
+ ],
+ 'LAYOUT_ergodox_pretty': [
+ # left hand and right hand
+ (0,0), (0,1), (0,2), (0,3), (0,4), (0,5), (0,6), (0,7), (0,8), (0,9), (0,10), (0,11), (0,12), (0,13),
+ (1,0), (1,1), (1,2), (1,3), (1,4), (1,5), (1,6), (1,7), (1,8), (1,9), (1,10), (1,11), (1,12), (1,13),
+ (2,0), (2,1), (2,2), (2,3), (2,4), (2,5), (2,8), (2,9), (2,10), (2,11), (2,12), (2,13),
+ (3,0), (3,1), (3,2), (3,3), (3,4), (3,5), (3,6), (3,7), (3,8), (3,9), (3,10), (3,11), (3,12), (3,13),
+ (4,0), (4,1), (4,2), (4,3), (4,4), (4,9), (4,10), (4,11), (4,12), (4,13),
+
+ # left thumb and right thumb
+ (5,5), (5,6), (5,7), (5,8),
+ (6,6), (6,7),
+ (7,4), (7,5), (7,6), (7,7), (7,8), (7,9)
+ ],
+ }
+ current_converted_KEY_COORDINATES = []
+
+ # each column is aligned within each group (tuples of row indexes are inclusive)
+ KEY_ROW_GROUPS = {
+ 'LAYOUT_ergodox': [(0,4),(5,7),(8,12),(13,15)],
+ 'LAYOUT_ergodox_pretty': [(0,7)],
+ #'LAYOUT_ergodox_pretty': [(0,5),(6,7)],
+ #'LAYOUT_ergodox_pretty': [(0,3),(4,4),(5,7)],
+ #'LAYOUT_ergodox_pretty': [(0,4),(5,7)],
+ }
+
+
+ INDEX_CONVERSTION_LAYOUT_ergodox_pretty_to_LAYOUT_ergodox = [
+ 0, 1, 2, 3, 4, 5, 6, 38,39,40,41,42,43,44,
+ 7, 8, 9,10,11,12,13, 45,46,47,48,49,50,51,
+ 14,15,16,17,18,19, 52,53,54,55,56,57,
+ 20,21,22,23,24,25,26, 58,59,60,61,62,63,64,
+ 27,28,29,30,31, 65,66,67,68,69,
+ 32,33, 70,71,
+ 34, 72,
+ 35,36,37, 73,74,75,
+ ]
+
+
+ def index_conversion_map_reversed(self, conversion_map):
+ return [conversion_map.index(i) for i in range(len(conversion_map))]
+
+
+ def __init__(self, source_code = "", output_layout="LAYOUT_ergodox", justify_toward_center = False):
+ self.output_layout = output_layout
+ self.justify_toward_center = justify_toward_center
+ # determine the conversion map
+ #if input_layout == self.output_layout:
+ # conversion_map = [i for i in range(len(self.INDEX_CONVERSTION_LAYOUT_ergodox_pretty_to_LAYOUT_ergodox))]
+ #conversion_map = self.INDEX_CONVERSTION_LAYOUT_ergodox_pretty_to_LAYOUT_ergodox
+ if self.output_layout == "LAYOUT_ergodox_pretty":
+ index_conversion_map = self.index_conversion_map_reversed(self.INDEX_CONVERSTION_LAYOUT_ergodox_pretty_to_LAYOUT_ergodox)
+ else:
+ index_conversion_map = list(range(len(self.INDEX_CONVERSTION_LAYOUT_ergodox_pretty_to_LAYOUT_ergodox)))
+ self.current_converted_KEY_COORDINATES = [
+ self.KEY_COORDINATES[self.output_layout][index_conversion_map[i]]
+ for i in range(len(self.KEY_COORDINATES[self.output_layout]))
+ ]
+
+ self.output = self.beautify_source_code(source_code)
+
+ def beautify_source_code(self, source_code):
+ # to keep it simple for the parser, we only use the parser to parse the key definition part
+ src = {
+ "before": [],
+ "keys": [],
+ "after": [],
+ }
+
+ current_section = "before"
+ for line in source_code.splitlines(True):
+ if current_section == 'before' and line == self.KEYMAP_START:
+ src[current_section].append("\n")
+ current_section = 'keys'
+ src[current_section].append(self.KEYMAP_START_REPLACEMENT)
+ continue
+ elif current_section == 'keys' and line == self.KEYMAP_END:
+ src[current_section].append(self.KEYMAP_END)
+ current_section = 'after'
+ continue
+ src[current_section].append(line)
+ output_lines = src['before'] + self.beautify_keys_section("".join(src['keys'])) + src['after']
+ return "".join(output_lines)
+
+ def beautify_keys_section(self, src):
+ parsed = self.parser(src)
+ layer_output = []
+
+ keymap = parsed.children()[0]
+ layers = keymap[1]
+ for layer in layers.init.exprs:
+ input_layout = layer.expr.name.name
+
+ key_symbols = self.layer_expr(layer)
+ # re-order keys from input_layout to regular layout
+ if input_layout == "LAYOUT_ergodox_pretty":
+ key_symbols = [key_symbols[i] for i in self.index_conversion_map_reversed(self.INDEX_CONVERSTION_LAYOUT_ergodox_pretty_to_LAYOUT_ergodox)]
+
+ padded_key_symbols = self.pad_key_symbols(key_symbols, input_layout)
+ current_pretty_output_layer = self.pretty_output_layer(layer.name[0].value, padded_key_symbols)
+ # strip trailing spaces from padding
+ layer_output.append(re.sub(r" +\n", "\n", current_pretty_output_layer))
+
+ return [self.KEYMAP_START + "\n",
+ self.KEY_CHART + "\n",
+ ",\n\n".join(layer_output) + "\n",
+ self.KEYMAP_END + "\n"]
+
+ def get_row_group(self, row):
+ for low, high in self.KEY_ROW_GROUPS[self.output_layout]:
+ if low <= row <= high:
+ return (low, high)
+ raise Exception("Cannot find row groups in KEY_ROW_GROUPS")
+
+
+ def calculate_column_max_widths(self, key_symbols):
+ # calculate the max width for each column
+ self.column_max_widths = {}
+ for i in range(len(key_symbols)):
+ row_index, column_index = self.current_converted_KEY_COORDINATES[i]
+ row_group = self.get_row_group(row_index)
+ if (row_group, column_index) in self.column_max_widths:
+ self.column_max_widths[(row_group, column_index)] = max(self.column_max_widths[(row_group, column_index)], len(key_symbols[i]))
+ else:
+ self.column_max_widths[(row_group, column_index)] = len(key_symbols[i])
+
+
+ def pad_key_symbols(self, key_symbols, input_layout, just='left'):
+ self.calculate_column_max_widths(key_symbols)
+
+ padded_key_symbols = []
+ # pad each key symbol
+ for i in range(len(key_symbols)):
+ key = key_symbols[i]
+ # look up column coordinate to determine number of spaces to pad
+ row_index, column_index = self.current_converted_KEY_COORDINATES[i]
+ row_group = self.get_row_group(row_index)
+ if just == 'left':
+ padded_key_symbols.append(key.ljust(self.column_max_widths[(row_group, column_index)]))
+ else:
+ padded_key_symbols.append(key.rjust(self.column_max_widths[(row_group, column_index)]))
+ return padded_key_symbols
+
+
+ layer_keys_pointer = 0
+ layer_keys = None
+ def grab_next_n_columns(self, n_columns, input_layout, layer_keys = None, from_beginning = False):
+ if layer_keys:
+ self.layer_keys = layer_keys
+ if from_beginning:
+ self.layer_keys_pointer = 0
+
+ begin = self.layer_keys_pointer
+ end = begin + n_columns
+ return self.layer_keys[self.layer_keys_pointer-n_keys:self.layer_keys_pointer]
+
+ key_coordinates_counter = 0
+ def get_padded_line(self, source_keys, key_from, key_to, just="left"):
+ if just == "right":
+ keys = [k.strip().rjust(len(k)) for k in source_keys[key_from:key_to]]
+ else:
+ keys = [k for k in source_keys[key_from:key_to]]
+
+ from_row, from_column = self.KEY_COORDINATES[self.output_layout][self.key_coordinates_counter]
+ row_group = self.get_row_group(from_row)
+ self.key_coordinates_counter += key_to - key_from
+ columns_before_key_from = sorted([col for row, col in self.KEY_COORDINATES[self.output_layout] if row == from_row and col < from_column])
+ # figure out which columns in this row needs padding; only pad empty columns to the right of an existing column
+ columns_to_pad = { c: True for c in range(from_column) }
+ if columns_before_key_from:
+ for c in range(max(columns_before_key_from)+1):
+ columns_to_pad[c] = False
+
+ # for rows with fewer columns that don't start with column 0, we need to insert leading spaces
+ spaces = 0
+ for c, v in columns_to_pad.items():
+ if not v:
+ continue
+ if (row_group,c) in self.column_max_widths:
+ spaces += self.column_max_widths[(row_group,c)] + len(", ")
+ else:
+ spaces += 0
+ return " " * spaces + ", ".join(keys) + ","
+
+ def pretty_output_layer(self, layer, keys):
+ self.key_coordinates_counter = 0
+ if self.output_layout == "LAYOUT_ergodox":
+ formatted_key_symbols = """
+// left hand
+
+{}
+{}
+{}
+{}
+{}
+
+// left thumb
+
+{}
+{}
+{}
+
+// right hand
+
+{}
+{}
+{}
+{}
+{}
+
+// right thumb
+
+{}
+{}
+{}
+""".format(
+ # left hand
+ self.get_padded_line(keys, 0, 7, just="left"),
+ self.get_padded_line(keys, 7, 14, just="left"),
+ self.get_padded_line(keys, 14, 20, just="left"),
+ self.get_padded_line(keys, 20, 27, just="left"),
+ self.get_padded_line(keys, 27, 32, just="left"),
+ # left thumb
+ self.get_padded_line(keys, 32, 34, just="left"),
+ self.get_padded_line(keys, 34, 35, just="left"),
+ self.get_padded_line(keys, 35, 38, just="left"),
+ # right hand
+ self.get_padded_line(keys, 38, 45, just="left"),
+ self.get_padded_line(keys, 45, 52, just="left"),
+ self.get_padded_line(keys, 52, 58, just="left"),
+ self.get_padded_line(keys, 58, 65, just="left"),
+ self.get_padded_line(keys, 65, 70, just="left"),
+ # right thumb
+ self.get_padded_line(keys, 70, 72, just="left"),
+ self.get_padded_line(keys, 72, 73, just="left"),
+ self.get_padded_line(keys, 73, 76, just="left"),
+ )
+ elif self.output_layout == "LAYOUT_ergodox_pretty":
+ left_half_justification = "right" if self.justify_toward_center else "left"
+ formatted_key_symbols = """
+{} {}
+{} {}
+{} {}
+{} {}
+{} {}
+
+{} {}
+{} {}
+{} {}
+""".format(
+ self.get_padded_line(keys, 0, 7, just=left_half_justification), self.get_padded_line(keys, 38, 45, just="left"),
+ self.get_padded_line(keys, 7, 14, just=left_half_justification), self.get_padded_line(keys, 45, 52, just="left"),
+ self.get_padded_line(keys, 14, 20, just=left_half_justification), self.get_padded_line(keys, 52, 58, just="left"),
+ self.get_padded_line(keys, 20, 27, just=left_half_justification), self.get_padded_line(keys, 58, 65, just="left"),
+ self.get_padded_line(keys, 27, 32, just=left_half_justification), self.get_padded_line(keys, 65, 70, just="left"),
+
+ self.get_padded_line(keys, 32, 34, just=left_half_justification), self.get_padded_line(keys, 70, 72, just="left"),
+ self.get_padded_line(keys, 34, 35, just=left_half_justification), self.get_padded_line(keys, 72, 73, just="left"),
+ self.get_padded_line(keys, 35, 38, just=left_half_justification), self.get_padded_line(keys, 73, 76, just="left"),
+
+ )
+ else:
+ formatted_key_symbols = ""
+
+ # rid of the trailing comma
+ formatted_key_symbols = formatted_key_symbols[0:len(formatted_key_symbols)-2] + "\n"
+ s = "[{}] = {}({})".format(layer, self.output_layout, formatted_key_symbols)
+ return s
+
+ # helper functions for pycparser
+ def parser(self, src):
+ src = self.comment_remover(src)
+ return pycparser.CParser().parse(src)
+ def comment_remover(self, text):
+ # remove comments since pycparser cannot deal with them
+ # credit: https://stackoverflow.com/a/241506
+ def replacer(match):
+ s = match.group(0)
+ if s.startswith('/'):
+ return " " # note: a space and not an empty string
+ else:
+ return s
+ pattern = re.compile(
+ r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"',
+ re.DOTALL | re.MULTILINE
+ )
+ return re.sub(pattern, replacer, text)
+
+ def function_expr(self, f):
+ name = f.name.name
+ args = []
+ for arg in f.args.exprs:
+ if type(arg) is pycparser.c_ast.Constant:
+ args.append(arg.value)
+ elif type(arg) is pycparser.c_ast.ID:
+ args.append(arg.name)
+ return "{}({})".format(name, ",".join(args))
+
+ def key_expr(self, raw):
+ if type(raw) is pycparser.c_ast.ID:
+ if raw.name in self.KEY_ALIASES:
+ return self.KEY_ALIASES[raw.name]
+ return raw.name
+ elif type(raw) is pycparser.c_ast.FuncCall:
+ return self.function_expr(raw)
+
+ def layer_expr(self, layer):
+ transformed = [self.key_expr(k) for k in layer.expr.args.exprs]
+ return transformed
+
+
+if __name__ == "__main__":
+
+ parser = argparse.ArgumentParser(description="Beautify keymap.c downloaded from ErgoDox-Ez Configurator for easier customization.")
+ parser.add_argument("input_filename", help="input file: c source code file that has the layer keymaps")
+ parser.add_argument("-o", "--output-filename", help="output file: beautified c filename. If not given, output to STDOUT.")
+ parser.add_argument("-p", "--pretty-output-layout", action="store_true", help="use LAYOUT_ergodox_pretty for output instead of LAYOUT_ergodox")
+ parser.add_argument("-c", "--justify-toward-center", action="store_true", help="for LAYOUT_ergodox_pretty, align right for the left half, and align left for the right half. Default is align left for both halves.")
+ args = parser.parse_args()
+ if args.pretty_output_layout:
+ output_layout="LAYOUT_ergodox_pretty"
+ else:
+ output_layout="LAYOUT_ergodox"
+ with open(args.input_filename) as f:
+ source_code = f.read()
+ result = KeymapBeautifier(source_code, output_layout=output_layout, justify_toward_center=args.justify_toward_center).output
+ if args.output_filename:
+ with open(args.output_filename, "w") as f:
+ f.write(result)
+ else:
+ print(result)
+
diff --git a/keyboards/ergodox_ez/util/keymap_beautifier/README.md b/keyboards/ergodox_ez/util/keymap_beautifier/README.md
new file mode 100644
index 000000000000..bd3d125a6d42
--- /dev/null
+++ b/keyboards/ergodox_ez/util/keymap_beautifier/README.md
@@ -0,0 +1,139 @@
+# keymap_beautifier.py
+
+## About
+This Python 3 script, by [Tsan-Kuang Lee](https://github.com/tsankuanglee) takes the keymap.c downloaded from [ErgoDox EZ Configurator](https://configure.ergodox-ez.com/) and beautifies it for easier customization, allowing one to quickly draft a layout to build upon.
+
+## Features
+For example, the original `keymap.c` looks like
+
+```
+[0] = LAYOUT_ergodox(KC_EQUAL,KC_1,KC_2,KC_3,KC_4,KC_5,LCTL(KC_MINUS),KC_DELETE,KC_Q,KC_W,KC_E,KC_R,KC_T,KC_LBRACKET,KC_BSPACE,KC_A,KC_S,KC_D,KC_F,KC_G,KC_LSPO,CTL_T(KC_Z),KC_X,KC_C,KC_V,KC_B,ALL_T(KC_NO),LT(1,KC_GRAVE),KC_QUOTE,LALT(KC_LSHIFT),KC_LEFT,KC_RIGHT,ALT_T(KC_APPLICATION),KC_LGUI,KC_HOME,KC_SPACE,KC_UNDS,KC_END,LCTL(KC_EQUAL),KC_6,KC_7,KC_8,KC_9,KC_0,KC_MINUS,KC_RBRACKET,KC_Y,KC_U,KC_I,KC_O,KC_P,KC_BSLASH,KC_H,ALT_T(KC_J),KC_K,KC_L,LT(2,KC_SCOLON),GUI_T(KC_QUOTE),MEH_T(KC_NO),KC_N,KC_M,KC_COMMA,KC_DOT,CTL_T(KC_SLASH),KC_RSPC,KC_UP,KC_DOWN,KC_LBRACKET,KC_RBRACKET,TT(1),KC_LALT,CTL_T(KC_ESCAPE),KC_PGUP,KC_PGDOWN,LT(1,KC_TAB),KC_ENTER),
+```
+
+The beautifier parses it and outputs:
+
+```
+[0] = LAYOUT_ergodox(
+// left hand
+
+KC_EQUAL , KC_1 , KC_2 , KC_3 , KC_4 , KC_5, LCTL(KC_MINUS),
+KC_DELETE , KC_Q , KC_W , KC_E , KC_R , KC_T, KC_LBRACKET ,
+KC_BSPACE , KC_A , KC_S , KC_D , KC_F , KC_G,
+KC_LSPO , CTL_T(KC_Z), KC_X , KC_C , KC_V , KC_B, ALL_T(KC_NO) ,
+LT(1,KC_GRAVE), KC_QUOTE , LALT(KC_LSHIFT), KC_LEFT, KC_RIGHT,
+
+// left thumb
+
+ ALT_T(KC_APPLICATION), KC_LGUI,
+ KC_HOME,
+KC_SPACE, KC_UNDS , KC_END ,
+
+// right hand
+
+LCTL(KC_EQUAL), KC_6, KC_7 , KC_8 , KC_9 , KC_0 , KC_MINUS ,
+KC_RBRACKET , KC_Y, KC_U , KC_I , KC_O , KC_P , KC_BSLASH ,
+ KC_H, ALT_T(KC_J), KC_K , KC_L , LT(2,KC_SCOLON), GUI_T(KC_QUOTE),
+MEH_T(KC_NO) , KC_N, KC_M , KC_COMMA, KC_DOT , CTL_T(KC_SLASH), KC_RSPC ,
+ KC_UP , KC_DOWN , KC_LBRACKET, KC_RBRACKET , TT(1) ,
+
+// right thumb
+
+KC_LALT , CTL_T(KC_ESCAPE),
+KC_PGUP ,
+KC_PGDOWN, LT(1,KC_TAB) , KC_ENTER
+)
+```
+
+Optionally, it can also render [LAYOUT_ergodox_pretty](https://github.com/qmk/qmk_firmware/blob/ee700b2e831067bdb7584425569b61bc6329247b/keyboards/ergodox_ez/keymaps/bpruitt-goddard/keymap.c#L49-L57):
+```
+[0] = LAYOUT_ergodox_pretty(
+ KC_ESCAPE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEAD, KC_LEAD, KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_BSPACE ,
+ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_HYPR, KC_HYPR, KC_Y , KC_U , KC_I , KC_O , KC_P , KC_BSLASH ,
+ KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H , KC_J , KC_K , KC_L , KC_SCOLON , KC_QUOTE ,
+ KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, SH_MON, SH_MON , KC_N , KC_M , KC_COMMA , KC_DOT , KC_SLASH , KC_RSHIFT ,
+LT(6,KC_NO), LT(7,KC_NO), KC_LCTRL, KC_LGUI, KC_LALT, ALGR_T(KC_MINUS), RGUI_T(KC_EQUAL), RCTL_T(KC_LBRACKET), LT(10,KC_RBRACKET), LT(6,KC_APPLICATION),
+
+ LT(6,KC_GRAVE), MEH_T(KC_NO), KC_LEFT, KC_RIGHT ,
+ LT(10,KC_DELETE), KC_UP ,
+ KC_SPACE, LT(8,KC_ENTER), LT(7,KC_BSPACE), KC_DOWN, LT(7,KC_SPACE), LT(8,KC_ENTER)
+)
+```
+
+We can also align everythng t othe left (easier editing in my opinon):
+```
+[0] = LAYOUT_ergodox_pretty(
+KC_ESCAPE , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_LEAD , KC_LEAD, KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_BSPACE ,
+KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_HYPR , KC_HYPR, KC_Y , KC_U , KC_I , KC_O , KC_P , KC_BSLASH ,
+KC_LCTRL , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCOLON , KC_QUOTE ,
+KC_LSHIFT , KC_Z , KC_X , KC_C , KC_V , KC_B , SH_MON , SH_MON , KC_N , KC_M , KC_COMMA , KC_DOT , KC_SLASH , KC_RSHIFT ,
+LT(6,KC_NO), LT(7,KC_NO), KC_LCTRL, KC_LGUI, KC_LALT , ALGR_T(KC_MINUS), RGUI_T(KC_EQUAL), RCTL_T(KC_LBRACKET), LT(10,KC_RBRACKET), LT(6,KC_APPLICATION),
+
+ LT(6,KC_GRAVE), MEH_T(KC_NO) , KC_LEFT, KC_RIGHT ,
+ LT(10,KC_DELETE), KC_UP ,
+ KC_SPACE, LT(8,KC_ENTER), LT(7,KC_BSPACE) , KC_DOWN, LT(7,KC_SPACE), LT(8,KC_ENTER)
+)
+```
+
+## Usage
+
+### With docker
+This is the cleaner way. `Docker` is the only requirement. The program executes within a container that has all dependencies installed.
+
+First build the images. (Run once)
+```
+cd QMK_GIT_REPO_dir/keyboards/ergodox_ez/util/keymap_beautifier
+docker build -t keymapbeautifier:1.0 .
+```
+Run it
+```
+cd QMK_GIT_REPO_dir/keyboards/ergodox_ez/util/keymap_beautifier
+cp PATH_TO_YOUR_C_SOURCE_FILE.c input.c
+./docker_run.sh input.c -p -c -o output.c
+```
+The prettified file is written to `output.c`. See the section Tweaks for non-default settings.
+
+### Without docker
+Requirements:
+* python3 (tested on 3.7.4)
+* python module `pycparser` installed (with `pip install pycparser`)
+
+To run:
+```
+cd QMK_GIT_REPO_dir/keyboards/ergodox_ez/util/keymap_beautifier
+cp PATH_TO_YOUR_C_SOURCE_FILE.c input.c
+./KeymapBeautifier.py input.c -p -c -o output.c
+```
+The prettified file is written to `output.c`. See the section Tweaks for non-default settings.
+
+## Tweaks
+```
+usage: KeymapBeautifier.py [-h] [-o OUTPUT_FILENAME] [-p] [-c] input_filename
+
+Beautify keymap.c downloaded from ErgoDox-Ez Configurator for easier
+customization.
+
+positional arguments:
+ input_filename input file: c source code file that has the layer
+ keymaps
+
+optional arguments:
+ -h, --help show this help message and exit
+ -o OUTPUT_FILENAME, --output-filename OUTPUT_FILENAME
+ output file: beautified c filename. If not given,
+ output to STDOUT.
+ -p, --pretty-output-layout
+ use LAYOUT_ergodox_pretty for output instead of
+ LAYOUT_ergodox
+ -c, --justify-toward-center
+ for LAYOUT_ergodox_pretty, align right for the left
+ half, and align left for the right half. Default is
+ align left for both halves.
+```
+For example,
+```
+./docker_run.sh input.c -p -c -o output.c
+# or if you don't want to use docker:
+#./KeymapBeautifier.py input.c -p -c -o output.c
+```
+will read `input.c`, and produce `output.c` with LAYOUT_ergodox_pretty, and have the key symbols gravitating toward the center.
+
diff --git a/keyboards/ergodox_ez/util/keymap_beautifier/docker_run.sh b/keyboards/ergodox_ez/util/keymap_beautifier/docker_run.sh
new file mode 100755
index 000000000000..1ce43a6dde2e
--- /dev/null
+++ b/keyboards/ergodox_ez/util/keymap_beautifier/docker_run.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+docker run --mount type=bind,source="${PWD}",target=/usr/src/app --name keymapbeautifier --rm keymapbeautifier:1.0 ./KeymapBeautifier.py $*
diff --git a/keyboards/ergodox_ez/util/keymap_beautifier/requirements.txt b/keyboards/ergodox_ez/util/keymap_beautifier/requirements.txt
new file mode 100644
index 000000000000..dc1c9e101ad9
--- /dev/null
+++ b/keyboards/ergodox_ez/util/keymap_beautifier/requirements.txt
@@ -0,0 +1 @@
+pycparser
diff --git a/keyboards/ergodox_ez/util/readme.md b/keyboards/ergodox_ez/util/readme.md
index 26c5e5d99cc7..deb0cad5db19 100644
--- a/keyboards/ergodox_ez/util/readme.md
+++ b/keyboards/ergodox_ez/util/readme.md
@@ -1,3 +1,11 @@
# ErgoDox EZ Utilities
+## compile_keymap.py
+
The Python script in this directory, by [mbarkhau](https://github.com/mbarkhau) allows you to write out a basic ErgoDox EZ keymap using Markdown notation, and then transpile it to C, which you can then compile. It's experimental, but if you're not comfortable using C, it's a nice option.
+
+## keymap_beautifier.py
+
+This Python 3 script, by [Tsan-Kuang Lee](https://github.com/tsankuanglee) takes the keymap.c downloaded from [ErgoDox EZ Configurator](https://configure.ergodox-ez.com/) and beautifies it for easier customization, allowing one to quickly draft a layout to build upon.
+
+See [README.md](./keymap_beautifier/README.md) for this utility for more details.
From fc51a4a1076c5f6f102024f1520e33634bc45dc4 Mon Sep 17 00:00:00 2001
From: fauxpark
Date: Tue, 5 Nov 2019 18:19:21 +1100
Subject: [PATCH 16/16] Fix typo in ARM I2C copyright header (#7264)
---
drivers/arm/i2c_master.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/arm/i2c_master.h b/drivers/arm/i2c_master.h
index a8ed66403a58..efe3909a6610 100644
--- a/drivers/arm/i2c_master.h
+++ b/drivers/arm/i2c_master.h
@@ -1,9 +1,9 @@
/* Copyright 2018 Jack Humbert
* Copyright 2018 Yiancar
*
- * This program is free sofare: you can redistribute it and/or modify
+ * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Sofare Foundation, either version 2 of the License, or
+ * the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,