From 489151d7a0c782670df30d62409ba5ef4ca11c8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=95=E3=82=A3=E3=83=AB=E3=82=BF=E3=83=BC=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=83=91=E3=83=BC?= <76888457+filterpaper@users.noreply.github.com> Date: Wed, 27 Dec 2023 12:26:48 +0800 Subject: Refactor: move macro3 into handwired folder (#22759) --- keyboards/handwired/macro3/info.json | 51 ++++++++++++++++++++++ .../handwired/macro3/keymaps/default/keymap.c | 25 +++++++++++ .../handwired/macro3/keymaps/default/rules.mk | 1 + keyboards/handwired/macro3/macro3.c | 27 ++++++++++++ keyboards/handwired/macro3/readme.md | 26 +++++++++++ keyboards/handwired/macro3/rules.mk | 1 + keyboards/macro3/info.json | 51 ---------------------- keyboards/macro3/keymaps/default/keymap.c | 25 ----------- keyboards/macro3/keymaps/default/rules.mk | 1 - keyboards/macro3/macro3.c | 27 ------------ keyboards/macro3/readme.md | 26 ----------- keyboards/macro3/rules.mk | 1 - 12 files changed, 131 insertions(+), 131 deletions(-) create mode 100644 keyboards/handwired/macro3/info.json create mode 100644 keyboards/handwired/macro3/keymaps/default/keymap.c create mode 100644 keyboards/handwired/macro3/keymaps/default/rules.mk create mode 100644 keyboards/handwired/macro3/macro3.c create mode 100644 keyboards/handwired/macro3/readme.md create mode 100644 keyboards/handwired/macro3/rules.mk delete mode 100644 keyboards/macro3/info.json delete mode 100644 keyboards/macro3/keymaps/default/keymap.c delete mode 100644 keyboards/macro3/keymaps/default/rules.mk delete mode 100644 keyboards/macro3/macro3.c delete mode 100644 keyboards/macro3/readme.md delete mode 100644 keyboards/macro3/rules.mk (limited to 'keyboards') diff --git a/keyboards/handwired/macro3/info.json b/keyboards/handwired/macro3/info.json new file mode 100644 index 0000000000..fa6cd1c471 --- /dev/null +++ b/keyboards/handwired/macro3/info.json @@ -0,0 +1,51 @@ +{ + "keyboard_name": "Macro3", + "manufacturer": "DPB", + "url": "https://github.com/davidphilipbarr/Macropads/tree/main/macro3", + "maintainer": "@davidphilipbarr", + "usb": { + "vid": "0xC88B", + "pid": "0x3388", + "device_version": "0.0.3" + }, + "encoder": { + "rotary": [ + {"pin_a": "D2", "pin_b": "D3"}, + {"pin_a": "F7", "pin_b": "F6"} + ] + }, + "development_board": "promicro", + "features": { + "bootmagic": true, + "extrakey": true, + "mousekey": true, + "encoder": true + }, + "bootmagic": { + "matrix": [0, 3] + }, + "matrix_pins": { + "direct": [ + ["D7", "C6", "D4", "D1"], + ["B1", "B4", "B5", "B3"] + ] + }, + "layout_aliases": { + "LAYOUT": "LAYOUT_ortho_2x4" + }, + "layouts": { + "LAYOUT_ortho_2x4": { + "layout": [ + {"x": 0, "y": 0, "matrix": [0, 0]}, + {"x": 1, "y": 0, "matrix": [0, 1]}, + {"x": 2, "y": 0, "matrix": [0, 2]}, + {"x": 3, "y": 0, "matrix": [0, 3]}, + + {"x": 0, "y": 1, "matrix": [1, 0]}, + {"x": 1, "y": 1, "matrix": [1, 1]}, + {"x": 2, "y": 1, "matrix": [1, 2]}, + {"x": 3, "y": 1, "matrix": [1, 3]} + ] + } + } +} diff --git a/keyboards/handwired/macro3/keymaps/default/keymap.c b/keyboards/handwired/macro3/keymaps/default/keymap.c new file mode 100644 index 0000000000..a7b5cf9db4 --- /dev/null +++ b/keyboards/handwired/macro3/keymaps/default/keymap.c @@ -0,0 +1,25 @@ +/* Copyright 2020 David Philip Barr <@davidphilipbarr> + * Copyright 2021 @filterpaper + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ortho_2x4( + KC_MUTE, KC_MPLY, KC_MRWD, LT(1,KC_MFFD), + C(KC_Z), C(KC_X), C(KC_C), C(KC_V) + ), + [1] = LAYOUT_ortho_2x4( + _______, _______, _______, _______, + QK_BOOT, _______, _______, _______ + ) +}; + +#ifdef ENCODER_MAP_ENABLE +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + [0] = { ENCODER_CCW_CW(KC_VOLU, KC_VOLD), ENCODER_CCW_CW(KC_MNXT, KC_MPRV) }, + [1] = { ENCODER_CCW_CW(KC_VOLU, KC_VOLD), ENCODER_CCW_CW(KC_PGDN, KC_PGUP) }, +}; +#endif + diff --git a/keyboards/handwired/macro3/keymaps/default/rules.mk b/keyboards/handwired/macro3/keymaps/default/rules.mk new file mode 100644 index 0000000000..ee32568148 --- /dev/null +++ b/keyboards/handwired/macro3/keymaps/default/rules.mk @@ -0,0 +1 @@ +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/handwired/macro3/macro3.c b/keyboards/handwired/macro3/macro3.c new file mode 100644 index 0000000000..54fce243ab --- /dev/null +++ b/keyboards/handwired/macro3/macro3.c @@ -0,0 +1,27 @@ +/* Copyright 2020 David Philip Barr <@davidphilipbarr> + * Copyright 2021 @filterpaper + * SPDX-License-Identifier: GPL-2.0+ + */ + +#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) { + if (clockwise) { + tap_code(KC_MNXT); + } else { + tap_code(KC_MPRV); + } + } + return true; +} +#endif + diff --git a/keyboards/handwired/macro3/readme.md b/keyboards/handwired/macro3/readme.md new file mode 100644 index 0000000000..185496ac8b --- /dev/null +++ b/keyboards/handwired/macro3/readme.md @@ -0,0 +1,26 @@ +# Macro3 + +![Macro3](https://github.com/filterpaper/filterpaper.github.io/raw/main/images/macro3.png) + +Macro3 is a low-profile macro pad with dual encoder support designed by [@davidphilipbarr](https://github.com/davidphilipbarr). + +## Keyboard Info + +* Keyboard Maintainer: [filterpaper](https://github.com/filterpaper) +* Hardware Supported: Macro3 +* Hardware Availability: [Open-source](https://github.com/davidphilipbarr/Macropads/tree/main/macro3) + +Make example for this keyboard (after setting up your build environment): + + make handwired/macro3: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). + +## Bootloader + +Enter the bootloader in 3 ways: + +* **Bootmagic reset**: Hold down the top right key and plug in the controller. +* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is configured. +* **Physical reset pins**: Briefly short the RST and GND pins on the microcontroller using tweezers, a paperclip, or any other conductive material. + diff --git a/keyboards/handwired/macro3/rules.mk b/keyboards/handwired/macro3/rules.mk new file mode 100644 index 0000000000..6e7633bfe0 --- /dev/null +++ b/keyboards/handwired/macro3/rules.mk @@ -0,0 +1 @@ +# This file intentionally left blank diff --git a/keyboards/macro3/info.json b/keyboards/macro3/info.json deleted file mode 100644 index fa6cd1c471..0000000000 --- a/keyboards/macro3/info.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "keyboard_name": "Macro3", - "manufacturer": "DPB", - "url": "https://github.com/davidphilipbarr/Macropads/tree/main/macro3", - "maintainer": "@davidphilipbarr", - "usb": { - "vid": "0xC88B", - "pid": "0x3388", - "device_version": "0.0.3" - }, - "encoder": { - "rotary": [ - {"pin_a": "D2", "pin_b": "D3"}, - {"pin_a": "F7", "pin_b": "F6"} - ] - }, - "development_board": "promicro", - "features": { - "bootmagic": true, - "extrakey": true, - "mousekey": true, - "encoder": true - }, - "bootmagic": { - "matrix": [0, 3] - }, - "matrix_pins": { - "direct": [ - ["D7", "C6", "D4", "D1"], - ["B1", "B4", "B5", "B3"] - ] - }, - "layout_aliases": { - "LAYOUT": "LAYOUT_ortho_2x4" - }, - "layouts": { - "LAYOUT_ortho_2x4": { - "layout": [ - {"x": 0, "y": 0, "matrix": [0, 0]}, - {"x": 1, "y": 0, "matrix": [0, 1]}, - {"x": 2, "y": 0, "matrix": [0, 2]}, - {"x": 3, "y": 0, "matrix": [0, 3]}, - - {"x": 0, "y": 1, "matrix": [1, 0]}, - {"x": 1, "y": 1, "matrix": [1, 1]}, - {"x": 2, "y": 1, "matrix": [1, 2]}, - {"x": 3, "y": 1, "matrix": [1, 3]} - ] - } - } -} diff --git a/keyboards/macro3/keymaps/default/keymap.c b/keyboards/macro3/keymaps/default/keymap.c deleted file mode 100644 index a7b5cf9db4..0000000000 --- a/keyboards/macro3/keymaps/default/keymap.c +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright 2020 David Philip Barr <@davidphilipbarr> - * Copyright 2021 @filterpaper - * SPDX-License-Identifier: GPL-2.0+ - */ - -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_ortho_2x4( - KC_MUTE, KC_MPLY, KC_MRWD, LT(1,KC_MFFD), - C(KC_Z), C(KC_X), C(KC_C), C(KC_V) - ), - [1] = LAYOUT_ortho_2x4( - _______, _______, _______, _______, - QK_BOOT, _______, _______, _______ - ) -}; - -#ifdef ENCODER_MAP_ENABLE -const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { - [0] = { ENCODER_CCW_CW(KC_VOLU, KC_VOLD), ENCODER_CCW_CW(KC_MNXT, KC_MPRV) }, - [1] = { ENCODER_CCW_CW(KC_VOLU, KC_VOLD), ENCODER_CCW_CW(KC_PGDN, KC_PGUP) }, -}; -#endif - diff --git a/keyboards/macro3/keymaps/default/rules.mk b/keyboards/macro3/keymaps/default/rules.mk deleted file mode 100644 index ee32568148..0000000000 --- a/keyboards/macro3/keymaps/default/rules.mk +++ /dev/null @@ -1 +0,0 @@ -ENCODER_MAP_ENABLE = yes diff --git a/keyboards/macro3/macro3.c b/keyboards/macro3/macro3.c deleted file mode 100644 index 54fce243ab..0000000000 --- a/keyboards/macro3/macro3.c +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright 2020 David Philip Barr <@davidphilipbarr> - * Copyright 2021 @filterpaper - * SPDX-License-Identifier: GPL-2.0+ - */ - -#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) { - if (clockwise) { - tap_code(KC_MNXT); - } else { - tap_code(KC_MPRV); - } - } - return true; -} -#endif - diff --git a/keyboards/macro3/readme.md b/keyboards/macro3/readme.md deleted file mode 100644 index 40cf927392..0000000000 --- a/keyboards/macro3/readme.md +++ /dev/null @@ -1,26 +0,0 @@ -# Macro3 - -![Macro3](https://github.com/filterpaper/filterpaper.github.io/raw/main/images/macro3.png) - -Macro3 is a low-profile macro pad with dual encoder support designed by [@davidphilipbarr](https://github.com/davidphilipbarr). - -## Keyboard Info - -* Keyboard Maintainer: [filterpaper](https://github.com/filterpaper), [davidphilipbarr](https://github.com/davidphilipbarr) -* Hardware Supported: [Macro3](https://github.com/davidphilipbarr/Macropads/tree/main/macro3) -* Hardware Availability: order PCBs with gerber file from the repository - -Make example for this keyboard (after setting up your build environment): - - make macro3: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). - -## Bootloader - -Enter the bootloader in 3 ways: - -* **Bootmagic reset**: Hold down the top right key and plug in the controller. -* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is configured. -* **Physical reset pins**: Briefly short the RST and GND pins on the microcontroller using tweezers, a paperclip, or any other conductive material. - diff --git a/keyboards/macro3/rules.mk b/keyboards/macro3/rules.mk deleted file mode 100644 index 6e7633bfe0..0000000000 --- a/keyboards/macro3/rules.mk +++ /dev/null @@ -1 +0,0 @@ -# This file intentionally left blank -- cgit v1.2.3