From 19ecd697570784bff8803edc2f18a8ee75d3d4ce Mon Sep 17 00:00:00 2001 From: Charly Delay <0xcharly@users.noreply.github.com> Date: Fri, 27 Jan 2023 03:43:08 +0900 Subject: [PATCH 01/10] Rename `LAYOUT` macros identifier that contained the keyboard name (#19657) --- keyboards/bastardkb/charybdis/3x5/3x5.h | 2 +- keyboards/bastardkb/charybdis/3x5/info.json | 5 ++++- keyboards/bastardkb/charybdis/3x5/keymaps/bstiq/config.h | 4 ++++ keyboards/bastardkb/charybdis/3x5/keymaps/bstiq/keymap.c | 2 +- .../bastardkb/charybdis/3x5/keymaps/default/keymap.c | 6 +++--- keyboards/bastardkb/charybdis/3x5/keymaps/via/keymap.c | 2 +- keyboards/bastardkb/charybdis/3x6/3x6.h | 2 +- keyboards/bastardkb/charybdis/3x6/info.json | 5 ++++- .../bastardkb/charybdis/3x6/keymaps/default/keymap.c | 6 +++--- keyboards/bastardkb/charybdis/3x6/keymaps/via/keymap.c | 8 ++++---- keyboards/bastardkb/charybdis/4x6/4x6.h | 2 +- keyboards/bastardkb/charybdis/4x6/info.json | 5 ++++- .../bastardkb/charybdis/4x6/keymaps/default/keymap.c | 6 +++--- keyboards/bastardkb/charybdis/4x6/keymaps/via/keymap.c | 8 ++++---- 14 files changed, 38 insertions(+), 25 deletions(-) diff --git a/keyboards/bastardkb/charybdis/3x5/3x5.h b/keyboards/bastardkb/charybdis/3x5/3x5.h index 665fcbeec287..4ea3ef94bb19 100644 --- a/keyboards/bastardkb/charybdis/3x5/3x5.h +++ b/keyboards/bastardkb/charybdis/3x5/3x5.h @@ -21,7 +21,7 @@ #include "charybdis.h" // clang-format off -#define LAYOUT_charybdis_3x5( \ +#define LAYOUT( \ k00, k01, k02, k03, k04, k44, k43, k42, k41, k40, \ k10, k11, k12, k13, k14, k54, k53, k52, k51, k50, \ k20, k21, k22, k23, k24, k64, k63, k62, k61, k60, \ diff --git a/keyboards/bastardkb/charybdis/3x5/info.json b/keyboards/bastardkb/charybdis/3x5/info.json index efa863ea4b00..0c47d1a3ad9e 100644 --- a/keyboards/bastardkb/charybdis/3x5/info.json +++ b/keyboards/bastardkb/charybdis/3x5/info.json @@ -5,8 +5,11 @@ "pid": "0x1832", "vid": "0xA8F8" }, + "layout_aliases": { + "LAYOUT_charybdis_3x5": "LAYOUT" + }, "layouts": { - "LAYOUT_charybdis_3x5": { + "LAYOUT": { "layout": [ { "label": "L00", "x": 0, "y": 0 }, { "label": "L01", "x": 1, "y": 0 }, diff --git a/keyboards/bastardkb/charybdis/3x5/keymaps/bstiq/config.h b/keyboards/bastardkb/charybdis/3x5/keymaps/bstiq/config.h index cceba7c1fb16..3ab7e56ebdb4 100644 --- a/keyboards/bastardkb/charybdis/3x5/keymaps/bstiq/config.h +++ b/keyboards/bastardkb/charybdis/3x5/keymaps/bstiq/config.h @@ -156,10 +156,14 @@ # define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_CYCLE_LEFT_RIGHT // Slow swirl at startup. +# undef RGB_MATRIX_DEFAULT_SPD # define RGB_MATRIX_DEFAULT_SPD 32 // Startup values. +# undef RGB_MATRIX_DEFAULT_HUE # define RGB_MATRIX_DEFAULT_HUE 0 +# undef RGB_MATRIX_DEFAULT_SAT # define RGB_MATRIX_DEFAULT_SAT 255 +# undef RGB_MATRIX_DEFAULT_VAL # define RGB_MATRIX_DEFAULT_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS #endif // RGB_MATRIX_ENABLE diff --git a/keyboards/bastardkb/charybdis/3x5/keymaps/bstiq/keymap.c b/keyboards/bastardkb/charybdis/3x5/keymaps/bstiq/keymap.c index 2664b531a23f..8f02227c0182 100644 --- a/keyboards/bastardkb/charybdis/3x5/keymaps/bstiq/keymap.c +++ b/keyboards/bastardkb/charybdis/3x5/keymaps/bstiq/keymap.c @@ -182,7 +182,7 @@ enum charybdis_keymap_bstiq_layers { __VA_ARGS__ #define MOUSE_MOD(...) _MOUSE_MOD(__VA_ARGS__) -#define LAYOUT_wrapper(...) LAYOUT_charybdis_3x5(__VA_ARGS__) +#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [LAYER_BASE] = LAYOUT_wrapper( diff --git a/keyboards/bastardkb/charybdis/3x5/keymaps/default/keymap.c b/keyboards/bastardkb/charybdis/3x5/keymaps/default/keymap.c index 60c314630877..b1bd74957dbb 100644 --- a/keyboards/bastardkb/charybdis/3x5/keymaps/default/keymap.c +++ b/keyboards/bastardkb/charybdis/3x5/keymaps/default/keymap.c @@ -32,7 +32,7 @@ enum charybdis_keymap_layers { // clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [LAYER_BASE] = LAYOUT_charybdis_3x5( + [LAYER_BASE] = LAYOUT( // ╭─────────────────────────────────────────────╮ ╭─────────────────────────────────────────────╮ KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, // ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤ @@ -44,7 +44,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // ╰───────────────────────────╯ ╰──────────────────╯ ), - [LAYER_LOWER] = LAYOUT_charybdis_3x5( + [LAYER_LOWER] = LAYOUT( // ╭─────────────────────────────────────────────╮ ╭─────────────────────────────────────────────╮ RGB_TOG, KC_MNXT, KC_MPLY, KC_MPRV, XXXXXXX, KC_LBRC, KC_7, KC_8, KC_9, KC_RBRC, // ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤ @@ -56,7 +56,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // ╰───────────────────────────╯ ╰──────────────────╯ ), - [LAYER_RAISE] = LAYOUT_charybdis_3x5( + [LAYER_RAISE] = LAYOUT( // ╭─────────────────────────────────────────────╮ ╭─────────────────────────────────────────────╮ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_VOLU, KC_MUTE, KC_VOLD, XXXXXXX, // ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤ diff --git a/keyboards/bastardkb/charybdis/3x5/keymaps/via/keymap.c b/keyboards/bastardkb/charybdis/3x5/keymaps/via/keymap.c index ec93cec6273d..4a9154809052 100644 --- a/keyboards/bastardkb/charybdis/3x5/keymaps/via/keymap.c +++ b/keyboards/bastardkb/charybdis/3x5/keymaps/via/keymap.c @@ -200,7 +200,7 @@ static uint16_t auto_pointer_layer_timer = 0; __VA_ARGS__ #define POINTER_MOD(...) _POINTER_MOD(__VA_ARGS__) -#define LAYOUT_wrapper(...) LAYOUT_charybdis_3x5(__VA_ARGS__) +#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [LAYER_BASE] = LAYOUT_wrapper( diff --git a/keyboards/bastardkb/charybdis/3x6/3x6.h b/keyboards/bastardkb/charybdis/3x6/3x6.h index bf5de31036f9..71c22a561bd5 100644 --- a/keyboards/bastardkb/charybdis/3x6/3x6.h +++ b/keyboards/bastardkb/charybdis/3x6/3x6.h @@ -20,7 +20,7 @@ #include "charybdis.h" // clang-format off -#define LAYOUT_charybdis_3x6( \ +#define LAYOUT( \ k00, k01, k02, k03, k04, k05, k45, k44, k43, k42, k41, k40, \ k10, k11, k12, k13, k14, k15, k55, k54, k53, k52, k51, k50, \ k20, k21, k22, k23, k24, k25, k65, k64, k63, k62, k61, k60, \ diff --git a/keyboards/bastardkb/charybdis/3x6/info.json b/keyboards/bastardkb/charybdis/3x6/info.json index 4851da1d53e7..92c424788fe3 100644 --- a/keyboards/bastardkb/charybdis/3x6/info.json +++ b/keyboards/bastardkb/charybdis/3x6/info.json @@ -3,8 +3,11 @@ "usb": { "pid": "0x1834" }, + "layout_aliases": { + "LAYOUT_charybdis_3x6": "LAYOUT" + }, "layouts": { - "LAYOUT_charybdis_3x6": { + "LAYOUT": { "layout": [ { "label": "L00", "x": 0, "y": 0 }, { "label": "L01", "x": 1, "y": 0 }, diff --git a/keyboards/bastardkb/charybdis/3x6/keymaps/default/keymap.c b/keyboards/bastardkb/charybdis/3x6/keymaps/default/keymap.c index 8632ab7258e1..c3aa67a944a5 100644 --- a/keyboards/bastardkb/charybdis/3x6/keymaps/default/keymap.c +++ b/keyboards/bastardkb/charybdis/3x6/keymaps/default/keymap.c @@ -27,7 +27,7 @@ enum charybdis_keymap_layers { // clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [LAYER_BASE] = LAYOUT_charybdis_3x6( + [LAYER_BASE] = LAYOUT( // ╭──────────────────────────────────────────────────────╮ ╭──────────────────────────────────────────────────────╮ KC_LGUI, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RGUI, // ├──────────────────────────────────────────────────────┤ ├──────────────────────────────────────────────────────┤ @@ -39,7 +39,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // ╰───────────────────────────╯ ╰──────────────────╯ ), - [LAYER_LOWER] = LAYOUT_charybdis_3x6( + [LAYER_LOWER] = LAYOUT( // ╭──────────────────────────────────────────────────────╮ ╭──────────────────────────────────────────────────────╮ XXXXXXX, RGB_TOG, KC_MNXT, KC_MPLY, KC_MPRV, XXXXXXX, KC_LBRC, KC_7, KC_8, KC_9, KC_RBRC, XXXXXXX, // ├──────────────────────────────────────────────────────┤ ├──────────────────────────────────────────────────────┤ @@ -51,7 +51,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // ╰───────────────────────────╯ ╰──────────────────╯ ), - [LAYER_RAISE] = LAYOUT_charybdis_3x6( + [LAYER_RAISE] = LAYOUT( // ╭──────────────────────────────────────────────────────╮ ╭──────────────────────────────────────────────────────╮ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_VOLU, KC_MUTE, KC_VOLD, XXXXXXX, XXXXXXX, // ├──────────────────────────────────────────────────────┤ ├──────────────────────────────────────────────────────┤ diff --git a/keyboards/bastardkb/charybdis/3x6/keymaps/via/keymap.c b/keyboards/bastardkb/charybdis/3x6/keymaps/via/keymap.c index 7f6eb6a91161..fd56cce25dc0 100644 --- a/keyboards/bastardkb/charybdis/3x6/keymaps/via/keymap.c +++ b/keyboards/bastardkb/charybdis/3x6/keymaps/via/keymap.c @@ -45,7 +45,7 @@ static uint16_t auto_pointer_layer_timer = 0; // clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [LAYER_BASE] = LAYOUT_charybdis_3x6( + [LAYER_BASE] = LAYOUT( // ╭──────────────────────────────────────────────────────╮ ╭──────────────────────────────────────────────────────╮ KC_LGUI, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RGUI, // ├──────────────────────────────────────────────────────┤ ├──────────────────────────────────────────────────────┤ @@ -57,7 +57,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // ╰───────────────────────────╯ ╰──────────────────╯ ), - [LAYER_LOWER] = LAYOUT_charybdis_3x6( + [LAYER_LOWER] = LAYOUT( // ╭──────────────────────────────────────────────────────╮ ╭──────────────────────────────────────────────────────╮ XXXXXXX, RGB_TOG, KC_MNXT, KC_MPLY, KC_MPRV, XXXXXXX, KC_LBRC, KC_7, KC_8, KC_9, KC_RBRC, XXXXXXX, // ├──────────────────────────────────────────────────────┤ ├──────────────────────────────────────────────────────┤ @@ -69,7 +69,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // ╰───────────────────────────╯ ╰──────────────────╯ ), - [LAYER_RAISE] = LAYOUT_charybdis_3x6( + [LAYER_RAISE] = LAYOUT( // ╭──────────────────────────────────────────────────────╮ ╭──────────────────────────────────────────────────────╮ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_VOLU, KC_MUTE, KC_VOLD, XXXXXXX, XXXXXXX, // ├──────────────────────────────────────────────────────┤ ├──────────────────────────────────────────────────────┤ @@ -81,7 +81,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // ╰───────────────────────────╯ ╰──────────────────╯ ), - [LAYER_POINTER] = LAYOUT_charybdis_3x6( + [LAYER_POINTER] = LAYOUT( // ╭──────────────────────────────────────────────────────╮ ╭──────────────────────────────────────────────────────╮ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DPI_MOD, S_D_MOD, S_D_MOD, DPI_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, // ├──────────────────────────────────────────────────────┤ ├──────────────────────────────────────────────────────┤ diff --git a/keyboards/bastardkb/charybdis/4x6/4x6.h b/keyboards/bastardkb/charybdis/4x6/4x6.h index c26d356d6970..0d8810266e9b 100644 --- a/keyboards/bastardkb/charybdis/4x6/4x6.h +++ b/keyboards/bastardkb/charybdis/4x6/4x6.h @@ -21,7 +21,7 @@ #include "charybdis.h" // clang-format off -#define LAYOUT_charybdis_4x6( \ +#define LAYOUT( \ k00, k01, k02, k03, k04, k05, k55, k54, k53, k52, k51, k50, \ k10, k11, k12, k13, k14, k15, k65, k64, k63, k62, k61, k60, \ k20, k21, k22, k23, k24, k25, k75, k74, k73, k72, k71, k70, \ diff --git a/keyboards/bastardkb/charybdis/4x6/info.json b/keyboards/bastardkb/charybdis/4x6/info.json index 0b929a2188cd..6f3b6ec57ed5 100644 --- a/keyboards/bastardkb/charybdis/4x6/info.json +++ b/keyboards/bastardkb/charybdis/4x6/info.json @@ -5,8 +5,11 @@ "pid": "0x1833", "vid": "0xA8F8" }, + "layout_aliases": { + "LAYOUT_charybdis_4x6": "LAYOUT" + }, "layouts": { - "LAYOUT_charybdis_4x6": { + "LAYOUT": { "layout": [ { "label": "L00", "x": 0, "y": 0 }, { "label": "L01", "x": 1, "y": 0 }, diff --git a/keyboards/bastardkb/charybdis/4x6/keymaps/default/keymap.c b/keyboards/bastardkb/charybdis/4x6/keymaps/default/keymap.c index 98edad47d9d2..304e9fc9a483 100644 --- a/keyboards/bastardkb/charybdis/4x6/keymaps/default/keymap.c +++ b/keyboards/bastardkb/charybdis/4x6/keymaps/default/keymap.c @@ -27,7 +27,7 @@ enum charybdis_keymap_layers { // clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [LAYER_BASE] = LAYOUT_charybdis_4x6( + [LAYER_BASE] = LAYOUT( // ╭──────────────────────────────────────────────────────╮ ╭──────────────────────────────────────────────────────╮ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, // ├──────────────────────────────────────────────────────┤ ├──────────────────────────────────────────────────────┤ @@ -42,7 +42,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // ╰───────────────────────────╯ ╰──────────────────╯ ), - [LAYER_LOWER] = LAYOUT_charybdis_4x6( + [LAYER_LOWER] = LAYOUT( // ╭──────────────────────────────────────────────────────╮ ╭──────────────────────────────────────────────────────╮ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_UNDS, // ├──────────────────────────────────────────────────────┤ ├──────────────────────────────────────────────────────┤ @@ -57,7 +57,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // ╰───────────────────────────╯ ╰──────────────────╯ ), - [LAYER_RAISE] = LAYOUT_charybdis_4x6( + [LAYER_RAISE] = LAYOUT( // ╭──────────────────────────────────────────────────────╮ ╭──────────────────────────────────────────────────────╮ KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, // ├──────────────────────────────────────────────────────┤ ├──────────────────────────────────────────────────────┤ diff --git a/keyboards/bastardkb/charybdis/4x6/keymaps/via/keymap.c b/keyboards/bastardkb/charybdis/4x6/keymaps/via/keymap.c index 1050974212ec..fb795829fde1 100644 --- a/keyboards/bastardkb/charybdis/4x6/keymaps/via/keymap.c +++ b/keyboards/bastardkb/charybdis/4x6/keymaps/via/keymap.c @@ -56,7 +56,7 @@ static uint16_t auto_pointer_layer_timer = 0; // clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [LAYER_BASE] = LAYOUT_charybdis_4x6( + [LAYER_BASE] = LAYOUT( // ╭──────────────────────────────────────────────────────╮ ╭──────────────────────────────────────────────────────╮ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, // ├──────────────────────────────────────────────────────┤ ├──────────────────────────────────────────────────────┤ @@ -71,7 +71,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // ╰───────────────────────────╯ ╰──────────────────╯ ), - [LAYER_LOWER] = LAYOUT_charybdis_4x6( + [LAYER_LOWER] = LAYOUT( // ╭──────────────────────────────────────────────────────╮ ╭──────────────────────────────────────────────────────╮ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_UNDS, // ├──────────────────────────────────────────────────────┤ ├──────────────────────────────────────────────────────┤ @@ -86,7 +86,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // ╰───────────────────────────╯ ╰──────────────────╯ ), - [LAYER_RAISE] = LAYOUT_charybdis_4x6( + [LAYER_RAISE] = LAYOUT( // ╭──────────────────────────────────────────────────────╮ ╭──────────────────────────────────────────────────────╮ KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, // ├──────────────────────────────────────────────────────┤ ├──────────────────────────────────────────────────────┤ @@ -101,7 +101,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // ╰───────────────────────────╯ ╰──────────────────╯ ), - [LAYER_POINTER] = LAYOUT_charybdis_4x6( + [LAYER_POINTER] = LAYOUT( // ╭──────────────────────────────────────────────────────╮ ╭──────────────────────────────────────────────────────╮ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, // ├──────────────────────────────────────────────────────┤ ├──────────────────────────────────────────────────────┤ From 6e42b5854902963469a4016abeca48a9df5c1c46 Mon Sep 17 00:00:00 2001 From: AnotherStranger Date: Thu, 26 Jan 2023 22:14:34 +0100 Subject: [PATCH 02/10] VIA keymap for the dactyl manuform 4x6 (#19668) Co-authored-by: adophoxia <100170946+adophoxia@users.noreply.github.com> Co-authored-by: Drashna Jaelre --- .../dactyl_manuform/4x6/keymaps/via/config.h | 28 +++++ .../dactyl_manuform/4x6/keymaps/via/keymap.c | 108 ++++++++++++++++++ .../dactyl_manuform/4x6/keymaps/via/rules.mk | 1 + 3 files changed, 137 insertions(+) create mode 100644 keyboards/handwired/dactyl_manuform/4x6/keymaps/via/config.h create mode 100644 keyboards/handwired/dactyl_manuform/4x6/keymaps/via/keymap.c create mode 100644 keyboards/handwired/dactyl_manuform/4x6/keymaps/via/rules.mk diff --git a/keyboards/handwired/dactyl_manuform/4x6/keymaps/via/config.h b/keyboards/handwired/dactyl_manuform/4x6/keymaps/via/config.h new file mode 100644 index 000000000000..ce7fd324eb25 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/4x6/keymaps/via/config.h @@ -0,0 +1,28 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert +Copyright 2023 André Büsgen + +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 + +/* Select hand configuration */ +// #define MASTER_LEFT +// #define MASTER_RIGHT + +#define EE_HANDS diff --git a/keyboards/handwired/dactyl_manuform/4x6/keymaps/via/keymap.c b/keyboards/handwired/dactyl_manuform/4x6/keymaps/via/keymap.c new file mode 100644 index 000000000000..3e70e664af88 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/4x6/keymaps/via/keymap.c @@ -0,0 +1,108 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert +Copyright 2023 André Büsgen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include QMK_KEYBOARD_H + +enum layers{ + _BASE, + _RAISE, + _LOWER, + _BLANK +}; + +#define SFT_ESC SFT_T(KC_ESC) +#define CTL_BSPC CTL_T(KC_BSPC) +#define ALT_SPC ALT_T(KC_SPC) +#define SFT_ENT SFT_T(KC_ENT) + +#define KC_ML KC_MS_LEFT +#define KC_MR KC_MS_RIGHT +#define KC_MU KC_MS_UP +#define KC_MD KC_MS_DOWN +#define KC_MB1 KC_MS_BTN1 +#define KC_MB2 KC_MS_BTN1 + +#define RAISE MO(_RAISE) +#define LOWER MO(_LOWER) + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Base (qwerty) + * +-----------------------------------------+ +-----------------------------------------+ + * | ESC | q | w | e | r | t | | y | u | i | o | p | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | TAB | a | s | d | f | g | | h | j | k | l | ; | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | SHFT | z | x | c | v | b | | n | m | , | . | / | | + * +------+------+------+------+-------------+ +-------------+------+------+------+------+ + * | [ | ] | | | | + * +-------------+-------------+ +-------------+-------------+ + * | | | | | | + * |------+------| |------+------| + * | | | | | | + * +-------------+ +-------------+ + * +-------------+ +-------------+ + * | | | | | | + * |------+------| |------+------| + * | | | | | | + * +-------------+ +-------------+ + */ + [_BASE] = LAYOUT( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS, + KC_LBRC, KC_RBRC, KC_PLUS, KC_EQL, + RAISE, KC_SPC, KC_ENT, LOWER, + KC_TAB, KC_HOME, KC_END, KC_DEL, + KC_BSPC, KC_GRV, KC_LGUI, KC_LALT + ), + + [_LOWER] = LAYOUT( + _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC, KC_P7, KC_P8, KC_P9, QK_BOOT, KC_PLUS, + _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END , KC_LPRN, KC_RPRN, KC_P4, KC_P5, KC_P6, KC_MINS, KC_PIPE, + _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_EQL, KC_UNDS, + _______, KC_PSCR, _______, KC_P0, + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______ + ), + + [_RAISE] = LAYOUT( + _______, QK_BOOT, _______, _______, _______, KC_LBRC, KC_RBRC, _______, KC_NUM, KC_INS, KC_SCRL, KC_MUTE, + _______, KC_LEFT, KC_UP , KC_DOWN, KC_RGHT, KC_LPRN, KC_RPRN, KC_MPRV, KC_MPLY, KC_MNXT, _______, KC_VOLU, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, + _______, _______, KC_EQL, _______, + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______ + ), + + [_BLANK] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______ + ) +}; +//clang-format on + diff --git a/keyboards/handwired/dactyl_manuform/4x6/keymaps/via/rules.mk b/keyboards/handwired/dactyl_manuform/4x6/keymaps/via/rules.mk new file mode 100644 index 000000000000..1e5b99807cb7 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/4x6/keymaps/via/rules.mk @@ -0,0 +1 @@ +VIA_ENABLE = yes From b3dca4bb36d0c08e8145f6f25649aaf61b513fdd Mon Sep 17 00:00:00 2001 From: Jay Greco Date: Fri, 27 Jan 2023 00:03:57 -0800 Subject: [PATCH 03/10] Add RP2040 SCRAMBLE v2 (#19489) --- keyboards/nullbitsco/scramble/rules.mk | 21 +---- keyboards/nullbitsco/scramble/scramble.c | 22 ----- keyboards/nullbitsco/scramble/scramble.h | 17 ++-- .../nullbitsco/scramble/{ => v1}/config.h | 2 + keyboards/nullbitsco/scramble/v1/rules.mk | 21 +++++ keyboards/nullbitsco/scramble/v1/v1.c | 25 ++++++ keyboards/nullbitsco/scramble/v1/v1.h | 18 ++++ keyboards/nullbitsco/scramble/v2/config.h | 42 ++++++++++ keyboards/nullbitsco/scramble/v2/halconf.h | 9 ++ keyboards/nullbitsco/scramble/v2/mcuconf.h | 14 ++++ keyboards/nullbitsco/scramble/v2/rules.mk | 21 +++++ keyboards/nullbitsco/scramble/v2/v2.c | 84 +++++++++++++++++++ keyboards/nullbitsco/scramble/v2/v2.h | 43 ++++++++++ 13 files changed, 288 insertions(+), 51 deletions(-) rename keyboards/nullbitsco/scramble/{ => v1}/config.h (94%) create mode 100644 keyboards/nullbitsco/scramble/v1/rules.mk create mode 100644 keyboards/nullbitsco/scramble/v1/v1.c create mode 100644 keyboards/nullbitsco/scramble/v1/v1.h create mode 100644 keyboards/nullbitsco/scramble/v2/config.h create mode 100644 keyboards/nullbitsco/scramble/v2/halconf.h create mode 100644 keyboards/nullbitsco/scramble/v2/mcuconf.h create mode 100644 keyboards/nullbitsco/scramble/v2/rules.mk create mode 100644 keyboards/nullbitsco/scramble/v2/v2.c create mode 100644 keyboards/nullbitsco/scramble/v2/v2.h diff --git a/keyboards/nullbitsco/scramble/rules.mk b/keyboards/nullbitsco/scramble/rules.mk index e6d789691b51..6f83796e9f41 100644 --- a/keyboards/nullbitsco/scramble/rules.mk +++ b/keyboards/nullbitsco/scramble/rules.mk @@ -1,19 +1,4 @@ -# MCU name -MCU = atmega328p +# NOTE: This file is shared and only exists to set the default build +# The real build rules are set in the v1/v2 directories -# Bootloader selection -BOOTLOADER = usbasploader - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite -MOUSEKEY_ENABLE = yes # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = no # Console for debug -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = no # Enable N-Key Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow -AUDIO_ENABLE = no # Audio output -ENCODER_ENABLE = yes # Use rotary encoder +DEFAULT_FOLDER = nullbitsco/scramble/v2 diff --git a/keyboards/nullbitsco/scramble/scramble.c b/keyboards/nullbitsco/scramble/scramble.c index f9f28d2c31bc..c8a55e0d4850 100644 --- a/keyboards/nullbitsco/scramble/scramble.c +++ b/keyboards/nullbitsco/scramble/scramble.c @@ -16,25 +16,3 @@ along with this program. If not, see . */ #include QMK_KEYBOARD_H - -// place overrides here -void set_scramble_LED(uint8_t mode) { - switch(mode) { - case LED_ON: - setPinOutput(PIN_LED); - writePin(PIN_LED, GPIO_STATE_HIGH); - break; - - case LED_DIM: - setPinInput(PIN_LED); - break; - - case LED_OFF: - setPinOutput(PIN_LED); - writePin(PIN_LED, GPIO_STATE_LOW); - break; - - default: - break; - } -} diff --git a/keyboards/nullbitsco/scramble/scramble.h b/keyboards/nullbitsco/scramble/scramble.h index 101645e51d25..22c112040bf9 100644 --- a/keyboards/nullbitsco/scramble/scramble.h +++ b/keyboards/nullbitsco/scramble/scramble.h @@ -18,18 +18,13 @@ #include "quantum.h" -// Indication LED settings -#define LED_ON 2 -#define LED_DIM 1 -#define LED_OFF 0 - -#define GPIO_STATE_LOW 0 -#define GPIO_STATE_HIGH 1 - -#define PIN_LED B2 - -void set_scramble_LED(uint8_t mode); +#if defined(KEYBOARD_nullbitsco_scramble_v1) + #include "v1.h" +#elif defined(KEYBOARD_nullbitsco_scramble_v2) + #include "v2.h" +#endif +// Layout is the same in all revisions #define LAYOUT( \ K01, K02, K03, \ K11, K12, K13 \ diff --git a/keyboards/nullbitsco/scramble/config.h b/keyboards/nullbitsco/scramble/v1/config.h similarity index 94% rename from keyboards/nullbitsco/scramble/config.h rename to keyboards/nullbitsco/scramble/v1/config.h index 4333d94d376c..b249b99851f4 100644 --- a/keyboards/nullbitsco/scramble/config.h +++ b/keyboards/nullbitsco/scramble/v1/config.h @@ -15,6 +15,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +/* NOTE: This config file is specific to AVR builds. */ + #pragma once #include "config_common.h" diff --git a/keyboards/nullbitsco/scramble/v1/rules.mk b/keyboards/nullbitsco/scramble/v1/rules.mk new file mode 100644 index 000000000000..c1cf175c649b --- /dev/null +++ b/keyboards/nullbitsco/scramble/v1/rules.mk @@ -0,0 +1,21 @@ +# NOTE: This file is specific to AVR builds. + +# MCU name +MCU = atmega328p + +# Bootloader selection +BOOTLOADER = usbasploader + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output +ENCODER_ENABLE = yes # Use rotary encoder diff --git a/keyboards/nullbitsco/scramble/v1/v1.c b/keyboards/nullbitsco/scramble/v1/v1.c new file mode 100644 index 000000000000..4b5e8e3e6719 --- /dev/null +++ b/keyboards/nullbitsco/scramble/v1/v1.c @@ -0,0 +1,25 @@ +// Copyright 2022 Jay Greco +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "v1.h" + +void set_scramble_LED(uint8_t mode) { + switch(mode) { + case LED_ON: + setPinOutput(PIN_LED); + writePin(PIN_LED, GPIO_STATE_HIGH); + break; + + case LED_DIM: + setPinInput(PIN_LED); + break; + + case LED_OFF: + setPinOutput(PIN_LED); + writePin(PIN_LED, GPIO_STATE_LOW); + break; + + default: + break; + } +} diff --git a/keyboards/nullbitsco/scramble/v1/v1.h b/keyboards/nullbitsco/scramble/v1/v1.h new file mode 100644 index 000000000000..5dc6d4a0e825 --- /dev/null +++ b/keyboards/nullbitsco/scramble/v1/v1.h @@ -0,0 +1,18 @@ +// Copyright 2022 Jay Greco +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "scramble.h" + +// Indication LED settings +#define LED_ON 2 +#define LED_DIM 1 +#define LED_OFF 0 + +#define GPIO_STATE_LOW 0 +#define GPIO_STATE_HIGH 1 + +#define PIN_LED B2 + +void set_scramble_LED(uint8_t mode); diff --git a/keyboards/nullbitsco/scramble/v2/config.h b/keyboards/nullbitsco/scramble/v2/config.h new file mode 100644 index 000000000000..a2eb9712f91e --- /dev/null +++ b/keyboards/nullbitsco/scramble/v2/config.h @@ -0,0 +1,42 @@ +/* +Copyright 2021 Jay Greco + +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 . +*/ + +/* NOTE: This config file is specific to RP2040 builds. */ + +#pragma once + +#include "config_common.h" + +/* key matrix size */ +#define MATRIX_ROWS 2 +#define MATRIX_COLS 3 + +#define DIRECT_PINS {{GP6,GP8,GP10}, {GP29,GP28,GP22}} + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 10 + +/* Optional encoder pins */ +#define ENCODERS_PAD_A { GP24 } +#define ENCODERS_PAD_B { GP25 } +#define TAP_CODE_DELAY 10 + +/* RP2040-specific defines*/ +#define RP2040_FLASH_GENERIC_03H +#define I2C1_SDA_PIN GP26 +#define I2C1_SCL_PIN GP27 +#define I2C_DRIVER I2CD2 diff --git a/keyboards/nullbitsco/scramble/v2/halconf.h b/keyboards/nullbitsco/scramble/v2/halconf.h new file mode 100644 index 000000000000..2cc40eaa91c1 --- /dev/null +++ b/keyboards/nullbitsco/scramble/v2/halconf.h @@ -0,0 +1,9 @@ +// Copyright 2022 Jay Greco +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define HAL_USE_I2C TRUE +#define HAL_USE_PWM TRUE + +#include_next diff --git a/keyboards/nullbitsco/scramble/v2/mcuconf.h b/keyboards/nullbitsco/scramble/v2/mcuconf.h new file mode 100644 index 000000000000..9646c6b7020b --- /dev/null +++ b/keyboards/nullbitsco/scramble/v2/mcuconf.h @@ -0,0 +1,14 @@ +// Copyright 2022 Jay Greco +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include_next + +#undef RP_I2C_USE_I2C1 +#define RP_I2C_USE_I2C1 TRUE + +#undef RP_PWM_USE_PWM1 +#define RP_PWM_USE_PWM1 TRUE +#undef RP_PWM_USE_PWM2 +#define RP_PWM_USE_PWM2 TRUE diff --git a/keyboards/nullbitsco/scramble/v2/rules.mk b/keyboards/nullbitsco/scramble/v2/rules.mk new file mode 100644 index 000000000000..f93963285bf4 --- /dev/null +++ b/keyboards/nullbitsco/scramble/v2/rules.mk @@ -0,0 +1,21 @@ +# NOTE: This file is is specific to RP2040 builds. + +# MCU name +MCU = RP2040 + +# Bootloader selection +BOOTLOADER = rp2040 + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output +ENCODER_ENABLE = yes # Use rotary encoder diff --git a/keyboards/nullbitsco/scramble/v2/v2.c b/keyboards/nullbitsco/scramble/v2/v2.c new file mode 100644 index 000000000000..9b0a088855f2 --- /dev/null +++ b/keyboards/nullbitsco/scramble/v2/v2.c @@ -0,0 +1,84 @@ +// Copyright 2022 Jay Greco +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "v2.h" + +// SCRAMBLE PWM LED config +pwm_led_t scramble_rgb = { + {GP18, GP19, GP20}, + {&PWMD1, &PWMD1, &PWMD2}, + {0, 1, 0}, + PWM_OUTPUT_ACTIVE_LOW, + 0 +}; + +// Internal PWM init +// only runs once per PWM LED +void _init_pwm(pwm_led_t* led) { + if (!led->init_complete) { + for (int i=0; ipin[i]), PAL_PAD(led->pin[i]), PWM_PAL_MODE); + + static PWMConfig pwmCFG = { + .frequency = PWM_PWM_COUNTER_FREQUENCY, + .period = PWM_PWM_PERIOD, + }; + + // Channels are always configured as active low + // If active high is needed, pwm is inverted in _set_led_pwm() + pwmCFG.channels[0].mode = PWM_OUTPUT_ACTIVE_LOW; + pwmCFG.channels[1].mode = PWM_OUTPUT_ACTIVE_LOW; + pwmStart(led->driver[i], &pwmCFG); + + // Start LEDs in the OFF state + uint8_t pwm = led->mode == PWM_OUTPUT_ACTIVE_HIGH ? 100 : 0; + pwmEnableChannel(led->driver[i], led->channel[i], PWM_FRACTION_TO_WIDTH(led->driver[i], 99, pwm)); + } + + led->init_complete = 1; + } +} + +// Internal generic PWM setter +void _set_led_pwm(uint8_t pwm, pwm_led_t* led, uint8_t channel) { + if (pwm > 100) pwm = 100; + if (led->mode == PWM_OUTPUT_ACTIVE_HIGH) pwm = (100 - pwm); + + _init_pwm(led); + pwmEnableChannel(led->driver[channel], led->channel[channel], PWM_FRACTION_TO_WIDTH(led->driver[channel], 99, pwm)); +} + +// SCRAMBLE +void set_scramble_LED(uint8_t mode) { + switch(mode) { + case LED_ON: + set_scramble_LED_rgb_pwm(65, 100, 95); + break; + + case LED_DIM: + set_scramble_LED_rgb_pwm(3, 9, 3); + break; + + default: //LED_OFF + set_scramble_LED_rgb_pwm(0, 0, 0); + break; + } +} + +void set_scramble_LED_rgb_pwm(uint8_t r_pwm, uint8_t g_pwm, uint8_t b_pwm) { + _set_led_pwm(r_pwm, &scramble_rgb, RED); + _set_led_pwm(g_pwm, &scramble_rgb, GREEN); + _set_led_pwm(b_pwm, &scramble_rgb, BLUE); +} + +void set_scramble_LED_r_pwm(uint8_t pwm) { + _set_led_pwm(pwm, &scramble_rgb, RED); +} + +void set_scramble_LED_g_pwm(uint8_t pwm) { + _set_led_pwm(pwm, &scramble_rgb, GREEN); +} + +void set_scramble_LED_b_pwm(uint8_t pwm) { + _set_led_pwm(pwm, &scramble_rgb, BLUE); +} diff --git a/keyboards/nullbitsco/scramble/v2/v2.h b/keyboards/nullbitsco/scramble/v2/v2.h new file mode 100644 index 000000000000..d278c0a86a67 --- /dev/null +++ b/keyboards/nullbitsco/scramble/v2/v2.h @@ -0,0 +1,43 @@ +// Copyright 2022 Jay Greco +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "scramble.h" +#include + +enum led_mode { + LED_OFF = 0, + LED_DIM, + LED_ON, + NUM_LED_MODE +}; + +enum rgb_idx { + RED = 0, + GREEN, + BLUE, + NUM_RGB_IDX +}; + +typedef struct pwm_led_t { + uint32_t pin[3]; + PWMDriver* driver[3]; + uint8_t channel[3]; + uint8_t mode; + uint8_t init_complete; +} pwm_led_t; + +#define PWM_PAL_MODE (PAL_MODE_ALTERNATE_PWM | PAL_RP_PAD_DRIVE12 | PAL_RP_GPIO_OE) +#define PWM_PWM_COUNTER_FREQUENCY 1000000 +#define PWM_PWM_PERIOD PWM_PWM_COUNTER_FREQUENCY / 1000 + +// RP2040 adds HW PWM control! +// PWM values are in percent, 0-100 +void + set_scramble_LED(uint8_t mode), + set_scramble_LED_rgb_pwm(uint8_t r_pwm, uint8_t g_pwm, uint8_t b_pwm), + set_scramble_LED_r_pwm(uint8_t pwm), + set_scramble_LED_g_pwm(uint8_t pwm), + set_scramble_LED_b_pwm(uint8_t pwm); + \ No newline at end of file From 9aaf1c26f028d22bae8fdf9d63e21d1b9951a3bd Mon Sep 17 00:00:00 2001 From: Patrick Muldoon Date: Fri, 27 Jan 2023 08:35:26 -0800 Subject: [PATCH 04/10] Swap LED_PIN_ON_STATE to 0. (#19692) User reported that CAPS lock Led state was inverted after soldering a LED to their board. LED_PIN_ON_STATE defaults to 1, so just swap to low. Flashed board and now CAPS LED reflects the actual state --- keyboards/mode/m80v2/config.h | 1 + 1 file changed, 1 insertion(+) diff --git a/keyboards/mode/m80v2/config.h b/keyboards/mode/m80v2/config.h index 9382def58aec..6a8864fdb9cd 100644 --- a/keyboards/mode/m80v2/config.h +++ b/keyboards/mode/m80v2/config.h @@ -38,3 +38,4 @@ along with this program. If not, see . #define LOCKING_RESYNC_ENABLE #define LED_CAPS_LOCK_PIN A0 +#define LED_PIN_ON_STATE 0 From acea06b4f5d7dbbe3a65ea512a367b8fb202b5e2 Mon Sep 17 00:00:00 2001 From: adophoxia <100170946+adophoxia@users.noreply.github.com> Date: Fri, 27 Jan 2023 13:39:38 -0800 Subject: [PATCH 05/10] [Keyboard] Update effects for Keychron Q2 (#19685) --- keyboards/keychron/q2/config.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/keyboards/keychron/q2/config.h b/keyboards/keychron/q2/config.h index 210ecb1201f3..51b5b72faa0b 100644 --- a/keyboards/keychron/q2/config.h +++ b/keyboards/keychron/q2/config.h @@ -103,4 +103,7 @@ #define ENABLE_RGB_MATRIX_SPLASH // #define ENABLE_RGB_MATRIX_MULTISPLASH #define ENABLE_RGB_MATRIX_SOLID_SPLASH -#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH +// #define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH + +#define RGB_MATRIX_KEYPRESSES +#define RGB_MATRIX_FRAMEBUFFER_EFFECTS From ce7bb639998f97536c562c2cde5afbd3e3a0950e Mon Sep 17 00:00:00 2001 From: azhizhinov Date: Sat, 28 Jan 2023 01:52:05 +0300 Subject: [PATCH 06/10] VIA keymap for Reviung 34. (#19694) VIA keymap for Reviung 34. --- .../reviung/reviung34/keymaps/via/keymap.c | 69 +++++++++++++++++++ .../reviung/reviung34/keymaps/via/rules.mk | 3 + 2 files changed, 72 insertions(+) create mode 100644 keyboards/reviung/reviung34/keymaps/via/keymap.c create mode 100644 keyboards/reviung/reviung34/keymaps/via/rules.mk diff --git a/keyboards/reviung/reviung34/keymaps/via/keymap.c b/keyboards/reviung/reviung34/keymaps/via/keymap.c new file mode 100644 index 000000000000..44ec64bdd371 --- /dev/null +++ b/keyboards/reviung/reviung34/keymaps/via/keymap.c @@ -0,0 +1,69 @@ +/* Copyright 2019 gtips + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +enum layer_names { + _BASE, + _LOWER, + _RAISE, + _ADJUST +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +#define CT_Q LCTL_T(KC_Q) +#define CT_CM RCTL_T(KC_COMM) +#define SF_Z LSFT_T(KC_Z) +#define SF_SS RSFT_T(KC_SLSH) +#define AL_X LALT_T(KC_X) +#define AL_DT RALT_T(KC_DOT) +#define RA_SP LT(RAISE, KC_SPC) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_reviung34( + CT_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, + SF_Z, AL_X, KC_C, KC_V, KC_B, KC_N, KC_M, CT_CM, AL_DT, SF_SS, + KC_TAB, KC_BSPC, LOWER, RA_SP + ), + + [_LOWER] = LAYOUT_reviung34( + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, + KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_SCLN, + KC_LSFT, KC_ESC, KC_LGUI, KC_LALT, KC_QUOT, KC_HOME, KC_END, KC_PGUP, KC_PGDN, KC_BSPC, + _______, _______, _______, _______ + ), + + [_RAISE] = LAYOUT_reviung34( + 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_LBRC, KC_RBRC, KC_BSLS, XXXXXXX, XXXXXXX, KC_GRV, KC_TILD, KC_COLN, + KC_LSFT, KC_ESC, KC_RGUI, KC_LALT, KC_DQUO, KC_TAB, XXXXXXX, KC_RCTL, KC_RALT, KC_DEL, + _______, _______, _______, _______ + ), + + [_ADJUST] = LAYOUT_reviung34( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSCR, + KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_F11, KC_F12, KC_CAPS, XXXXXXX, XXXXXXX, QK_BOOT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, _______, _______, _______ + ), +}; + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} diff --git a/keyboards/reviung/reviung34/keymaps/via/rules.mk b/keyboards/reviung/reviung34/keymaps/via/rules.mk new file mode 100644 index 000000000000..5d85ccd10314 --- /dev/null +++ b/keyboards/reviung/reviung34/keymaps/via/rules.mk @@ -0,0 +1,3 @@ +VIA_ENABLE = yes +RGBLIGHT_ENABLE = no +LTO_ENABLE = yes From 981f3c316cb1619aef554fbb2913c8d1b03b0d08 Mon Sep 17 00:00:00 2001 From: Albert Y <76888457+filterpaper@users.noreply.github.com> Date: Sun, 29 Jan 2023 00:41:50 +0800 Subject: [PATCH 07/10] Additional handedness by EEPROM examples (#19686) Co-authored-by: jack <0x6a73@protonmail.com> Co-authored-by: Dasky <32983009+daskygit@users.noreply.github.com> --- docs/feature_split_keyboard.md | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/docs/feature_split_keyboard.md b/docs/feature_split_keyboard.md index 0b475cc63d60..fff72f71f3ad 100644 --- a/docs/feature_split_keyboard.md +++ b/docs/feature_split_keyboard.md @@ -132,28 +132,25 @@ To enable this method, add the following to your `config.h` file: #define EE_HANDS ``` -Next, you will have to flash the EEPROM files once for the correct hand to the controller on each halve. You can do this manually with the following bootloader targets while flashing the firmware: +Next, you will have to flash the correct handedness option to the controller on each halve. You can do this manually with the following bootloader targets using `qmk flash -kb -km -bl ` command to flash: -* AVR controllers with the Caterina bootloader (e.g. Pro Micro): - * `:avrdude-split-left` - * `:avrdude-split-right` -* AVR controllers with the stock Amtel DFU or DFU compatible bootloader (e.g. Elite-C): - * `:dfu-split-left` - * `:dfu-split-right` -* ARM controllers with a DFU compatible bootloader (e.g. Proton-C): - * `:dfu-util-split-left` - * `:dfu-util-split-right` -* ARM controllers with a UF2 compatible bootloader: - * `:uf2-split-left` - * `:uf2-split-right` - -Example: +|Microcontroller Type|Bootloader Parameter| +|--------------------|--------------------| +|AVR controllers with Caterina bootloader
(e.g. Pro Micro)|`avrdude-split-left`
`avrdude-split-right`| +|AVR controllers with the stock Amtel DFU or DFU compatible bootloader
(e.g. Elite-C)|`dfu-split-left`
`dfu-split-right`| +|ARM controllers with a DFU compatible bootloader
(e.g. Proton-C)|`dfu-util-split-left`
`dfu-util-split-right`| +|ARM controllers with a UF2 compatible bootloader
(e.g. RP2040)|`uf2-split-left`
`uf2-split-right`| +Example for `crkbd/rev1` keyboard with normal AVR Pro Micro MCUs, reset the left controller and run: +``` +qmk flash -kb crkbd/rev1 -km default -bl avrdude-split-left +``` +Reset the right controller and run: ``` -make crkbd:default:avrdude-split-left +qmk flash -kb crkbd/rev1 -km default -bl avrdude-split-right ``` -?> ARM controllers using `dfu-util` will require an EEPROM reset after setting handedness. This can be done using the `EE_CLR` keycode or [Bootmagic Lite](feature_bootmagic.md). Controllers using emulated EEPROM will always require handedness parameter when flashing the firmware. +?> Some controllers (e.g. Blackpill with DFU compatible bootloader) will need to be flashed with handedness bootloader parameter every time because it is not retained between flashes. ?> [QMK Toolbox]() can also be used to flash EEPROM handedness files. Place the controller in bootloader mode and select menu option Tools -> EEPROM -> Set Left/Right Hand From d322b4c041d4b600fee00ba7f94966ac9a9e2dfa Mon Sep 17 00:00:00 2001 From: yiancar Date: Sun, 29 Jan 2023 16:59:13 +0000 Subject: [PATCH 08/10] [Keyboard] Baion 808 (#19690) Co-authored-by: jack <0x6a73@protonmail.com> Co-authored-by: Joel Challis Co-authored-by: yiancar --- keyboards/baion_808/baion_808.c | 22 +++ keyboards/baion_808/baion_808.h | 164 +++++++++++++++++++ keyboards/baion_808/config.h | 66 ++++++++ keyboards/baion_808/info.json | 42 +++++ keyboards/baion_808/keymaps/default/keymap.c | 27 +++ keyboards/baion_808/keymaps/via/keymap.c | 54 ++++++ keyboards/baion_808/keymaps/via/rules.mk | 1 + keyboards/baion_808/readme.md | 38 +++++ keyboards/baion_808/rules.mk | 22 +++ 9 files changed, 436 insertions(+) create mode 100755 keyboards/baion_808/baion_808.c create mode 100644 keyboards/baion_808/baion_808.h create mode 100755 keyboards/baion_808/config.h create mode 100755 keyboards/baion_808/info.json create mode 100644 keyboards/baion_808/keymaps/default/keymap.c create mode 100644 keyboards/baion_808/keymaps/via/keymap.c create mode 100755 keyboards/baion_808/keymaps/via/rules.mk create mode 100755 keyboards/baion_808/readme.md create mode 100755 keyboards/baion_808/rules.mk diff --git a/keyboards/baion_808/baion_808.c b/keyboards/baion_808/baion_808.c new file mode 100755 index 000000000000..4f4b7adeab39 --- /dev/null +++ b/keyboards/baion_808/baion_808.c @@ -0,0 +1,22 @@ +/* Copyright 2022 Yiancar-Designs + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "baion_808.h" + +void led_init_ports(void) { + // Set our LED pins as open drain outputs + palSetLineMode(LED_CAPS_LOCK_PIN, PAL_MODE_OUTPUT_OPENDRAIN); + palSetLineMode(LED_SCROLL_LOCK_PIN, PAL_MODE_OUTPUT_OPENDRAIN); +} diff --git a/keyboards/baion_808/baion_808.h b/keyboards/baion_808/baion_808.h new file mode 100644 index 000000000000..944b46ef9063 --- /dev/null +++ b/keyboards/baion_808/baion_808.h @@ -0,0 +1,164 @@ +/* Copyright 2022 Yiancar-Designs + * + * 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 XXX KC_NO + +#include "quantum.h" + +#define LAYOUT_all( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, K0F, KOG, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K2D, K1E, K1F, K1G, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K3C, K2E, K2F, K2G, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4F, \ + K50, K51, K52, K56, K5A, K5B, K5C, K5D, K5E, K5F, K5G \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, XXX, K0E, K0F, KOG }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, XXX, XXX, XXX }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, XXX, K4F, XXX }, \ + { K50, K51, K52, XXX, XXX, XXX, K56, XXX, XXX, XXX, K5A, K5B, K5C, K5D, K5E, K5F, K5G } \ +} + +#define LAYOUT_tkl_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, K0F, KOG, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K3C, K2E, K2F, K2G, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ + K40, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4F, \ + K50, K51, K52, K56, K5A, K5B, K5C, K5D, K5E, K5F, K5G \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, XXX, K0E, K0F, KOG }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, XXX, K2E, K2F, K2G }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, XXX, XXX, XXX }, \ + { K40, XXX, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, XXX, XXX, K4F, XXX }, \ + { K50, K51, K52, XXX, XXX, XXX, K56, XXX, XXX, XXX, K5A, K5B, K5C, K5D, K5E, K5F, K5G } \ +} + +#define LAYOUT_tkl_ansi_split_bs_rshift( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, K0F, KOG, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K2D, K1E, K1F, K1G, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K3C, K2E, K2F, K2G, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ + K40, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4F, \ + K50, K51, K52, K56, K5A, K5B, K5C, K5D, K5E, K5F, K5G \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, XXX, K0E, K0F, KOG }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, XXX, XXX, XXX }, \ + { K40, XXX, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, XXX, K4F, XXX }, \ + { K50, K51, K52, XXX, XXX, XXX, K56, XXX, XXX, XXX, K5A, K5B, K5C, K5D, K5E, K5F, K5G } \ +} + +#define LAYOUT_tkl_ansi_tsangan( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, K0F, KOG, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K3C, K2E, K2F, K2G, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ + K40, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4F, \ + K50, K51, K52, K56, K5B, K5C, K5D, K5E, K5F, K5G \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, XXX, K0E, K0F, KOG }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, XXX, K2E, K2F, K2G }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, XXX, XXX, XXX }, \ + { K40, XXX, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, XXX, XXX, K4F, XXX }, \ + { K50, K51, K52, XXX, XXX, XXX, K56, XXX, XXX, XXX, XXX, K5B, K5C, K5D, K5E, K5F, K5G } \ +} + +#define LAYOUT_tkl_ansi_tsangan_split_bs_rshift( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, K0F, KOG, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K2D, K1E, K1F, K1G, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K3C, K2E, K2F, K2G, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ + K40, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4F, \ + K50, K51, K52, K56, K5B, K5C, K5D, K5E, K5F, K5G \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, XXX, K0E, K0F, KOG }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, XXX, XXX, XXX }, \ + { K40, XXX, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, XXX, K4F, XXX }, \ + { K50, K51, K52, XXX, XXX, XXX, K56, XXX, XXX, XXX, XXX, K5B, K5C, K5D, K5E, K5F, K5G } \ +} + +#define LAYOUT_tkl_iso( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, K0F, KOG, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2E, K2F, K2G, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4F, \ + K50, K51, K52, K56, K5A, K5B, K5C, K5D, K5E, K5F, K5G \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, XXX, K0E, K0F, KOG }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, XXX, K2E, K2F, K2G }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, XXX, XXX, XXX }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, XXX, XXX, K4F, XXX }, \ + { K50, K51, K52, XXX, XXX, XXX, K56, XXX, XXX, XXX, K5A, K5B, K5C, K5D, K5E, K5F, K5G } \ +} + +#define LAYOUT_tkl_iso_split_bs_rshift( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, K0F, KOG, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K2D, K1E, K1F, K1G, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2E, K2F, K2G, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4F, \ + K50, K51, K52, K56, K5A, K5B, K5C, K5D, K5E, K5F, K5G \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, XXX, K0E, K0F, KOG }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, XXX, XXX, XXX }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, XXX, K4F, XXX }, \ + { K50, K51, K52, XXX, XXX, XXX, K56, XXX, XXX, XXX, K5A, K5B, K5C, K5D, K5E, K5F, K5G } \ +} + +#define LAYOUT_tkl_iso_tsangan( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, K0F, KOG, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2E, K2F, K2G, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4F, \ + K50, K51, K52, K56, K5B, K5C, K5D, K5E, K5F, K5G \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, XXX, K0E, K0F, KOG }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, XXX, K2E, K2F, K2G }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, XXX, XXX, XXX }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, XXX, XXX, K4F, XXX }, \ + { K50, K51, K52, XXX, XXX, XXX, K56, XXX, XXX, XXX, XXX, K5B, K5C, K5D, K5E, K5F, K5G } \ +} + +#define LAYOUT_tkl_iso_tsangan_split_bs_rshift( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, K0F, KOG, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K2D, K1E, K1F, K1G, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2E, K2F, K2G, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4F, \ + K50, K51, K52, K56, K5B, K5C, K5D, K5E, K5F, K5G \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, XXX, K0E, K0F, KOG }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, XXX, XXX, XXX }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, XXX, K4F, XXX }, \ + { K50, K51, K52, XXX, XXX, XXX, K56, XXX, XXX, XXX, XXX, K5B, K5C, K5D, K5E, K5F, K5G } \ +} diff --git a/keyboards/baion_808/config.h b/keyboards/baion_808/config.h new file mode 100755 index 000000000000..f3fe8ae7993a --- /dev/null +++ b/keyboards/baion_808/config.h @@ -0,0 +1,66 @@ +/* +Copyright 2022 Yiancar-Designs + +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" + +#define MATRIX_ROW_PINS { A2, A14, A15, B3, B4, B5 } +#define MATRIX_COL_PINS { A1, B9, A3, A4, A5, A6, A7, B0, B1, B2, B10, B11, B12, B13, B14, B15, A8 } + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* Ensure we jump to bootloader if the RESET keycode was pressed */ +#define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE + +/* Indicator LEDs */ +#define LED_CAPS_LOCK_PIN B6 +#define LED_SCROLL_LOCK_PIN B7 +#define LED_PIN_ON_STATE 0 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO diff --git a/keyboards/baion_808/info.json b/keyboards/baion_808/info.json new file mode 100755 index 000000000000..456a7c7bd7ce --- /dev/null +++ b/keyboards/baion_808/info.json @@ -0,0 +1,42 @@ +{ + "keyboard_name": "Baion 808", + "manufacturer": "Yiancar-Designs", + "url": "https://yiancar-designs.com", + "maintainer": "Yiancar-Designs", + "usb": { + "vid": "0x8968", + "pid": "0x4238", + "device_version": "0.0.1" + }, + "processor": "STM32F072", + "bootloader": "stm32-dfu", + "layouts": { + "LAYOUT_all": { + "layout": [{"x":0, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6.5, "y":0}, {"x":7.5, "y":0}, {"x":8.5, "y":0}, {"x":9.5, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"x":17.25, "y":0}, {"x":0, "y":1.5}, {"x":1, "y":1.5}, {"x":2, "y":1.5}, {"x":3, "y":1.5}, {"x":4, "y":1.5}, {"x":5, "y":1.5}, {"x":6, "y":1.5}, {"x":7, "y":1.5}, {"x":8, "y":1.5}, {"x":9, "y":1.5}, {"x":10, "y":1.5}, {"x":11, "y":1.5}, {"x":12, "y":1.5}, {"x":13, "y":1.5}, {"x":14, "y":1.5}, {"x":15.25, "y":1.5}, {"x":16.25, "y":1.5}, {"x":17.25, "y":1.5}, {"x":0, "y":2.5, "w":1.5}, {"x":1.5, "y":2.5}, {"x":2.5, "y":2.5}, {"x":3.5, "y":2.5}, {"x":4.5, "y":2.5}, {"x":5.5, "y":2.5}, {"x":6.5, "y":2.5}, {"x":7.5, "y":2.5}, {"x":8.5, "y":2.5}, {"x":9.5, "y":2.5}, {"x":10.5, "y":2.5}, {"x":11.5, "y":2.5}, {"x":12.5, "y":2.5}, {"x":13.5, "y":2.5, "w":1.5}, {"x":15.25, "y":2.5}, {"x":16.25, "y":2.5}, {"x":17.25, "y":2.5}, {"x":0, "y":3.5, "w":1.75}, {"x":1.75, "y":3.5}, {"x":2.75, "y":3.5}, {"x":3.75, "y":3.5}, {"x":4.75, "y":3.5}, {"x":5.75, "y":3.5}, {"x":6.75, "y":3.5}, {"x":7.75, "y":3.5}, {"x":8.75, "y":3.5}, {"x":9.75, "y":3.5}, {"x":10.75, "y":3.5}, {"x":11.75, "y":3.5}, {"x":12.75, "y":3.5, "w":2.25}, {"x":0, "y":4.5, "w":1.25}, {"x":1.25, "y":4.5}, {"x":2.25, "y":4.5}, {"x":3.25, "y":4.5}, {"x":4.25, "y":4.5}, {"x":5.25, "y":4.5}, {"x":6.25, "y":4.5}, {"x":7.25, "y":4.5}, {"x":8.25, "y":4.5}, {"x":9.25, "y":4.5}, {"x":10.25, "y":4.5}, {"x":11.25, "y":4.5}, {"x":12.25, "y":4.5, "w":1.75}, {"x":14, "y":4.5}, {"x":16.25, "y":4.5}, {"x":0, "y":5.5, "w":1.25}, {"x":1.25, "y":5.5, "w":1.25}, {"x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"x":10, "y":5.5, "w":1.25}, {"x":11.25, "y":5.5, "w":1.25}, {"x":12.5, "y":5.5, "w":1.25}, {"x":13.75, "y":5.5, "w":1.25}, {"x":15.25, "y":5.5}, {"x":16.25, "y":5.5}, {"x":17.25, "y":5.5}] + }, + "LAYOUT_tkl_ansi": { + "layout": [{"x":0, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6.5, "y":0}, {"x":7.5, "y":0}, {"x":8.5, "y":0}, {"x":9.5, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"x":17.25, "y":0}, {"x":0, "y":1.25}, {"x":1, "y":1.25}, {"x":2, "y":1.25}, {"x":3, "y":1.25}, {"x":4, "y":1.25}, {"x":5, "y":1.25}, {"x":6, "y":1.25}, {"x":7, "y":1.25}, {"x":8, "y":1.25}, {"x":9, "y":1.25}, {"x":10, "y":1.25}, {"x":11, "y":1.25}, {"x":12, "y":1.25}, {"x":13, "y":1.25, "w":2}, {"x":15.25, "y":1.25}, {"x":16.25, "y":1.25}, {"x":17.25, "y":1.25}, {"x":0, "y":2.25, "w":1.5}, {"x":1.5, "y":2.25}, {"x":2.5, "y":2.25}, {"x":3.5, "y":2.25}, {"x":4.5, "y":2.25}, {"x":5.5, "y":2.25}, {"x":6.5, "y":2.25}, {"x":7.5, "y":2.25}, {"x":8.5, "y":2.25}, {"x":9.5, "y":2.25}, {"x":10.5, "y":2.25}, {"x":11.5, "y":2.25}, {"x":12.5, "y":2.25}, {"x":13.5, "y":2.25, "w":1.5}, {"x":15.25, "y":2.25}, {"x":16.25, "y":2.25}, {"x":17.25, "y":2.25}, {"x":0, "y":3.25, "w":1.75}, {"x":1.75, "y":3.25}, {"x":2.75, "y":3.25}, {"x":3.75, "y":3.25}, {"x":4.75, "y":3.25}, {"x":5.75, "y":3.25}, {"x":6.75, "y":3.25}, {"x":7.75, "y":3.25}, {"x":8.75, "y":3.25}, {"x":9.75, "y":3.25}, {"x":10.75, "y":3.25}, {"x":11.75, "y":3.25}, {"x":12.75, "y":3.25, "w":2.25}, {"x":0, "y":4.25, "w":2.25}, {"x":2.25, "y":4.25}, {"x":3.25, "y":4.25}, {"x":4.25, "y":4.25}, {"x":5.25, "y":4.25}, {"x":6.25, "y":4.25}, {"x":7.25, "y":4.25}, {"x":8.25, "y":4.25}, {"x":9.25, "y":4.25}, {"x":10.25, "y":4.25}, {"x":11.25, "y":4.25}, {"x":12.25, "y":4.25, "w":2.75}, {"x":16.25, "y":4.25}, {"x":0, "y":5.25, "w":1.25}, {"x":1.25, "y":5.25, "w":1.25}, {"x":2.5, "y":5.25, "w":1.25}, {"x":3.75, "y":5.25, "w":6.25}, {"x":10, "y":5.25, "w":1.25}, {"x":11.25, "y":5.25, "w":1.25}, {"x":12.5, "y":5.25, "w":1.25}, {"x":13.75, "y":5.25, "w":1.25}, {"x":15.25, "y":5.25}, {"x":16.25, "y":5.25}, {"x":17.25, "y":5.25}] + }, + "LAYOUT_tkl_ansi_split_bs_rshift": { + "layout": [{"x":0, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6.5, "y":0}, {"x":7.5, "y":0}, {"x":8.5, "y":0}, {"x":9.5, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"x":17.25, "y":0}, {"x":0, "y":1.25}, {"x":1, "y":1.25}, {"x":2, "y":1.25}, {"x":3, "y":1.25}, {"x":4, "y":1.25}, {"x":5, "y":1.25}, {"x":6, "y":1.25}, {"x":7, "y":1.25}, {"x":8, "y":1.25}, {"x":9, "y":1.25}, {"x":10, "y":1.25}, {"x":11, "y":1.25}, {"x":12, "y":1.25}, {"x":13, "y":1.25}, {"x":14, "y":1.25}, {"x":15.25, "y":1.25}, {"x":16.25, "y":1.25}, {"x":17.25, "y":1.25}, {"x":0, "y":2.25, "w":1.5}, {"x":1.5, "y":2.25}, {"x":2.5, "y":2.25}, {"x":3.5, "y":2.25}, {"x":4.5, "y":2.25}, {"x":5.5, "y":2.25}, {"x":6.5, "y":2.25}, {"x":7.5, "y":2.25}, {"x":8.5, "y":2.25}, {"x":9.5, "y":2.25}, {"x":10.5, "y":2.25}, {"x":11.5, "y":2.25}, {"x":12.5, "y":2.25}, {"x":13.5, "y":2.25, "w":1.5}, {"x":15.25, "y":2.25}, {"x":16.25, "y":2.25}, {"x":17.25, "y":2.25}, {"x":0, "y":3.25, "w":1.75}, {"x":1.75, "y":3.25}, {"x":2.75, "y":3.25}, {"x":3.75, "y":3.25}, {"x":4.75, "y":3.25}, {"x":5.75, "y":3.25}, {"x":6.75, "y":3.25}, {"x":7.75, "y":3.25}, {"x":8.75, "y":3.25}, {"x":9.75, "y":3.25}, {"x":10.75, "y":3.25}, {"x":11.75, "y":3.25}, {"x":12.75, "y":3.25, "w":2.25}, {"x":0, "y":4.25, "w":2.25}, {"x":2.25, "y":4.25}, {"x":3.25, "y":4.25}, {"x":4.25, "y":4.25}, {"x":5.25, "y":4.25}, {"x":6.25, "y":4.25}, {"x":7.25, "y":4.25}, {"x":8.25, "y":4.25}, {"x":9.25, "y":4.25}, {"x":10.25, "y":4.25}, {"x":11.25, "y":4.25}, {"x":12.25, "y":4.25, "w":1.75}, {"x":14, "y":4.25}, {"x":16.25, "y":4.25}, {"x":0, "y":5.25, "w":1.25}, {"x":1.25, "y":5.25, "w":1.25}, {"x":2.5, "y":5.25, "w":1.25}, {"x":3.75, "y":5.25, "w":6.25}, {"x":10, "y":5.25, "w":1.25}, {"x":11.25, "y":5.25, "w":1.25}, {"x":12.5, "y":5.25, "w":1.25}, {"x":13.75, "y":5.25, "w":1.25}, {"x":15.25, "y":5.25}, {"x":16.25, "y":5.25}, {"x":17.25, "y":5.25}] + }, + "LAYOUT_tkl_ansi_tsangan": { + "layout": [{"x":0, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6.5, "y":0}, {"x":7.5, "y":0}, {"x":8.5, "y":0}, {"x":9.5, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"x":17.25, "y":0}, {"x":0, "y":1.25}, {"x":1, "y":1.25}, {"x":2, "y":1.25}, {"x":3, "y":1.25}, {"x":4, "y":1.25}, {"x":5, "y":1.25}, {"x":6, "y":1.25}, {"x":7, "y":1.25}, {"x":8, "y":1.25}, {"x":9, "y":1.25}, {"x":10, "y":1.25}, {"x":11, "y":1.25}, {"x":12, "y":1.25}, {"x":13, "y":1.25, "w":2}, {"x":15.25, "y":1.25}, {"x":16.25, "y":1.25}, {"x":17.25, "y":1.25}, {"x":0, "y":2.25, "w":1.5}, {"x":1.5, "y":2.25}, {"x":2.5, "y":2.25}, {"x":3.5, "y":2.25}, {"x":4.5, "y":2.25}, {"x":5.5, "y":2.25}, {"x":6.5, "y":2.25}, {"x":7.5, "y":2.25}, {"x":8.5, "y":2.25}, {"x":9.5, "y":2.25}, {"x":10.5, "y":2.25}, {"x":11.5, "y":2.25}, {"x":12.5, "y":2.25}, {"x":13.5, "y":2.25, "w":1.5}, {"x":15.25, "y":2.25}, {"x":16.25, "y":2.25}, {"x":17.25, "y":2.25}, {"x":0, "y":3.25, "w":1.75}, {"x":1.75, "y":3.25}, {"x":2.75, "y":3.25}, {"x":3.75, "y":3.25}, {"x":4.75, "y":3.25}, {"x":5.75, "y":3.25}, {"x":6.75, "y":3.25}, {"x":7.75, "y":3.25}, {"x":8.75, "y":3.25}, {"x":9.75, "y":3.25}, {"x":10.75, "y":3.25}, {"x":11.75, "y":3.25}, {"x":12.75, "y":3.25, "w":2.25}, {"x":0, "y":4.25, "w":2.25}, {"x":2.25, "y":4.25}, {"x":3.25, "y":4.25}, {"x":4.25, "y":4.25}, {"x":5.25, "y":4.25}, {"x":6.25, "y":4.25}, {"x":7.25, "y":4.25}, {"x":8.25, "y":4.25}, {"x":9.25, "y":4.25}, {"x":10.25, "y":4.25}, {"x":11.25, "y":4.25}, {"x":12.25, "y":4.25, "w":2.75}, {"x":16.25, "y":4.25}, {"x":0, "y":5.25, "w":1.5}, {"x":1.5, "y":5.25}, {"x":2.5, "y":5.25, "w":1.5}, {"x":4, "y":5.25, "w":7}, {"x":11, "y":5.25, "w":1.5}, {"x":12.5, "y":5.25}, {"x":13.5, "y":5.25, "w":1.5}, {"x":15.25, "y":5.25}, {"x":16.25, "y":5.25}, {"x":17.25, "y":5.25}] + }, + "LAYOUT_tkl_ansi_tsangan_split_bs_rshift": { + "layout": [{"x":0, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6.5, "y":0}, {"x":7.5, "y":0}, {"x":8.5, "y":0}, {"x":9.5, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"x":17.25, "y":0}, {"x":0, "y":1.25}, {"x":1, "y":1.25}, {"x":2, "y":1.25}, {"x":3, "y":1.25}, {"x":4, "y":1.25}, {"x":5, "y":1.25}, {"x":6, "y":1.25}, {"x":7, "y":1.25}, {"x":8, "y":1.25}, {"x":9, "y":1.25}, {"x":10, "y":1.25}, {"x":11, "y":1.25}, {"x":12, "y":1.25}, {"x":13, "y":1.25}, {"x":14, "y":1.25}, {"x":15.25, "y":1.25}, {"x":16.25, "y":1.25}, {"x":17.25, "y":1.25}, {"x":0, "y":2.25, "w":1.5}, {"x":1.5, "y":2.25}, {"x":2.5, "y":2.25}, {"x":3.5, "y":2.25}, {"x":4.5, "y":2.25}, {"x":5.5, "y":2.25}, {"x":6.5, "y":2.25}, {"x":7.5, "y":2.25}, {"x":8.5, "y":2.25}, {"x":9.5, "y":2.25}, {"x":10.5, "y":2.25}, {"x":11.5, "y":2.25}, {"x":12.5, "y":2.25}, {"x":13.5, "y":2.25, "w":1.5}, {"x":15.25, "y":2.25}, {"x":16.25, "y":2.25}, {"x":17.25, "y":2.25}, {"x":0, "y":3.25, "w":1.75}, {"x":1.75, "y":3.25}, {"x":2.75, "y":3.25}, {"x":3.75, "y":3.25}, {"x":4.75, "y":3.25}, {"x":5.75, "y":3.25}, {"x":6.75, "y":3.25}, {"x":7.75, "y":3.25}, {"x":8.75, "y":3.25}, {"x":9.75, "y":3.25}, {"x":10.75, "y":3.25}, {"x":11.75, "y":3.25}, {"x":12.75, "y":3.25, "w":2.25}, {"x":0, "y":4.25, "w":2.25}, {"x":2.25, "y":4.25}, {"x":3.25, "y":4.25}, {"x":4.25, "y":4.25}, {"x":5.25, "y":4.25}, {"x":6.25, "y":4.25}, {"x":7.25, "y":4.25}, {"x":8.25, "y":4.25}, {"x":9.25, "y":4.25}, {"x":10.25, "y":4.25}, {"x":11.25, "y":4.25}, {"x":12.25, "y":4.25, "w":1.75}, {"x":14, "y":4.25}, {"x":16.25, "y":4.25}, {"x":0, "y":5.25, "w":1.5}, {"x":1.5, "y":5.25}, {"x":2.5, "y":5.25, "w":1.5}, {"x":4, "y":5.25, "w":7}, {"x":11, "y":5.25, "w":1.5}, {"x":12.5, "y":5.25}, {"x":13.5, "y":5.25, "w":1.5}, {"x":15.25, "y":5.25}, {"x":16.25, "y":5.25}, {"x":17.25, "y":5.25}] + }, + "LAYOUT_tkl_iso": { + "layout": [{"x":0, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6.5, "y":0}, {"x":7.5, "y":0}, {"x":8.5, "y":0}, {"x":9.5, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"x":17.25, "y":0}, {"x":0, "y":1.25}, {"x":1, "y":1.25}, {"x":2, "y":1.25}, {"x":3, "y":1.25}, {"x":4, "y":1.25}, {"x":5, "y":1.25}, {"x":6, "y":1.25}, {"x":7, "y":1.25}, {"x":8, "y":1.25}, {"x":9, "y":1.25}, {"x":10, "y":1.25}, {"x":11, "y":1.25}, {"x":12, "y":1.25}, {"x":13, "y":1.25, "w":2}, {"x":15.25, "y":1.25}, {"x":16.25, "y":1.25}, {"x":17.25, "y":1.25}, {"x":0, "y":2.25, "w":1.5}, {"x":1.5, "y":2.25}, {"x":2.5, "y":2.25}, {"x":3.5, "y":2.25}, {"x":4.5, "y":2.25}, {"x":5.5, "y":2.25}, {"x":6.5, "y":2.25}, {"x":7.5, "y":2.25}, {"x":8.5, "y":2.25}, {"x":9.5, "y":2.25}, {"x":10.5, "y":2.25}, {"x":11.5, "y":2.25}, {"x":12.5, "y":2.25}, {"x":13.75, "y":2.25, "w":1.25, "h":2}, {"x":15.25, "y":2.25}, {"x":16.25, "y":2.25}, {"x":17.25, "y":2.25}, {"x":0, "y":3.25, "w":1.75}, {"x":1.75, "y":3.25}, {"x":2.75, "y":3.25}, {"x":3.75, "y":3.25}, {"x":4.75, "y":3.25}, {"x":5.75, "y":3.25}, {"x":6.75, "y":3.25}, {"x":7.75, "y":3.25}, {"x":8.75, "y":3.25}, {"x":9.75, "y":3.25}, {"x":10.75, "y":3.25}, {"x":11.75, "y":3.25}, {"x":12.75, "y":3.25}, {"x":0, "y":4.25, "w":1.25}, {"x":1.25, "y":4.25}, {"x":2.25, "y":4.25}, {"x":3.25, "y":4.25}, {"x":4.25, "y":4.25}, {"x":5.25, "y":4.25}, {"x":6.25, "y":4.25}, {"x":7.25, "y":4.25}, {"x":8.25, "y":4.25}, {"x":9.25, "y":4.25}, {"x":10.25, "y":4.25}, {"x":11.25, "y":4.25}, {"x":12.25, "y":4.25, "w":2.75}, {"x":16.25, "y":4.25}, {"x":0, "y":5.25, "w":1.25}, {"x":1.25, "y":5.25, "w":1.25}, {"x":2.5, "y":5.25, "w":1.25}, {"x":3.75, "y":5.25, "w":6.25}, {"x":10, "y":5.25, "w":1.25}, {"x":11.25, "y":5.25, "w":1.25}, {"x":12.5, "y":5.25, "w":1.25}, {"x":13.75, "y":5.25, "w":1.25}, {"x":15.25, "y":5.25}, {"x":16.25, "y":5.25}, {"x":17.25, "y":5.25}] + }, + "LAYOUT_tkl_iso_split_bs_rshift": { + "layout": [{"x":0, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6.5, "y":0}, {"x":7.5, "y":0}, {"x":8.5, "y":0}, {"x":9.5, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"x":17.25, "y":0}, {"x":0, "y":1.25}, {"x":1, "y":1.25}, {"x":2, "y":1.25}, {"x":3, "y":1.25}, {"x":4, "y":1.25}, {"x":5, "y":1.25}, {"x":6, "y":1.25}, {"x":7, "y":1.25}, {"x":8, "y":1.25}, {"x":9, "y":1.25}, {"x":10, "y":1.25}, {"x":11, "y":1.25}, {"x":12, "y":1.25}, {"x":13, "y":1.25}, {"x":14, "y":1.25}, {"x":15.25, "y":1.25}, {"x":16.25, "y":1.25}, {"x":17.25, "y":1.25}, {"x":0, "y":2.25, "w":1.5}, {"x":1.5, "y":2.25}, {"x":2.5, "y":2.25}, {"x":3.5, "y":2.25}, {"x":4.5, "y":2.25}, {"x":5.5, "y":2.25}, {"x":6.5, "y":2.25}, {"x":7.5, "y":2.25}, {"x":8.5, "y":2.25}, {"x":9.5, "y":2.25}, {"x":10.5, "y":2.25}, {"x":11.5, "y":2.25}, {"x":12.5, "y":2.25}, {"x":13.75, "y":2.25, "w":1.25, "h":2}, {"x":15.25, "y":2.25}, {"x":16.25, "y":2.25}, {"x":17.25, "y":2.25}, {"x":0, "y":3.25, "w":1.75}, {"x":1.75, "y":3.25}, {"x":2.75, "y":3.25}, {"x":3.75, "y":3.25}, {"x":4.75, "y":3.25}, {"x":5.75, "y":3.25}, {"x":6.75, "y":3.25}, {"x":7.75, "y":3.25}, {"x":8.75, "y":3.25}, {"x":9.75, "y":3.25}, {"x":10.75, "y":3.25}, {"x":11.75, "y":3.25}, {"x":12.75, "y":3.25}, {"x":0, "y":4.25, "w":1.25}, {"x":1.25, "y":4.25}, {"x":2.25, "y":4.25}, {"x":3.25, "y":4.25}, {"x":4.25, "y":4.25}, {"x":5.25, "y":4.25}, {"x":6.25, "y":4.25}, {"x":7.25, "y":4.25}, {"x":8.25, "y":4.25}, {"x":9.25, "y":4.25}, {"x":10.25, "y":4.25}, {"x":11.25, "y":4.25}, {"x":12.25, "y":4.25, "w":1.75}, {"x":14, "y":4.25}, {"x":16.25, "y":4.25}, {"x":0, "y":5.25, "w":1.25}, {"x":1.25, "y":5.25, "w":1.25}, {"x":2.5, "y":5.25, "w":1.25}, {"x":3.75, "y":5.25, "w":6.25}, {"x":10, "y":5.25, "w":1.25}, {"x":11.25, "y":5.25, "w":1.25}, {"x":12.5, "y":5.25, "w":1.25}, {"x":13.75, "y":5.25, "w":1.25}, {"x":15.25, "y":5.25}, {"x":16.25, "y":5.25}, {"x":17.25, "y":5.25}] + }, + "LAYOUT_tkl_iso_tsangan": { + "layout": [{"x":0, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6.5, "y":0}, {"x":7.5, "y":0}, {"x":8.5, "y":0}, {"x":9.5, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"x":17.25, "y":0}, {"x":0, "y":1.25}, {"x":1, "y":1.25}, {"x":2, "y":1.25}, {"x":3, "y":1.25}, {"x":4, "y":1.25}, {"x":5, "y":1.25}, {"x":6, "y":1.25}, {"x":7, "y":1.25}, {"x":8, "y":1.25}, {"x":9, "y":1.25}, {"x":10, "y":1.25}, {"x":11, "y":1.25}, {"x":12, "y":1.25}, {"x":13, "y":1.25, "w":2}, {"x":15.25, "y":1.25}, {"x":16.25, "y":1.25}, {"x":17.25, "y":1.25}, {"x":0, "y":2.25, "w":1.5}, {"x":1.5, "y":2.25}, {"x":2.5, "y":2.25}, {"x":3.5, "y":2.25}, {"x":4.5, "y":2.25}, {"x":5.5, "y":2.25}, {"x":6.5, "y":2.25}, {"x":7.5, "y":2.25}, {"x":8.5, "y":2.25}, {"x":9.5, "y":2.25}, {"x":10.5, "y":2.25}, {"x":11.5, "y":2.25}, {"x":12.5, "y":2.25}, {"x":13.75, "y":2.25, "w":1.25, "h":2}, {"x":15.25, "y":2.25}, {"x":16.25, "y":2.25}, {"x":17.25, "y":2.25}, {"x":0, "y":3.25, "w":1.75}, {"x":1.75, "y":3.25}, {"x":2.75, "y":3.25}, {"x":3.75, "y":3.25}, {"x":4.75, "y":3.25}, {"x":5.75, "y":3.25}, {"x":6.75, "y":3.25}, {"x":7.75, "y":3.25}, {"x":8.75, "y":3.25}, {"x":9.75, "y":3.25}, {"x":10.75, "y":3.25}, {"x":11.75, "y":3.25}, {"x":12.75, "y":3.25}, {"x":0, "y":4.25, "w":1.25}, {"x":1.25, "y":4.25}, {"x":2.25, "y":4.25}, {"x":3.25, "y":4.25}, {"x":4.25, "y":4.25}, {"x":5.25, "y":4.25}, {"x":6.25, "y":4.25}, {"x":7.25, "y":4.25}, {"x":8.25, "y":4.25}, {"x":9.25, "y":4.25}, {"x":10.25, "y":4.25}, {"x":11.25, "y":4.25}, {"x":12.25, "y":4.25, "w":2.75}, {"x":16.25, "y":4.25}, {"x":0, "y":5.25, "w":1.5}, {"x":1.5, "y":5.25}, {"x":2.5, "y":5.25, "w":1.5}, {"x":4, "y":5.25, "w":7}, {"x":11, "y":5.25, "w":1.5}, {"x":12.5, "y":5.25}, {"x":13.5, "y":5.25, "w":1.5}, {"x":15.25, "y":5.25}, {"x":16.25, "y":5.25}, {"x":17.25, "y":5.25}] + }, + "LAYOUT_tkl_iso_tsangan_split_bs_rshift": { + "layout": [{"x":0, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6.5, "y":0}, {"x":7.5, "y":0}, {"x":8.5, "y":0}, {"x":9.5, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"x":17.25, "y":0}, {"x":0, "y":1.25}, {"x":1, "y":1.25}, {"x":2, "y":1.25}, {"x":3, "y":1.25}, {"x":4, "y":1.25}, {"x":5, "y":1.25}, {"x":6, "y":1.25}, {"x":7, "y":1.25}, {"x":8, "y":1.25}, {"x":9, "y":1.25}, {"x":10, "y":1.25}, {"x":11, "y":1.25}, {"x":12, "y":1.25}, {"x":13, "y":1.25}, {"x":14, "y":1.25}, {"x":15.25, "y":1.25}, {"x":16.25, "y":1.25}, {"x":17.25, "y":1.25}, {"x":0, "y":2.25, "w":1.5}, {"x":1.5, "y":2.25}, {"x":2.5, "y":2.25}, {"x":3.5, "y":2.25}, {"x":4.5, "y":2.25}, {"x":5.5, "y":2.25}, {"x":6.5, "y":2.25}, {"x":7.5, "y":2.25}, {"x":8.5, "y":2.25}, {"x":9.5, "y":2.25}, {"x":10.5, "y":2.25}, {"x":11.5, "y":2.25}, {"x":12.5, "y":2.25}, {"x":13.75, "y":2.25, "w":1.25, "h":2}, {"x":15.25, "y":2.25}, {"x":16.25, "y":2.25}, {"x":17.25, "y":2.25}, {"x":0, "y":3.25, "w":1.75}, {"x":1.75, "y":3.25}, {"x":2.75, "y":3.25}, {"x":3.75, "y":3.25}, {"x":4.75, "y":3.25}, {"x":5.75, "y":3.25}, {"x":6.75, "y":3.25}, {"x":7.75, "y":3.25}, {"x":8.75, "y":3.25}, {"x":9.75, "y":3.25}, {"x":10.75, "y":3.25}, {"x":11.75, "y":3.25}, {"x":12.75, "y":3.25}, {"x":0, "y":4.25, "w":1.25}, {"x":1.25, "y":4.25}, {"x":2.25, "y":4.25}, {"x":3.25, "y":4.25}, {"x":4.25, "y":4.25}, {"x":5.25, "y":4.25}, {"x":6.25, "y":4.25}, {"x":7.25, "y":4.25}, {"x":8.25, "y":4.25}, {"x":9.25, "y":4.25}, {"x":10.25, "y":4.25}, {"x":11.25, "y":4.25}, {"x":12.25, "y":4.25, "w":1.75}, {"x":14, "y":4.25}, {"x":16.25, "y":4.25}, {"x":0, "y":5.25, "w":1.5}, {"x":1.5, "y":5.25}, {"x":2.5, "y":5.25, "w":1.5}, {"x":4, "y":5.25, "w":7}, {"x":11, "y":5.25, "w":1.5}, {"x":12.5, "y":5.25}, {"x":13.5, "y":5.25, "w":1.5}, {"x":15.25, "y":5.25}, {"x":16.25, "y":5.25}, {"x":17.25, "y":5.25}] + } + } +} diff --git a/keyboards/baion_808/keymaps/default/keymap.c b/keyboards/baion_808/keymaps/default/keymap.c new file mode 100644 index 000000000000..862a28cd81a3 --- /dev/null +++ b/keyboards/baion_808/keymaps/default/keymap.c @@ -0,0 +1,27 @@ +/* Copyright 2022 Yiancar-Designs + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_all( /* Base */ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, + + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, 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_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT) +}; diff --git a/keyboards/baion_808/keymaps/via/keymap.c b/keyboards/baion_808/keymaps/via/keymap.c new file mode 100644 index 000000000000..81edc335341e --- /dev/null +++ b/keyboards/baion_808/keymaps/via/keymap.c @@ -0,0 +1,54 @@ +/* Copyright 2022 Yiancar-Designs + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_all( /* Base */ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, + + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, 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_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + +[1] = LAYOUT_all( /* Empty for dynamic keymaps */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +[2] = LAYOUT_all( /* Empty for dynamic keymaps */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +[3] = LAYOUT_all( /* Empty for dynamic keymaps */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; diff --git a/keyboards/baion_808/keymaps/via/rules.mk b/keyboards/baion_808/keymaps/via/rules.mk new file mode 100755 index 000000000000..1e5b99807cb7 --- /dev/null +++ b/keyboards/baion_808/keymaps/via/rules.mk @@ -0,0 +1 @@ +VIA_ENABLE = yes diff --git a/keyboards/baion_808/readme.md b/keyboards/baion_808/readme.md new file mode 100755 index 000000000000..751f1793d45d --- /dev/null +++ b/keyboards/baion_808/readme.md @@ -0,0 +1,38 @@ +# Baion 808 + +This is a standard TKL layout PCB. It supports VIA. + +* Keyboard Maintainer: [Yiancar](http://yiancar-designs.com/) and on [GitHub](https://github.com/yiancar) +* Hardware Supported: A TKL keyboard with STM32F072CB +* Hardware Availability: https://baionlenja.com + +![Layer 0](https://i.imgur.com/IhbvSZ1.png) + +## Instructions + +### Build + +Make example for this keyboard (after setting up your build environment): + + make baion_808:default + +Flashing example for this keyboard: + + make baion_808:default:flash + +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). + +### Reset + +- Unplug +- Hold Escape +- Plug In +- Unplug +- Release Escape + +### Flash + +- Unplug +- Hold Escape +- Plug In +- Flash using QMK Toolbox or CLI (`make baion_808::flash`) diff --git a/keyboards/baion_808/rules.mk b/keyboards/baion_808/rules.mk new file mode 100755 index 000000000000..5d2ff6287791 --- /dev/null +++ b/keyboards/baion_808/rules.mk @@ -0,0 +1,22 @@ +# Wildcard to allow APM32 MCU +DFU_SUFFIX_ARGS = -v FFFF -p FFFF + +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. +OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output + +LAYOUTS = tkl_ansi tkl_ansi_tsangan tkl_ansi_split_bs_rshift tkl_ansi_tsangan_split_bs_rshift tkl_iso tkl_iso_split_bs_rshift tkl_iso_tsangan tkl_iso_tsangan_split_bs_rshift From 328279ac592bcb61fcc12097287a75bfaa5e7a3d Mon Sep 17 00:00:00 2001 From: Wolf Van Herreweghe Date: Sun, 29 Jan 2023 23:58:07 +0100 Subject: [PATCH 09/10] Add base firmware for the Frog Numpad (#19698) Co-authored-by: Wolf Van Herreweghe Co-authored-by: Drashna Jaelre Co-authored-by: jack <0x6a73@protonmail.com> --- keyboards/wolf/frogpad/frogpad.c | 38 ++++++++ keyboards/wolf/frogpad/info.json | 93 +++++++++++++++++++ .../wolf/frogpad/keymaps/default/keymap.c | 48 ++++++++++ .../wolf/frogpad/keymaps/default/rules.mk | 1 + keyboards/wolf/frogpad/keymaps/via/keymap.c | 70 ++++++++++++++ keyboards/wolf/frogpad/keymaps/via/rules.mk | 2 + keyboards/wolf/frogpad/readme.md | 25 +++++ keyboards/wolf/frogpad/rules.mk | 2 + 8 files changed, 279 insertions(+) create mode 100644 keyboards/wolf/frogpad/frogpad.c create mode 100644 keyboards/wolf/frogpad/info.json create mode 100644 keyboards/wolf/frogpad/keymaps/default/keymap.c create mode 100644 keyboards/wolf/frogpad/keymaps/default/rules.mk create mode 100644 keyboards/wolf/frogpad/keymaps/via/keymap.c create mode 100644 keyboards/wolf/frogpad/keymaps/via/rules.mk create mode 100644 keyboards/wolf/frogpad/readme.md create mode 100644 keyboards/wolf/frogpad/rules.mk diff --git a/keyboards/wolf/frogpad/frogpad.c b/keyboards/wolf/frogpad/frogpad.c new file mode 100644 index 000000000000..ae6a2e0e179e --- /dev/null +++ b/keyboards/wolf/frogpad/frogpad.c @@ -0,0 +1,38 @@ +/* +Copyright 2023 + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "quantum.h" + +#ifdef ENCODER_ENABLE +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 0) { + if (clockwise) { + tap_code_delay(KC_VOLU, 10); + } else { + tap_code_delay(KC_VOLD, 10); + } + } else if (index == 1) { /* Second encoder */ + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } + return true; +} +#endif \ No newline at end of file diff --git a/keyboards/wolf/frogpad/info.json b/keyboards/wolf/frogpad/info.json new file mode 100644 index 000000000000..4efd640ba054 --- /dev/null +++ b/keyboards/wolf/frogpad/info.json @@ -0,0 +1,93 @@ +{ + "manufacturer": "Geon", + "keyboard_name": "Frog Pad", + "maintainer": "ToastyStoemp", + "bootloader": "atmel-dfu", + "diode_direction": "COL2ROW", + "features": { + "bootmagic": true, + "command": false, + "console": false, + "extrakey": true, + "mousekey": true, + "nkro": true, + "encoder": true + }, + "matrix_pins": { + "cols": ["F5", "F6", "B7", "B3"], + "rows": ["F0", "B6", "D6", "B5", "D7", "B4"] + }, + "encoder": { + "rotary": [ + { "pin_a": "F4", "pin_b": "F1" }, + { "pin_a": "B1", "pin_b": "B2" } + ] + }, + "processor": "atmega32u4", + "url": "https://geon.works/products/frog-pad", + "usb": { + "device_version": "1.0.0", + "pid": "0x0004", + "vid": "0x5453" + }, + "layouts": { + "LAYOUT_numpad_6x4": { + "layout": [ + {"matrix": [0, 0], "x":0, "y":0}, + {"matrix": [0, 1], "x":1, "y":0}, + {"matrix": [0, 2], "x":2, "y":0}, + {"matrix": [0, 3], "x":3, "y":0}, + + {"matrix": [1, 0], "x":0, "y":1}, + {"matrix": [1, 1], "x":1, "y":1}, + {"matrix": [1, 2], "x":2, "y":1}, + {"matrix": [1, 3], "x":3, "y":1}, + + {"matrix": [2, 0], "x":0, "y":2}, + {"matrix": [2, 1], "x":1, "y":2}, + {"matrix": [2, 2], "x":2, "y":2}, + + {"matrix": [3, 0], "x":0, "y":3}, + {"matrix": [3, 1], "x":1, "y":3}, + {"matrix": [3, 2], "x":2, "y":3}, + {"matrix": [2, 3], "x":3, "y":2, "h":2}, + + {"matrix": [4, 0], "x":0, "y":4}, + {"matrix": [4, 1], "x":1, "y":4}, + {"matrix": [4, 2], "x":2, "y":4}, + + {"matrix": [5, 0], "x":0, "y":5, "w":2}, + {"matrix": [5, 2], "x":2, "y":5}, + {"matrix": [4, 3], "x":3, "y":4, "h":2} + ] + }, + "LAYOUT_ortho_6x4": { + "layout": [ + { "matrix": [0, 0], "x": 0, "y": 0 }, + { "matrix": [0, 1], "x": 1, "y": 0 }, + { "matrix": [0, 2], "x": 2, "y": 0 }, + { "matrix": [0, 3], "x": 3, "y": 0 }, + { "matrix": [1, 0], "x": 0, "y": 1 }, + { "matrix": [1, 1], "x": 1, "y": 1 }, + { "matrix": [1, 2], "x": 2, "y": 1 }, + { "matrix": [1, 3], "x": 3, "y": 1 }, + { "matrix": [2, 0], "x": 0, "y": 2 }, + { "matrix": [2, 1], "x": 1, "y": 2 }, + { "matrix": [2, 2], "x": 2, "y": 2 }, + { "matrix": [2, 3], "x": 3, "y": 2 }, + { "matrix": [3, 0], "x": 0, "y": 3 }, + { "matrix": [3, 1], "x": 1, "y": 3 }, + { "matrix": [3, 2], "x": 2, "y": 3 }, + { "matrix": [3, 3], "x": 3, "y": 3 }, + { "matrix": [4, 0], "x": 0, "y": 4 }, + { "matrix": [4, 1], "x": 1, "y": 4 }, + { "matrix": [4, 2], "x": 2, "y": 4 }, + { "matrix": [4, 3], "x": 3, "y": 4 }, + { "matrix": [5, 0], "x": 0, "y": 5 }, + { "matrix": [5, 1], "x": 1, "y": 5 }, + { "matrix": [5, 2], "x": 2, "y": 5 }, + { "matrix": [5, 3], "x": 3, "y": 5 } + ] + } + } +} \ No newline at end of file diff --git a/keyboards/wolf/frogpad/keymaps/default/keymap.c b/keyboards/wolf/frogpad/keymaps/default/keymap.c new file mode 100644 index 000000000000..e7f88542bcc2 --- /dev/null +++ b/keyboards/wolf/frogpad/keymaps/default/keymap.c @@ -0,0 +1,48 @@ +/* +Copyright 2020 +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H + +enum layers { + _LAYER0, + _LAYER1, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_LAYER0] = LAYOUT_ortho_6x4( + KC_F1, KC_F2, KC_F3, KC_F4, + KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, + KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_P4, KC_P5, KC_P6, KC_TRNS, + KC_P1, KC_P2, KC_P3, KC_PENT, + KC_P0, KC_PDOT, KC_PDOT, MO(1) + ), + + [_LAYER1] = LAYOUT_ortho_6x4( + QK_BOOT, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_HOME, KC_UP, KC_PGUP, KC_TRNS, + KC_LEFT, KC_TRNS, KC_RGHT, KC_TRNS, + KC_END, KC_DOWN, KC_PGDN, KC_TRNS, + KC_INS, KC_TRNS, KC_DEL, KC_TRNS + ) +}; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [_LAYER0] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [_LAYER1] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) } +}; +#endif \ No newline at end of file diff --git a/keyboards/wolf/frogpad/keymaps/default/rules.mk b/keyboards/wolf/frogpad/keymaps/default/rules.mk new file mode 100644 index 000000000000..a40474b4d5c7 --- /dev/null +++ b/keyboards/wolf/frogpad/keymaps/default/rules.mk @@ -0,0 +1 @@ +ENCODER_MAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/wolf/frogpad/keymaps/via/keymap.c b/keyboards/wolf/frogpad/keymaps/via/keymap.c new file mode 100644 index 000000000000..0a95b54b66a7 --- /dev/null +++ b/keyboards/wolf/frogpad/keymaps/via/keymap.c @@ -0,0 +1,70 @@ +/* +Copyright 2020 +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H + +enum layers { + _LAYER0, + _LAYER1, + _LAYER2, + _LAYER3 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_LAYER0] = LAYOUT_ortho_6x4( + KC_F1, KC_F2, KC_F3, KC_F4, + KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, + KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_P4, KC_P5, KC_P6, KC_TRNS, + KC_P1, KC_P2, KC_P3, KC_PENT, + KC_P0, KC_PDOT, KC_PDOT, MO(1) + ), + + [_LAYER1] = LAYOUT_ortho_6x4( + QK_BOOT, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_HOME, KC_UP, KC_PGUP, KC_TRNS, + KC_LEFT, KC_TRNS, KC_RGHT, KC_TRNS, + KC_END, KC_DOWN, KC_PGDN, KC_TRNS, + KC_INS, KC_TRNS, KC_DEL, KC_TRNS + ), + + [_LAYER2] = LAYOUT_ortho_6x4( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + [_LAYER3] = LAYOUT_ortho_6x4( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) +}; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [_LAYER0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN) }, + [_LAYER1] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) }, + [_LAYER2] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) }, + [_LAYER3] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) } +}; +#endif \ No newline at end of file diff --git a/keyboards/wolf/frogpad/keymaps/via/rules.mk b/keyboards/wolf/frogpad/keymaps/via/rules.mk new file mode 100644 index 000000000000..4253f570f0bb --- /dev/null +++ b/keyboards/wolf/frogpad/keymaps/via/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +ENCODER_MAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/wolf/frogpad/readme.md b/keyboards/wolf/frogpad/readme.md new file mode 100644 index 000000000000..b797d37fd7d9 --- /dev/null +++ b/keyboards/wolf/frogpad/readme.md @@ -0,0 +1,25 @@ +# Frog Pad + +The following is the QMK Firmware for the Frog Pad PCB. + +The PCB features: +* QMK & VIA compatibility +* 2 Encoders + +--- + +* Keyboard Maintainer: [ToastyStoemp](https://github.com/ToastyStoemp) + +Make example for this keyboard (after setting up your build environment): + + make wolf/frogpad:default + +Flashing example for this keyboard: + + make wolf/frogpad:default:flash + +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). + +## Bootloader Enter the bootloader in 3 ways: +* **Bootmagic reset**: Hold down the key ESC key and plug in the keyboard (Top Left most switch) +* **Reset Pads**: Briefly short the pads labeled `QK_BOOT` on the back of the PCB diff --git a/keyboards/wolf/frogpad/rules.mk b/keyboards/wolf/frogpad/rules.mk new file mode 100644 index 000000000000..3437a35bdf1d --- /dev/null +++ b/keyboards/wolf/frogpad/rules.mk @@ -0,0 +1,2 @@ +# Processor frequency +F_CPU = 8000000 From 2c878b1b161ae10332fdc4d69f3d1f86d2726c5c Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 30 Jan 2023 14:37:02 +1100 Subject: [PATCH 10/10] Clean up `qmk generate-autocorrect-data` (#19710) --- docs/feature_autocorrect.md | 6 +- .../qmk/cli/generate/autocorrect_data.py | 82 +++++++++---------- 2 files changed, 42 insertions(+), 46 deletions(-) diff --git a/docs/feature_autocorrect.md b/docs/feature_autocorrect.md index e042027c0faa..aa8d37817d0c 100644 --- a/docs/feature_autocorrect.md +++ b/docs/feature_autocorrect.md @@ -86,7 +86,7 @@ The `qmk generate-autocorrect-data` commands can make an effort to check for ent ## Overriding Autocorrect -Occasionally you might actually want to type a typo (for instance, while editing autocorrection_dict.txt) without being autocorrected. There are a couple of ways to do this: +Occasionally you might actually want to type a typo (for instance, while editing autocorrect_dict.txt) without being autocorrected. There are a couple of ways to do this: 1. Begin typing the typo. 2. Before typing the last letter, press and release the Ctrl or Alt key. @@ -238,13 +238,13 @@ bool apply_autocorrect(uint8_t backspaces, const char *str) { ## Appendix: Trie binary data format :id=appendix -This section details how the trie is serialized to byte data in autocorrection_data. You don’t need to care about this to use this autocorrection implementation. But it is documented for the record in case anyone is interested in modifying the implementation, or just curious how it works. +This section details how the trie is serialized to byte data in autocorrect_data. You don’t need to care about this to use this autocorrection implementation. But it is documented for the record in case anyone is interested in modifying the implementation, or just curious how it works. What I did here is fairly arbitrary, but it is simple to decode and gets the job done. ### Encoding :id=encoding -All autocorrection data is stored in a single flat array autocorrection_data. Each trie node is associated with a byte offset into this array, where data for that node is encoded, beginning with root at offset 0. There are three kinds of nodes. The highest two bits of the first byte of the node indicate what kind: +All autocorrection data is stored in a single flat array autocorrect_data. Each trie node is associated with a byte offset into this array, where data for that node is encoded, beginning with root at offset 0. There are three kinds of nodes. The highest two bits of the first byte of the node indicate what kind: * 00 ⇒ chain node: a trie node with a single child. * 01 ⇒ branching node: a trie node with multiple children. diff --git a/lib/python/qmk/cli/generate/autocorrect_data.py b/lib/python/qmk/cli/generate/autocorrect_data.py index 00ab6180ab0d..5b70e0cb4e16 100644 --- a/lib/python/qmk/cli/generate/autocorrect_data.py +++ b/lib/python/qmk/cli/generate/autocorrect_data.py @@ -33,9 +33,11 @@ from milc import cli -import qmk.path +from qmk.commands import dump_lines +from qmk.constants import GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE from qmk.keyboard import keyboard_completer, keyboard_folder from qmk.keymap import keymap_completer, locate_keymap +from qmk.path import normpath KC_A = 4 KC_SPC = 0x2c @@ -63,9 +65,10 @@ def parse_file(file_name: str) -> List[Tuple[str, str]]: try: from english_words import english_words_lower_alpha_set as correct_words except ImportError: - cli.echo('Autocorrection will falsely trigger when a typo is a substring of a correctly spelled word.') - cli.echo('To check for this, install the english_words package and rerun this script:') - cli.echo(' {fg_cyan}python3 -m pip install english_words') + if not cli.args.quiet: + cli.echo('Autocorrection will falsely trigger when a typo is a substring of a correctly spelled word.') + cli.echo('To check for this, install the english_words package and rerun this script:') + cli.echo(' {fg_cyan}python3 -m pip install english_words') # Use a minimal word list as a fallback. correct_words = ('information', 'available', 'international', 'language', 'loosest', 'reference', 'wealthier', 'entertainment', 'association', 'provides', 'technology', 'statehood') @@ -232,58 +235,51 @@ def encode_link(link: Dict[str, Any]) -> List[int]: return [byte_offset & 255, byte_offset >> 8] -def write_generated_code(autocorrections: List[Tuple[str, str]], data: List[int], file_name: str) -> None: - """Writes autocorrection data as generated C code to `file_name`. - Args: - autocorrections: List of (typo, correction) tuples. - data: List of ints in 0-255, the serialized trie. - file_name: String, path of the output C file. - """ - assert all(0 <= b <= 255 for b in data) - - def typo_len(e: Tuple[str, str]) -> int: - return len(e[0]) +def typo_len(e: Tuple[str, str]) -> int: + return len(e[0]) - min_typo = min(autocorrections, key=typo_len)[0] - max_typo = max(autocorrections, key=typo_len)[0] - generated_code = ''.join([ - '// Generated code.\n\n', f'// Autocorrection dictionary ({len(autocorrections)} entries):\n', ''.join(sorted(f'// {typo:<{len(max_typo)}} -> {correction}\n' for typo, correction in autocorrections)), - f'\n#define AUTOCORRECT_MIN_LENGTH {len(min_typo)} // "{min_typo}"\n', f'#define AUTOCORRECT_MAX_LENGTH {len(max_typo)} // "{max_typo}"\n\n', f'#define DICTIONARY_SIZE {len(data)}\n\n', - textwrap.fill('static const uint8_t autocorrect_data[DICTIONARY_SIZE] PROGMEM = {%s};' % (', '.join(map(str, data))), width=120, subsequent_indent=' '), '\n\n' - ]) - with open(file_name, 'wt') as f: - f.write(generated_code) +def to_hex(b: int) -> str: + return f'0x{b:02X}' -@cli.argument('filename', default='autocorrect_dict.txt', help='The autocorrection database file') +@cli.argument('filename', type=normpath, help='The autocorrection database file') @cli.argument('-kb', '--keyboard', type=keyboard_folder, completer=keyboard_completer, help='The keyboard to build a firmware for. Ignored when a configurator export is supplied.') @cli.argument('-km', '--keymap', completer=keymap_completer, help='The keymap to build a firmware for. Ignored when a configurator export is supplied.') -@cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to') +@cli.argument('-o', '--output', arg_only=True, type=normpath, help='File to write to') +@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages") @cli.subcommand('Generate the autocorrection data file from a dictionary file.') def generate_autocorrect_data(cli): autocorrections = parse_file(cli.args.filename) trie = make_trie(autocorrections) data = serialize_trie(autocorrections, trie) - # Environment processing - if cli.args.output == '-': - cli.args.output = None - if cli.args.output: - cli.args.output.parent.mkdir(parents=True, exist_ok=True) - cli.log.info('Creating autocorrect database at {fg_cyan}%s', cli.args.output) - write_generated_code(autocorrections, data, cli.args.output) + current_keyboard = cli.args.keyboard or cli.config.user.keyboard or cli.config.generate_autocorrect_data.keyboard + current_keymap = cli.args.keymap or cli.config.user.keymap or cli.config.generate_autocorrect_data.keymap + + if current_keyboard and current_keymap: + cli.args.output = locate_keymap(current_keyboard, current_keymap).parent / 'autocorrect_data.h' - else: - current_keyboard = cli.args.keyboard or cli.config.user.keyboard or cli.config.generate_autocorrect_data.keyboard - current_keymap = cli.args.keymap or cli.config.user.keymap or cli.config.generate_autocorrect_data.keymap + assert all(0 <= b <= 255 for b in data) - if current_keyboard and current_keymap: - filename = locate_keymap(current_keyboard, current_keymap).parent / 'autocorrect_data.h' - cli.log.info('Creating autocorrect database at {fg_cyan}%s', filename) - write_generated_code(autocorrections, data, filename) + min_typo = min(autocorrections, key=typo_len)[0] + max_typo = max(autocorrections, key=typo_len)[0] - else: - write_generated_code(autocorrections, data, 'autocorrect_data.h') + # Build the autocorrect_data.h file. + autocorrect_data_h_lines = [GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE, '#pragma once', ''] - cli.log.info('Processed %d autocorrection entries to table with %d bytes.', len(autocorrections), len(data)) + autocorrect_data_h_lines.append(f'// Autocorrection dictionary ({len(autocorrections)} entries):') + for typo, correction in autocorrections: + autocorrect_data_h_lines.append(f'// {typo:<{len(max_typo)}} -> {correction}') + + autocorrect_data_h_lines.append('') + autocorrect_data_h_lines.append(f'#define AUTOCORRECT_MIN_LENGTH {len(min_typo)} // "{min_typo}"') + autocorrect_data_h_lines.append(f'#define AUTOCORRECT_MAX_LENGTH {len(max_typo)} // "{max_typo}"') + autocorrect_data_h_lines.append(f'#define DICTIONARY_SIZE {len(data)}') + autocorrect_data_h_lines.append('') + autocorrect_data_h_lines.append('static const uint8_t autocorrect_data[DICTIONARY_SIZE] PROGMEM = {') + autocorrect_data_h_lines.append(textwrap.fill(' %s' % (', '.join(map(to_hex, data))), width=100, subsequent_indent=' ')) + autocorrect_data_h_lines.append('};') + + # Show the results + dump_lines(cli.args.output, autocorrect_data_h_lines, cli.args.quiet)