From cdb78fac58d3ab4023693401e42030ec3569a46a Mon Sep 17 00:00:00 2001 From: David Doan Date: Sun, 13 Oct 2024 17:56:24 -0700 Subject: [PATCH 01/10] adding new macropad, vector,using the new json schema --- keyboards/arrayperipherals/vector/config.h | 16 ++++++ .../arrayperipherals/vector/keyboard.json | 52 +++++++++++++++++++ .../vector/keymaps/default/keymap.c | 36 +++++++++++++ .../vector/keymaps/default/rules.mk | 1 + keyboards/arrayperipherals/vector/readme.md | 27 ++++++++++ keyboards/arrayperipherals/vector/rules.mk | 0 keyboards/arrayperipherals/vector/vector.c | 16 ++++++ keyboards/arrayperipherals/vector/vector.h | 16 ++++++ 8 files changed, 164 insertions(+) create mode 100644 keyboards/arrayperipherals/vector/config.h create mode 100644 keyboards/arrayperipherals/vector/keyboard.json create mode 100644 keyboards/arrayperipherals/vector/keymaps/default/keymap.c create mode 100644 keyboards/arrayperipherals/vector/keymaps/default/rules.mk create mode 100644 keyboards/arrayperipherals/vector/readme.md create mode 100644 keyboards/arrayperipherals/vector/rules.mk create mode 100644 keyboards/arrayperipherals/vector/vector.c create mode 100644 keyboards/arrayperipherals/vector/vector.h diff --git a/keyboards/arrayperipherals/vector/config.h b/keyboards/arrayperipherals/vector/config.h new file mode 100644 index 000000000000..b515cb1a221a --- /dev/null +++ b/keyboards/arrayperipherals/vector/config.h @@ -0,0 +1,16 @@ +/* +Copyright 2024 David Doan + +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 . +*/ \ No newline at end of file diff --git a/keyboards/arrayperipherals/vector/keyboard.json b/keyboards/arrayperipherals/vector/keyboard.json new file mode 100644 index 000000000000..27b667ed992d --- /dev/null +++ b/keyboards/arrayperipherals/vector/keyboard.json @@ -0,0 +1,52 @@ +{ + "manufacturer": "Array Peripherals", + "keyboard_name": "The Vector", + "maintainer": "daviddoan", + "bootloader": "atmel-dfu", + "bootmagic": { + "enabled": true, + "matrix": [0, 0] + }, + "dynamic_keymap": { + "layer_count": 2 + }, + "encoder": { + "rotary": [ + {"pin_a": "F0", "pin_b": "F1"} + ] + }, + "features": { + "bootmagic": true, + "command": false, + "console": true, + "encoder": true, + "extrakey": true, + "mousekey": true, + "nkro": true, + "raw": true, + "rgblight": false + }, + "matrix_pins": { + "direct": [ + ["D4", "C6", "D7", "E6", "F7"] + ] + }, + "processor": "atmega32u4", + "url": "https://arrayperipherals.com", + "usb": { + "device_version": "1.0.0", + "pid": "0x4F47", + "vid": "0x4152" + }, + "layouts": { + "LAYOUT_ortho_1x5": { + "layout": [ + {"label": "k01", "matrix": [0, 0], "x": 0, "y": 0}, + {"label": "k02", "matrix": [0, 1], "x": 1.25, "y": 0}, + {"label": "k03", "matrix": [0, 2], "x": 2.25, "y": 0}, + {"label": "k04", "matrix": [0, 3], "x": 3.25, "y": 0}, + {"label": "k05", "matrix": [0, 4], "x": 4.5, "y": 0} + ] + } + } +} \ No newline at end of file diff --git a/keyboards/arrayperipherals/vector/keymaps/default/keymap.c b/keyboards/arrayperipherals/vector/keymaps/default/keymap.c new file mode 100644 index 000000000000..30cb9a32ffc8 --- /dev/null +++ b/keyboards/arrayperipherals/vector/keymaps/default/keymap.c @@ -0,0 +1,36 @@ +/* +Copyright 2024 David Doan + +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] = { //button closest to usb is first + + [0] = LAYOUT_ortho_1x5( + KC_MPRV, KC_MPLY, KC_MNXT, KC_AUDIO_MUTE, TG(1) + ), + + [1] = LAYOUT_ortho_1x5( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TG(1) + ), +}; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [0] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [1] = {ENCODER_CCW_CW(KC_TRNS, KC_TRNS)}, +}; +#endif // ENCODER_MAP_ENABLE \ No newline at end of file diff --git a/keyboards/arrayperipherals/vector/keymaps/default/rules.mk b/keyboards/arrayperipherals/vector/keymaps/default/rules.mk new file mode 100644 index 000000000000..a40474b4d5c7 --- /dev/null +++ b/keyboards/arrayperipherals/vector/keymaps/default/rules.mk @@ -0,0 +1 @@ +ENCODER_MAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/arrayperipherals/vector/readme.md b/keyboards/arrayperipherals/vector/readme.md new file mode 100644 index 000000000000..58603fcfd832 --- /dev/null +++ b/keyboards/arrayperipherals/vector/readme.md @@ -0,0 +1,27 @@ +# The Vector Macropad + +![The Vector](https://i.imgur.com/rmy76bp.png) + +A small (1x4) macropad with a rotary. [More info at arrayperipherals.com](https://www.arrayperipherals.com/) + +* Keyboard Maintainer: [David Doan](https://github.com/daviddoan) +* Hardware Supported: Custom PCB with Atmega32u4 processor +* Hardware Availability: [arrayperipherals.com](https://www.arrayperipherals.com/) + +Make example for this keyboard (after setting up your build environment): + + make arrayperipherals/vector:default + +Flashing example for this keyboard: + + make arrayperipherals/vector: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 2 ways: + +* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (left most from the rotary) +* **Physical reset button**: Briefly double press the button on the back of the PCB \ No newline at end of file diff --git a/keyboards/arrayperipherals/vector/rules.mk b/keyboards/arrayperipherals/vector/rules.mk new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/keyboards/arrayperipherals/vector/vector.c b/keyboards/arrayperipherals/vector/vector.c new file mode 100644 index 000000000000..b515cb1a221a --- /dev/null +++ b/keyboards/arrayperipherals/vector/vector.c @@ -0,0 +1,16 @@ +/* +Copyright 2024 David Doan + +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 . +*/ \ No newline at end of file diff --git a/keyboards/arrayperipherals/vector/vector.h b/keyboards/arrayperipherals/vector/vector.h new file mode 100644 index 000000000000..b515cb1a221a --- /dev/null +++ b/keyboards/arrayperipherals/vector/vector.h @@ -0,0 +1,16 @@ +/* +Copyright 2024 David Doan + +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 . +*/ \ No newline at end of file From c6a03c9a69258d668dce5706240a6187d603c998 Mon Sep 17 00:00:00 2001 From: David Doan Date: Mon, 14 Oct 2024 09:02:36 -0700 Subject: [PATCH 02/10] Delete keyboards/arrayperipherals/vector/config.h --- keyboards/arrayperipherals/vector/config.h | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 keyboards/arrayperipherals/vector/config.h diff --git a/keyboards/arrayperipherals/vector/config.h b/keyboards/arrayperipherals/vector/config.h deleted file mode 100644 index b515cb1a221a..000000000000 --- a/keyboards/arrayperipherals/vector/config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* -Copyright 2024 David Doan - -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 . -*/ \ No newline at end of file From 4ecbca1c695c286d88df7eeff9b3e52f9f3006ad Mon Sep 17 00:00:00 2001 From: David Doan Date: Mon, 14 Oct 2024 09:03:32 -0700 Subject: [PATCH 03/10] Delete keyboards/arrayperipherals/vector/vector.h --- keyboards/arrayperipherals/vector/vector.h | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 keyboards/arrayperipherals/vector/vector.h diff --git a/keyboards/arrayperipherals/vector/vector.h b/keyboards/arrayperipherals/vector/vector.h deleted file mode 100644 index b515cb1a221a..000000000000 --- a/keyboards/arrayperipherals/vector/vector.h +++ /dev/null @@ -1,16 +0,0 @@ -/* -Copyright 2024 David Doan - -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 . -*/ \ No newline at end of file From fbd2f2776f9e5cf30da4165eb3b3ac98e98e4423 Mon Sep 17 00:00:00 2001 From: David Doan Date: Mon, 14 Oct 2024 09:03:42 -0700 Subject: [PATCH 04/10] Delete keyboards/arrayperipherals/vector/vector.c --- keyboards/arrayperipherals/vector/vector.c | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 keyboards/arrayperipherals/vector/vector.c diff --git a/keyboards/arrayperipherals/vector/vector.c b/keyboards/arrayperipherals/vector/vector.c deleted file mode 100644 index b515cb1a221a..000000000000 --- a/keyboards/arrayperipherals/vector/vector.c +++ /dev/null @@ -1,16 +0,0 @@ -/* -Copyright 2024 David Doan - -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 . -*/ \ No newline at end of file From 371bc0a070b54b42c517158cd9830f36e885e349 Mon Sep 17 00:00:00 2001 From: David Doan Date: Mon, 14 Oct 2024 09:03:51 -0700 Subject: [PATCH 05/10] Delete keyboards/arrayperipherals/vector/rules.mk --- keyboards/arrayperipherals/vector/rules.mk | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 keyboards/arrayperipherals/vector/rules.mk diff --git a/keyboards/arrayperipherals/vector/rules.mk b/keyboards/arrayperipherals/vector/rules.mk deleted file mode 100644 index e69de29bb2d1..000000000000 From fe29f08fef1c0dc2fbf30258c6a11d412c151498 Mon Sep 17 00:00:00 2001 From: David Doan Date: Mon, 14 Oct 2024 09:05:21 -0700 Subject: [PATCH 06/10] Apply suggestions from code review applied all zvecr suggestions Co-authored-by: Joel Challis --- keyboards/arrayperipherals/vector/keyboard.json | 15 ++------------- .../vector/keymaps/default/keymap.c | 8 ++++---- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/keyboards/arrayperipherals/vector/keyboard.json b/keyboards/arrayperipherals/vector/keyboard.json index 27b667ed992d..aecc4ec52b3a 100644 --- a/keyboards/arrayperipherals/vector/keyboard.json +++ b/keyboards/arrayperipherals/vector/keyboard.json @@ -3,13 +3,6 @@ "keyboard_name": "The Vector", "maintainer": "daviddoan", "bootloader": "atmel-dfu", - "bootmagic": { - "enabled": true, - "matrix": [0, 0] - }, - "dynamic_keymap": { - "layer_count": 2 - }, "encoder": { "rotary": [ {"pin_a": "F0", "pin_b": "F1"} @@ -17,14 +10,10 @@ }, "features": { "bootmagic": true, - "command": false, - "console": true, "encoder": true, "extrakey": true, "mousekey": true, - "nkro": true, - "raw": true, - "rgblight": false + "nkro": true }, "matrix_pins": { "direct": [ @@ -39,7 +28,7 @@ "vid": "0x4152" }, "layouts": { - "LAYOUT_ortho_1x5": { + "LAYOUT": { "layout": [ {"label": "k01", "matrix": [0, 0], "x": 0, "y": 0}, {"label": "k02", "matrix": [0, 1], "x": 1.25, "y": 0}, diff --git a/keyboards/arrayperipherals/vector/keymaps/default/keymap.c b/keyboards/arrayperipherals/vector/keymaps/default/keymap.c index 30cb9a32ffc8..b335cd076c0a 100644 --- a/keyboards/arrayperipherals/vector/keymaps/default/keymap.c +++ b/keyboards/arrayperipherals/vector/keymaps/default/keymap.c @@ -17,19 +17,19 @@ along with this program. If not, see . #include QMK_KEYBOARD_H -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //button closest to usb is first +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_ortho_1x5( + [0] = LAYOUT( KC_MPRV, KC_MPLY, KC_MNXT, KC_AUDIO_MUTE, TG(1) ), - [1] = LAYOUT_ortho_1x5( + [1] = LAYOUT( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TG(1) ), }; #if defined(ENCODER_MAP_ENABLE) -const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { [0] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, [1] = {ENCODER_CCW_CW(KC_TRNS, KC_TRNS)}, }; From 069112cf32095a12718e272589ffe8f5f2d513a5 Mon Sep 17 00:00:00 2001 From: David Doan Date: Mon, 14 Oct 2024 16:06:14 -0700 Subject: [PATCH 07/10] Apply suggestions from code review -- removed nkro enable Co-authored-by: jack --- keyboards/arrayperipherals/vector/keyboard.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/keyboards/arrayperipherals/vector/keyboard.json b/keyboards/arrayperipherals/vector/keyboard.json index aecc4ec52b3a..07a2cef8410c 100644 --- a/keyboards/arrayperipherals/vector/keyboard.json +++ b/keyboards/arrayperipherals/vector/keyboard.json @@ -12,8 +12,7 @@ "bootmagic": true, "encoder": true, "extrakey": true, - "mousekey": true, - "nkro": true + "mousekey": true }, "matrix_pins": { "direct": [ From 46ef63800b19a5fc73e8aa1178ae3b02abc30b6a Mon Sep 17 00:00:00 2001 From: David Doan Date: Mon, 14 Oct 2024 20:31:25 -0700 Subject: [PATCH 08/10] Changed KC_AUDIO_MUTE TO KC_MUTE Co-authored-by: Ryan --- keyboards/arrayperipherals/vector/keymaps/default/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/arrayperipherals/vector/keymaps/default/keymap.c b/keyboards/arrayperipherals/vector/keymaps/default/keymap.c index b335cd076c0a..e290e3707646 100644 --- a/keyboards/arrayperipherals/vector/keymaps/default/keymap.c +++ b/keyboards/arrayperipherals/vector/keymaps/default/keymap.c @@ -20,7 +20,7 @@ along with this program. If not, see . const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( - KC_MPRV, KC_MPLY, KC_MNXT, KC_AUDIO_MUTE, TG(1) + KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, TG(1) ), [1] = LAYOUT( From b27fd868059fc23f28413d51276a5c4f054c81e3 Mon Sep 17 00:00:00 2001 From: David Doan Date: Tue, 15 Oct 2024 19:18:16 -0700 Subject: [PATCH 09/10] Update keyboard.json to change spacing between keys --- keyboards/arrayperipherals/vector/keyboard.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/keyboards/arrayperipherals/vector/keyboard.json b/keyboards/arrayperipherals/vector/keyboard.json index 07a2cef8410c..505199831d5a 100644 --- a/keyboards/arrayperipherals/vector/keyboard.json +++ b/keyboards/arrayperipherals/vector/keyboard.json @@ -30,11 +30,11 @@ "LAYOUT": { "layout": [ {"label": "k01", "matrix": [0, 0], "x": 0, "y": 0}, - {"label": "k02", "matrix": [0, 1], "x": 1.25, "y": 0}, - {"label": "k03", "matrix": [0, 2], "x": 2.25, "y": 0}, - {"label": "k04", "matrix": [0, 3], "x": 3.25, "y": 0}, - {"label": "k05", "matrix": [0, 4], "x": 4.5, "y": 0} + {"label": "k02", "matrix": [0, 1], "x": 1, "y": 0}, + {"label": "k03", "matrix": [0, 2], "x": 2, "y": 0}, + {"label": "k04", "matrix": [0, 3], "x": 3, "y": 0}, + {"label": "k05", "matrix": [0, 4], "x": 4.25, "y": 0} ] } } -} \ No newline at end of file +} From d202136cc2ca0a3ef9c68bdcd7772ff492cc7ea3 Mon Sep 17 00:00:00 2001 From: David Doan Date: Tue, 15 Oct 2024 19:19:39 -0700 Subject: [PATCH 10/10] Accepted changes from fauxpark, formatting Co-authored-by: Ryan --- keyboards/arrayperipherals/vector/readme.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/keyboards/arrayperipherals/vector/readme.md b/keyboards/arrayperipherals/vector/readme.md index 58603fcfd832..dee7dc8f9a16 100644 --- a/keyboards/arrayperipherals/vector/readme.md +++ b/keyboards/arrayperipherals/vector/readme.md @@ -10,13 +10,12 @@ A small (1x4) macropad with a rotary. [More info at arrayperipherals.com](https: Make example for this keyboard (after setting up your build environment): - make arrayperipherals/vector:default + make arrayperipherals/vector:default Flashing example for this keyboard: make arrayperipherals/vector: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