From 5e9caf3bf45a896f6bff3d174aeb9518d531b6ed Mon Sep 17 00:00:00 2001 From: Lei Yu Date: Fri, 25 Sep 2020 09:54:49 +0800 Subject: [PATCH 1/8] added replacement pcb for the matrix cain keyboard --- keyboards/matrix/cain/cain.c | 38 ++++++++++++ keyboards/matrix/cain/cain.h | 40 +++++++++++++ keyboards/matrix/cain/config.h | 58 +++++++++++++++++++ keyboards/matrix/cain/info.json | 12 ++++ .../matrix/cain/keymaps/default/keymap.c | 40 +++++++++++++ keyboards/matrix/cain/read.md | 15 +++++ keyboards/matrix/cain/rules.mk | 18 ++++++ 7 files changed, 221 insertions(+) create mode 100644 keyboards/matrix/cain/cain.c create mode 100644 keyboards/matrix/cain/cain.h create mode 100644 keyboards/matrix/cain/config.h create mode 100644 keyboards/matrix/cain/info.json create mode 100644 keyboards/matrix/cain/keymaps/default/keymap.c create mode 100644 keyboards/matrix/cain/read.md create mode 100644 keyboards/matrix/cain/rules.mk diff --git a/keyboards/matrix/cain/cain.c b/keyboards/matrix/cain/cain.c new file mode 100644 index 000000000000..f0ceba1ee287 --- /dev/null +++ b/keyboards/matrix/cain/cain.c @@ -0,0 +1,38 @@ +/** + * cain.c + * + Copyright 2020 astro + + 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 "cain.h" + +void matrix_init_user(void) +{ + setPinOutput(NUM_PIN); + setPinOutput(CAPS_PIN); + setPinOutput(SCROLL_PIN); +} + +bool led_update_kb(led_t led_state) +{ + bool res = led_update_user(led_state); + if (res) { + writePin(NUM_PIN, !led_state.num_lock); + writePin(CAPS_PIN, !led_state.caps_lock); + writePin(SCROLL_PIN, !led_state.scroll_lock); + } + return res; +} diff --git a/keyboards/matrix/cain/cain.h b/keyboards/matrix/cain/cain.h new file mode 100644 index 000000000000..175a946a3eb4 --- /dev/null +++ b/keyboards/matrix/cain/cain.h @@ -0,0 +1,40 @@ +/** + * cain.h + * + Copyright 2020 astro + + 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 "quantum.h" + +#define LAYOUT_default( \ + k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010, k011, k012, k013, k014, k015, \ + k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110, k111, k112, k113, k114, k115, k116, k117, k118, k119, k120, \ + k200, k201, k202, k203, k204, k205, k206, k207, k208, k209, k210, k211, k212, k213, k214, k215, k216, k217, k218, k219, k220, \ + k300, k301, k302, k303, k304, k305, k306, k307, k308, k309, k310, k311, k312, k313, k314, k315, k316, \ + k400, k401, k402, k403, k404, k405, k406, k407, k408, k409, k410, k411, k412, k413, k414, k415, k416, \ + k500, k501, k502, k503, k504, k505, k506, k507, k508, k509, k510, k511, k512, k513 \ +) { \ + { k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010, k011}, \ + { k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110, k111}, \ + { k200, k201, k202, k203, k204, k205, k206, k207, k208, k209, k210, k211}, \ + { k300, k301, k302, k303, k304, k305, k306, k307, k308, k309, k310, k311}, \ + { k400, k401, k402, k403, k404, k405, k406, k407, k408, k409, k410, k411}, \ + { k012, k113, k112, k212, k213, k312, k412, k413, k414, k415, k316, k315}, \ + { k114, k115, k116, k117, k217, k216, k215, k214, k313, k314, k416}, \ + { k013, k014, k015, k120, k119, k118, k218, k219, k220, k511, k512, k513}, \ + { k500, k501, k502, k503, k504, k505, k506, k507, k508, k509, k510} \ +} diff --git a/keyboards/matrix/cain/config.h b/keyboards/matrix/cain/config.h new file mode 100644 index 000000000000..6245ff6115d3 --- /dev/null +++ b/keyboards/matrix/cain/config.h @@ -0,0 +1,58 @@ +/** + * config.h + * + Copyright 2020 astro + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x4D58 // MX +#define PRODUCT_ID 0x0106 // matrix cain +#define DEVICE_VER 0x0001 +#define MANUFACTURER matrix +#define PRODUCT Cain Keyboard + +/* key matrix size */ +#define MATRIX_ROWS 9 +#define MATRIX_COLS 12 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { F0, C7, C6, D5, D2, D4, D7, B7, D1 } +#define MATRIX_COL_PINS { F1, F4, F5, F6, B5, B6, B3, B2, B1, D0, B4, D6} +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +#define RGB_DI_PIN E6 + +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS + +#define RGBLED_NUM 14 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#define RGBLIGHT_SLEEP +#define RGBLIGHT_LED_MAP { 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0, 1, 2, 3 } +#endif + +#define CAPS_PIN D3 +#define NUM_PIN F7 +#define SCROLL_PIN B0 diff --git a/keyboards/matrix/cain/info.json b/keyboards/matrix/cain/info.json new file mode 100644 index 000000000000..a12fabe5d585 --- /dev/null +++ b/keyboards/matrix/cain/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Matrix Cain Keyboard", + "url": "", + "maintainer": "qmk", + "width": 23, + "height": 6.5, + "layouts": { + "LAYOUT_default": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":20, "y":0}, {"label":"Scroll Lock", "x":21, "y":0}, {"label":"Pause", "x":22, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Backspace", "x":13, "y":1.5, "w":2}, {"label":"Num Lock", "x":15.5, "y":1.5}, {"label":"/", "x":16.5, "y":1.5}, {"label":"*", "x":17.5, "y":1.5}, {"label":"-", "x":18.5, "y":1.5}, {"label":"Insert", "x":20, "y":1.5}, {"label":"Home", "x":21, "y":1.5}, {"label":"PgUp", "x":22, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"7", "x":15.5, "y":2.5}, {"label":"8", "x":16.5, "y":2.5}, {"label":"9", "x":17.5, "y":2.5}, {"label":"+", "x":18.5, "y":2.5}, {"label":"Delete", "x":20, "y":2.5}, {"label":"End", "x":21, "y":2.5}, {"label":"PgDn", "x":22, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, {"label":"4", "x":15.5, "y":3.5}, {"label":"5", "x":16.5, "y":3.5}, {"label":"6", "x":17.5, "y":3.5}, {"label":"+", "x":18.5, "y":3.5}, {"label":"Shift", "x":0, "y":4.5, "w":2.25}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, {"label":"1", "x":15.5, "y":4.5}, {"label":"2", "x":16.5, "y":4.5}, {"label":"3", "x":17.5, "y":4.5}, {"label":"Enter", "x":18.5, "y":4.5}, {"label":"\u2191", "x":21, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.5}, {"label":"Win", "x":1.5, "y":5.5}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.5}, {"x":4, "y":5.5, "w":7}, {"label":"Alt", "x":11, "y":5.5, "w":1.5}, {"label":"Win", "x":12.5, "y":5.5}, {"label":"Ctrl", "x":13.5, "y":5.5, "w":1.5}, {"label":"0", "x":15.5, "y":5.5}, {"label":"0", "x":16.5, "y":5.5}, {"label":".", "x":17.5, "y":5.5}, {"label":"Enter", "x":18.5, "y":5.5}, {"label":"\u2190", "x":20, "y":5.5}, {"label":"\u2193", "x":21, "y":5.5}, {"label":"\u2192", "x":22, "y":5.5}] + } + } +} diff --git a/keyboards/matrix/cain/keymaps/default/keymap.c b/keyboards/matrix/cain/keymaps/default/keymap.c new file mode 100644 index 000000000000..7af0f38b5c84 --- /dev/null +++ b/keyboards/matrix/cain/keymaps/default/keymap.c @@ -0,0 +1,40 @@ +/** + * keymap.c + * + Copyright 2020 astro + + 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_default( + 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_SLCK, LT(1,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_NLCK, KC_PSLS, KC_PAST, KC_PMNS, 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_P7, KC_P8, KC_P9, KC_PPLS, 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_P4, KC_P5, KC_P6, KC_PPLS, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_P1, KC_P2, KC_P3, KC_PENT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_P0, KC_P0, KC_PDOT, KC_PENT, KC_LEFT, KC_DOWN, KC_RGHT), + + [1]=LAYOUT_default( + KC_MUTE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,_______,_______,_______,_______, _______, _______, + KC_NLCK, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______,_______,_______,_______,_______, _______, _______, + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,_______,_______,_______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,_______,_______,_______, KC_VOLU, + _______, _______, _______, KC_MPLY, _______, _______, _______, _______,_______,_______,_______, KC_MPRV, KC_VOLD, KC_MNXT), +}; diff --git a/keyboards/matrix/cain/read.md b/keyboards/matrix/cain/read.md new file mode 100644 index 000000000000..34d7cdedb021 --- /dev/null +++ b/keyboards/matrix/cain/read.md @@ -0,0 +1,15 @@ +# Matrix Cain keyboard + +This was the replacement PCB for the Matrix Cain keyboard. + +This firmware DO NOT support the original PCB shipped with the Cain keybaord. + +* Keyboard Maintainer: [astro](https://github.com/yulei) +* Hardware Supported: Matrix cain keyboard +* Hardware Availability: Matrix Lab + +Make example for this keyboard (after setting up your build environment): + + make matrix/cain:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/matrix/cain/rules.mk b/keyboards/matrix/cain/rules.mk new file mode 100644 index 000000000000..1b1ddca4d16d --- /dev/null +++ b/keyboards/matrix/cain/rules.mk @@ -0,0 +1,18 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = atmel-dfu + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +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 +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow From f7665deec7710f27216cda6b610f935419606acf Mon Sep 17 00:00:00 2001 From: Lei Yu Date: Fri, 25 Sep 2020 11:15:57 +0800 Subject: [PATCH 2/8] update usb descriptor --- keyboards/matrix/cain/config.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/matrix/cain/config.h b/keyboards/matrix/cain/config.h index 6245ff6115d3..6bacf1c94996 100644 --- a/keyboards/matrix/cain/config.h +++ b/keyboards/matrix/cain/config.h @@ -23,10 +23,10 @@ /* USB Device descriptor parameter */ #define VENDOR_ID 0x4D58 // MX -#define PRODUCT_ID 0x0106 // matrix cain +#define PRODUCT_ID 0x0106 // cain #define DEVICE_VER 0x0001 -#define MANUFACTURER matrix -#define PRODUCT Cain Keyboard +#define MANUFACTURER Matrix LAB +#define PRODUCT Matrix Cain Keyboard /* key matrix size */ #define MATRIX_ROWS 9 From 471568e304bf3c92e0dd63f1a9e3930f42cc811e Mon Sep 17 00:00:00 2001 From: Lei Yu Date: Sun, 27 Sep 2020 09:38:30 +0800 Subject: [PATCH 3/8] fixed led polarity --- keyboards/matrix/cain/cain.c | 6 +++--- keyboards/matrix/cain/cain.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/matrix/cain/cain.c b/keyboards/matrix/cain/cain.c index f0ceba1ee287..aabdb6c74ed8 100644 --- a/keyboards/matrix/cain/cain.c +++ b/keyboards/matrix/cain/cain.c @@ -30,9 +30,9 @@ bool led_update_kb(led_t led_state) { bool res = led_update_user(led_state); if (res) { - writePin(NUM_PIN, !led_state.num_lock); - writePin(CAPS_PIN, !led_state.caps_lock); - writePin(SCROLL_PIN, !led_state.scroll_lock); + writePin(NUM_PIN, led_state.num_lock); + writePin(CAPS_PIN, led_state.caps_lock); + writePin(SCROLL_PIN, led_state.scroll_lock); } return res; } diff --git a/keyboards/matrix/cain/cain.h b/keyboards/matrix/cain/cain.h index 175a946a3eb4..5b9f7bd90402 100644 --- a/keyboards/matrix/cain/cain.h +++ b/keyboards/matrix/cain/cain.h @@ -26,7 +26,7 @@ k200, k201, k202, k203, k204, k205, k206, k207, k208, k209, k210, k211, k212, k213, k214, k215, k216, k217, k218, k219, k220, \ k300, k301, k302, k303, k304, k305, k306, k307, k308, k309, k310, k311, k312, k313, k314, k315, k316, \ k400, k401, k402, k403, k404, k405, k406, k407, k408, k409, k410, k411, k412, k413, k414, k415, k416, \ - k500, k501, k502, k503, k504, k505, k506, k507, k508, k509, k510, k511, k512, k513 \ + k500, k501, k502, k503, k504, k505, k506, k507, k508, k509, k510, k511, k512, k513 \ ) { \ { k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010, k011}, \ { k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110, k111}, \ From 2a3a70472fe6416d65d35a18328b3ad789d39633 Mon Sep 17 00:00:00 2001 From: yulei Date: Sun, 27 Sep 2020 09:43:18 +0800 Subject: [PATCH 4/8] Update keyboards/matrix/cain/cain.c Co-authored-by: Joel Challis --- keyboards/matrix/cain/cain.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/keyboards/matrix/cain/cain.c b/keyboards/matrix/cain/cain.c index aabdb6c74ed8..52d859d877c1 100644 --- a/keyboards/matrix/cain/cain.c +++ b/keyboards/matrix/cain/cain.c @@ -19,11 +19,13 @@ #include "cain.h" -void matrix_init_user(void) +void matrix_init_kb(void) { setPinOutput(NUM_PIN); setPinOutput(CAPS_PIN); setPinOutput(SCROLL_PIN); + + matrix_init_user(); } bool led_update_kb(led_t led_state) From 35d8e1eb51634369a5939321f9154232145c7c4e Mon Sep 17 00:00:00 2001 From: yulei Date: Sun, 27 Sep 2020 13:00:47 +0800 Subject: [PATCH 5/8] Update keyboards/matrix/cain/rules.mk Co-authored-by: Ryan --- keyboards/matrix/cain/rules.mk | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/keyboards/matrix/cain/rules.mk b/keyboards/matrix/cain/rules.mk index 1b1ddca4d16d..9bbb324e7ca9 100644 --- a/keyboards/matrix/cain/rules.mk +++ b/keyboards/matrix/cain/rules.mk @@ -5,14 +5,18 @@ MCU = atmega32u4 BOOTLOADER = atmel-dfu # Build Options -# comment out to disable the options. +# change yes to no to disable # -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration -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 -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -NKRO_ENABLE = yes # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +BOOTMAGIC_ENABLE = full # Virtual DIP switch configuration +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 +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +BLUETOOTH_ENABLE = no # Enable Bluetooth +AUDIO_ENABLE = no # Audio output From e5cef77a44938b4b033b69ec271d1220fbdbaf97 Mon Sep 17 00:00:00 2001 From: yulei Date: Tue, 29 Sep 2020 11:53:27 +0800 Subject: [PATCH 6/8] Apply suggestions from code review Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> --- keyboards/matrix/cain/cain.h | 18 +++++++++--------- keyboards/matrix/cain/info.json | 2 +- keyboards/matrix/cain/keymaps/default/keymap.c | 4 ++-- keyboards/matrix/cain/read.md | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/keyboards/matrix/cain/cain.h b/keyboards/matrix/cain/cain.h index 5b9f7bd90402..9ab9985f13f1 100644 --- a/keyboards/matrix/cain/cain.h +++ b/keyboards/matrix/cain/cain.h @@ -20,13 +20,13 @@ #include "quantum.h" -#define LAYOUT_default( \ - k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010, k011, k012, k013, k014, k015, \ - k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110, k111, k112, k113, k114, k115, k116, k117, k118, k119, k120, \ - k200, k201, k202, k203, k204, k205, k206, k207, k208, k209, k210, k211, k212, k213, k214, k215, k216, k217, k218, k219, k220, \ - k300, k301, k302, k303, k304, k305, k306, k307, k308, k309, k310, k311, k312, k313, k314, k315, k316, \ - k400, k401, k402, k403, k404, k405, k406, k407, k408, k409, k410, k411, k412, k413, k414, k415, k416, \ - k500, k501, k502, k503, k504, k505, k506, k507, k508, k509, k510, k511, k512, k513 \ +#define LAYOUT_all( \ + k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010, k011, k012, k013, k014, k015, \ + k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110, k111, k112, k113, k114, k115, k116, k117, k118, k119, k120, \ + k200, k201, k202, k203, k204, k205, k206, k207, k208, k209, k210, k211, k212, k213, k214, k215, k216, k217, k218, k219, k220, \ + k300, k301, k302, k303, k304, k305, k306, k307, k308, k309, k310, k311, k312, k313, k314, k315, k316, \ + k400, k401, k402, k403, k404, k405, k406, k407, k408, k409, k410, k411, k412, k413, k414, k415, k416, \ + k500, k501, k502, k503, k504, k505, k506, k507, k508, k509, k510, k511, k512, k513 \ ) { \ { k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010, k011}, \ { k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110, k111}, \ @@ -34,7 +34,7 @@ { k300, k301, k302, k303, k304, k305, k306, k307, k308, k309, k310, k311}, \ { k400, k401, k402, k403, k404, k405, k406, k407, k408, k409, k410, k411}, \ { k012, k113, k112, k212, k213, k312, k412, k413, k414, k415, k316, k315}, \ - { k114, k115, k116, k117, k217, k216, k215, k214, k313, k314, k416}, \ + { k114, k115, k116, k117, k217, k216, k215, k214, k313, k314, k416, KC_NO}, \ { k013, k014, k015, k120, k119, k118, k218, k219, k220, k511, k512, k513}, \ - { k500, k501, k502, k503, k504, k505, k506, k507, k508, k509, k510} \ + { k500, k501, k502, k503, k504, k505, k506, k507, k508, k509, k510, KC_NO} \ } diff --git a/keyboards/matrix/cain/info.json b/keyboards/matrix/cain/info.json index a12fabe5d585..3f65b7de7799 100644 --- a/keyboards/matrix/cain/info.json +++ b/keyboards/matrix/cain/info.json @@ -5,7 +5,7 @@ "width": 23, "height": 6.5, "layouts": { - "LAYOUT_default": { + "LAYOUT_all": { "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":20, "y":0}, {"label":"Scroll Lock", "x":21, "y":0}, {"label":"Pause", "x":22, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Backspace", "x":13, "y":1.5, "w":2}, {"label":"Num Lock", "x":15.5, "y":1.5}, {"label":"/", "x":16.5, "y":1.5}, {"label":"*", "x":17.5, "y":1.5}, {"label":"-", "x":18.5, "y":1.5}, {"label":"Insert", "x":20, "y":1.5}, {"label":"Home", "x":21, "y":1.5}, {"label":"PgUp", "x":22, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"7", "x":15.5, "y":2.5}, {"label":"8", "x":16.5, "y":2.5}, {"label":"9", "x":17.5, "y":2.5}, {"label":"+", "x":18.5, "y":2.5}, {"label":"Delete", "x":20, "y":2.5}, {"label":"End", "x":21, "y":2.5}, {"label":"PgDn", "x":22, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, {"label":"4", "x":15.5, "y":3.5}, {"label":"5", "x":16.5, "y":3.5}, {"label":"6", "x":17.5, "y":3.5}, {"label":"+", "x":18.5, "y":3.5}, {"label":"Shift", "x":0, "y":4.5, "w":2.25}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, {"label":"1", "x":15.5, "y":4.5}, {"label":"2", "x":16.5, "y":4.5}, {"label":"3", "x":17.5, "y":4.5}, {"label":"Enter", "x":18.5, "y":4.5}, {"label":"\u2191", "x":21, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.5}, {"label":"Win", "x":1.5, "y":5.5}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.5}, {"x":4, "y":5.5, "w":7}, {"label":"Alt", "x":11, "y":5.5, "w":1.5}, {"label":"Win", "x":12.5, "y":5.5}, {"label":"Ctrl", "x":13.5, "y":5.5, "w":1.5}, {"label":"0", "x":15.5, "y":5.5}, {"label":"0", "x":16.5, "y":5.5}, {"label":".", "x":17.5, "y":5.5}, {"label":"Enter", "x":18.5, "y":5.5}, {"label":"\u2190", "x":20, "y":5.5}, {"label":"\u2193", "x":21, "y":5.5}, {"label":"\u2192", "x":22, "y":5.5}] } } diff --git a/keyboards/matrix/cain/keymaps/default/keymap.c b/keyboards/matrix/cain/keymaps/default/keymap.c index 7af0f38b5c84..1f2d3b4e255b 100644 --- a/keyboards/matrix/cain/keymaps/default/keymap.c +++ b/keyboards/matrix/cain/keymaps/default/keymap.c @@ -20,7 +20,7 @@ #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0]=LAYOUT_default( + [0]=LAYOUT_all( 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_SLCK, LT(1,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_NLCK, KC_PSLS, KC_PAST, KC_PMNS, KC_INS, KC_HOME, KC_PGUP, @@ -29,7 +29,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_P1, KC_P2, KC_P3, KC_PENT, KC_UP, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_P0, KC_P0, KC_PDOT, KC_PENT, KC_LEFT, KC_DOWN, KC_RGHT), - [1]=LAYOUT_default( + [1]=LAYOUT_all( KC_MUTE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,_______,_______,_______,_______, _______, _______, diff --git a/keyboards/matrix/cain/read.md b/keyboards/matrix/cain/read.md index 34d7cdedb021..97e099d312ed 100644 --- a/keyboards/matrix/cain/read.md +++ b/keyboards/matrix/cain/read.md @@ -2,10 +2,10 @@ This was the replacement PCB for the Matrix Cain keyboard. -This firmware DO NOT support the original PCB shipped with the Cain keybaord. +This firmware **DOES NOT** support the original PCB shipped with the Cain keyboard. * Keyboard Maintainer: [astro](https://github.com/yulei) -* Hardware Supported: Matrix cain keyboard +* Hardware Supported: Matrix Cain keyboard * Hardware Availability: Matrix Lab Make example for this keyboard (after setting up your build environment): From 67d1ede71c8c98108da070894c4b012f418ffbcf Mon Sep 17 00:00:00 2001 From: Lei Yu Date: Tue, 29 Sep 2020 12:44:44 +0800 Subject: [PATCH 7/8] rename from cain to cain_re --- keyboards/matrix/{cain/cain.c => cain_re/cain_re.c} | 6 +++--- keyboards/matrix/{cain/cain.h => cain_re/cain_re.h} | 2 +- keyboards/matrix/{cain => cain_re}/config.h | 0 keyboards/matrix/{cain => cain_re}/info.json | 0 keyboards/matrix/{cain => cain_re}/keymaps/default/keymap.c | 0 keyboards/matrix/{cain/read.md => cain_re/readme.md} | 2 +- keyboards/matrix/{cain => cain_re}/rules.mk | 0 7 files changed, 5 insertions(+), 5 deletions(-) rename keyboards/matrix/{cain/cain.c => cain_re/cain_re.c} (96%) rename keyboards/matrix/{cain/cain.h => cain_re/cain_re.h} (99%) rename keyboards/matrix/{cain => cain_re}/config.h (100%) rename keyboards/matrix/{cain => cain_re}/info.json (100%) rename keyboards/matrix/{cain => cain_re}/keymaps/default/keymap.c (100%) rename keyboards/matrix/{cain/read.md => cain_re/readme.md} (95%) rename keyboards/matrix/{cain => cain_re}/rules.mk (100%) diff --git a/keyboards/matrix/cain/cain.c b/keyboards/matrix/cain_re/cain_re.c similarity index 96% rename from keyboards/matrix/cain/cain.c rename to keyboards/matrix/cain_re/cain_re.c index 52d859d877c1..e8d0a2b8034c 100644 --- a/keyboards/matrix/cain/cain.c +++ b/keyboards/matrix/cain_re/cain_re.c @@ -1,5 +1,5 @@ /** - * cain.c + * cain_re.c * Copyright 2020 astro @@ -17,14 +17,14 @@ along with this program. If not, see . */ -#include "cain.h" +#include "cain_re.h" void matrix_init_kb(void) { setPinOutput(NUM_PIN); setPinOutput(CAPS_PIN); setPinOutput(SCROLL_PIN); - + matrix_init_user(); } diff --git a/keyboards/matrix/cain/cain.h b/keyboards/matrix/cain_re/cain_re.h similarity index 99% rename from keyboards/matrix/cain/cain.h rename to keyboards/matrix/cain_re/cain_re.h index 9ab9985f13f1..0228177e1138 100644 --- a/keyboards/matrix/cain/cain.h +++ b/keyboards/matrix/cain_re/cain_re.h @@ -1,5 +1,5 @@ /** - * cain.h + * cain_re.h * Copyright 2020 astro diff --git a/keyboards/matrix/cain/config.h b/keyboards/matrix/cain_re/config.h similarity index 100% rename from keyboards/matrix/cain/config.h rename to keyboards/matrix/cain_re/config.h diff --git a/keyboards/matrix/cain/info.json b/keyboards/matrix/cain_re/info.json similarity index 100% rename from keyboards/matrix/cain/info.json rename to keyboards/matrix/cain_re/info.json diff --git a/keyboards/matrix/cain/keymaps/default/keymap.c b/keyboards/matrix/cain_re/keymaps/default/keymap.c similarity index 100% rename from keyboards/matrix/cain/keymaps/default/keymap.c rename to keyboards/matrix/cain_re/keymaps/default/keymap.c diff --git a/keyboards/matrix/cain/read.md b/keyboards/matrix/cain_re/readme.md similarity index 95% rename from keyboards/matrix/cain/read.md rename to keyboards/matrix/cain_re/readme.md index 97e099d312ed..ce74b01a4484 100644 --- a/keyboards/matrix/cain/read.md +++ b/keyboards/matrix/cain_re/readme.md @@ -10,6 +10,6 @@ This firmware **DOES NOT** support the original PCB shipped with the Cain keyboa Make example for this keyboard (after setting up your build environment): - make matrix/cain:default + make matrix/cain_re:default See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/matrix/cain/rules.mk b/keyboards/matrix/cain_re/rules.mk similarity index 100% rename from keyboards/matrix/cain/rules.mk rename to keyboards/matrix/cain_re/rules.mk From 0050acc52d4a174036dbaa8bf5e52577a1c7b068 Mon Sep 17 00:00:00 2001 From: yulei Date: Tue, 29 Sep 2020 13:14:32 +0800 Subject: [PATCH 8/8] Update keyboards/matrix/cain_re/readme.md Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> --- keyboards/matrix/cain_re/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/matrix/cain_re/readme.md b/keyboards/matrix/cain_re/readme.md index ce74b01a4484..13c86ea54a1a 100644 --- a/keyboards/matrix/cain_re/readme.md +++ b/keyboards/matrix/cain_re/readme.md @@ -1,4 +1,4 @@ -# Matrix Cain keyboard +# Matrix Cain replacement PCB This was the replacement PCB for the Matrix Cain keyboard.