From 7e6849a07cda6feaf2c2a0cc5466ae6726adbf2e Mon Sep 17 00:00:00 2001 From: Andrew Kannan Date: Thu, 27 Oct 2022 15:57:47 -0400 Subject: [PATCH 01/14] Add copyright to halconf --- keyboards/cannonkeys/ortho48v2/config.h | 23 +++++ keyboards/cannonkeys/ortho48v2/halconf.h | 23 +++++ keyboards/cannonkeys/ortho48v2/info.json | 91 +++++++++++++++++++ .../ortho48v2/keymaps/default/keymap.c | 88 ++++++++++++++++++ .../cannonkeys/ortho48v2/keymaps/via/keymap.c | 49 ++++++++++ .../cannonkeys/ortho48v2/keymaps/via/rules.mk | 2 + keyboards/cannonkeys/ortho48v2/mcuconf.h | 9 ++ keyboards/cannonkeys/ortho48v2/rules.mk | 2 + 8 files changed, 287 insertions(+) create mode 100644 keyboards/cannonkeys/ortho48v2/config.h create mode 100644 keyboards/cannonkeys/ortho48v2/halconf.h create mode 100644 keyboards/cannonkeys/ortho48v2/info.json create mode 100644 keyboards/cannonkeys/ortho48v2/keymaps/default/keymap.c create mode 100644 keyboards/cannonkeys/ortho48v2/keymaps/via/keymap.c create mode 100644 keyboards/cannonkeys/ortho48v2/keymaps/via/rules.mk create mode 100644 keyboards/cannonkeys/ortho48v2/mcuconf.h create mode 100644 keyboards/cannonkeys/ortho48v2/rules.mk diff --git a/keyboards/cannonkeys/ortho48v2/config.h b/keyboards/cannonkeys/ortho48v2/config.h new file mode 100644 index 000000000000..2af75a171588 --- /dev/null +++ b/keyboards/cannonkeys/ortho48v2/config.h @@ -0,0 +1,23 @@ +/* +Copyright 2022 CannonKeys + +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 RP2040_BOOTLOADER_DOUBLE_TAP_RESET // Activates the double-tap behavior +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 200U // Timeout window in ms in which the double tap can occur. + +#define BACKLIGHT_PWM_DRIVER PWMD6 +#define BACKLIGHT_PWM_CHANNEL RP2040_PWM_CHANNEL_A diff --git a/keyboards/cannonkeys/ortho48v2/halconf.h b/keyboards/cannonkeys/ortho48v2/halconf.h new file mode 100644 index 000000000000..54f3d4ab1d44 --- /dev/null +++ b/keyboards/cannonkeys/ortho48v2/halconf.h @@ -0,0 +1,23 @@ + /* + Copyright 2022 CannonKeys + + * 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 HAL_USE_PWM TRUE + +#include_next diff --git a/keyboards/cannonkeys/ortho48v2/info.json b/keyboards/cannonkeys/ortho48v2/info.json new file mode 100644 index 000000000000..7dc0f89a01d3 --- /dev/null +++ b/keyboards/cannonkeys/ortho48v2/info.json @@ -0,0 +1,91 @@ +{ + "keyboard_name": "Ortho48 v2", + "maintainer": "awkannan", + "manufacturer": "CannonKeys", + "processor": "RP2040", + "bootloader": "rp2040", + "usb": { + "vid": "0xCA04", + "pid": "0x0018", + "device_version": "0.0.1" + }, + "url": "https://cannonkeys.com", + "diode_direction": "COL2ROW", + "matrix_pins": { + "cols": ["GP7", "GP6", "GP5", "GP4", "GP3", "GP2", "GP1", "GP0", "GP13", "GP24", "GP23", "GP22"], + "rows": ["GP18", "GP19", "GP25", "GP26"] + }, + "features": { + "bootmagic": true, + "command": false, + "console": false, + "extrakey": true, + "mousekey": true, + "nkro": true, + "backlight": true + }, + "encoder": { + "rotary": [ + { "pin_a": "GP28", "pin_b": "GP29" } + ] + }, + "backlight": { + "breathing": true, + "breathing_period": 5, + "levels": 15, + "pin": "GP12" + }, + "layouts": { + "LAYOUT_ortho_4x12": { + "layout": [ + {"label":"Tab", "x":0, "y":0, "matrix": [0,0]}, + {"label":"Q", "x":1, "y":0, "matrix": [0,1]}, + {"label":"W", "x":2, "y":0, "matrix": [0,2]}, + {"label":"E", "x":3, "y":0, "matrix": [0,3]}, + {"label":"R", "x":4, "y":0, "matrix": [0,4]}, + {"label":"T", "x":5, "y":0, "matrix": [0,5]}, + {"label":"Y", "x":6, "y":0, "matrix": [0,6]}, + {"label":"U", "x":7, "y":0, "matrix": [0,7]}, + {"label":"I", "x":8, "y":0, "matrix": [0,8]}, + {"label":"O", "x":9, "y":0, "matrix": [0,9]}, + {"label":"P", "x":10, "y":0, "matrix": [0,10]}, + {"label":"Back Space", "x":11, "y":0, "matrix": [0,11]}, + {"label":"Esc", "x":0, "y":1, "matrix": [1,0]}, + {"label":"A", "x":1, "y":1, "matrix": [1,1]}, + {"label":"S", "x":2, "y":1, "matrix": [1,2]}, + {"label":"D", "x":3, "y":1, "matrix": [1,3]}, + {"label":"F", "x":4, "y":1, "matrix": [1,4]}, + {"label":"G", "x":5, "y":1, "matrix": [1,5]}, + {"label":"H", "x":6, "y":1, "matrix": [1,6]}, + {"label":"J", "x":7, "y":1, "matrix": [1,7]}, + {"label":"K", "x":8, "y":1, "matrix": [1,8]}, + {"label":"L", "x":9, "y":1, "matrix": [1,9]}, + {"label":";", "x":10, "y":1, "matrix": [1,10]}, + {"label":"'", "x":11, "y":1, "matrix": [1,11]}, + {"label":"Shift", "x":0, "y":2, "matrix": [2,0]}, + {"label":"Z", "x":1, "y":2, "matrix": [2,1]}, + {"label":"X", "x":2, "y":2, "matrix": [2,2]}, + {"label":"C", "x":3, "y":2, "matrix": [2,3]}, + {"label":"V", "x":4, "y":2, "matrix": [2,4]}, + {"label":"B", "x":5, "y":2, "matrix": [2,5]}, + {"label":"N", "x":6, "y":2, "matrix": [2,6]}, + {"label":"M", "x":7, "y":2, "matrix": [2,7]}, + {"label":",", "x":8, "y":2, "matrix": [2,8]}, + {"label":".", "x":9, "y":2, "matrix": [2,9]}, + {"label":"/", "x":10, "y":2, "matrix": [2,10]}, + {"label":"Return", "x":11, "y":2, "matrix": [2,11]}, + {"label":"", "x":0, "y":3, "matrix": [3,0]}, + {"label":"Ctrl", "x":1, "y":3, "matrix": [3,1]}, + {"label":"Alt", "x":2, "y":3, "matrix": [3,2]}, + {"label":"Super", "x":3, "y":3, "matrix": [3,3]}, + {"label":"⇓", "x":4, "y":3, "matrix": [3,4]}, + {"label":"", "x":5, "y":3, "matrix": [3,5]}, + {"label":"", "x":6, "y":3, "matrix": [3,6]}, + {"label":"⇑", "x":7, "y":3, "matrix": [3,7]}, + {"label":"←", "x":8, "y":3, "matrix": [3,8]}, + {"label":"↓", "x":9, "y":3, "matrix": [3,9]}, + {"label":"↑", "x":10, "y":3, "matrix": [3,10]}, + {"label":"→", "x":11, "y":3, "matrix": [3,11]}] + } + } +} diff --git a/keyboards/cannonkeys/ortho48v2/keymaps/default/keymap.c b/keyboards/cannonkeys/ortho48v2/keymaps/default/keymap.c new file mode 100644 index 000000000000..c02fc0a4702f --- /dev/null +++ b/keyboards/cannonkeys/ortho48v2/keymaps/default/keymap.c @@ -0,0 +1,88 @@ +/* +Copyright 2012,2013 Jun Wako + +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 + + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _RAISE 1 +#define _LOWER 2 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_BASE] = LAYOUT_ortho_4x12( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, 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_ENT , + BL_TOGG, KC_LCTL, KC_LALT, KC_LGUI, MO(_LOWER), KC_SPC, KC_SPC, MO(_RAISE), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_4x12( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + QK_BOOT, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_4x12( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + RGB_TOG, RGB_MOD, BL_INC, BL_DEC, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), +}; diff --git a/keyboards/cannonkeys/ortho48v2/keymaps/via/keymap.c b/keyboards/cannonkeys/ortho48v2/keymaps/via/keymap.c new file mode 100644 index 000000000000..ea9651f2d691 --- /dev/null +++ b/keyboards/cannonkeys/ortho48v2/keymaps/via/keymap.c @@ -0,0 +1,49 @@ +/* +Copyright 2012,2013 Jun Wako + +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_ortho_4x12( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, 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_ENT , + BL_TOGG, KC_LCTL, KC_LALT, KC_LGUI, MO(1), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +[1] = LAYOUT_ortho_4x12( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + QK_BOOT, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +[2] = LAYOUT_ortho_4x12( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + RGB_TOG, RGB_MOD, BL_INC, BL_DEC, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +[3] = LAYOUT_ortho_4x12( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + 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/cannonkeys/ortho48v2/keymaps/via/rules.mk b/keyboards/cannonkeys/ortho48v2/keymaps/via/rules.mk new file mode 100644 index 000000000000..36b7ba9cbc98 --- /dev/null +++ b/keyboards/cannonkeys/ortho48v2/keymaps/via/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +LTO_ENABLE = yes diff --git a/keyboards/cannonkeys/ortho48v2/mcuconf.h b/keyboards/cannonkeys/ortho48v2/mcuconf.h new file mode 100644 index 000000000000..533c3f1e2300 --- /dev/null +++ b/keyboards/cannonkeys/ortho48v2/mcuconf.h @@ -0,0 +1,9 @@ +// Copyright 2022 Andrew Kannan +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include_next "mcuconf.h" + +#undef RP_PWM_USE_PWM6 +#define RP_PWM_USE_PWM6 TRUE diff --git a/keyboards/cannonkeys/ortho48v2/rules.mk b/keyboards/cannonkeys/ortho48v2/rules.mk new file mode 100644 index 000000000000..59f8593f1849 --- /dev/null +++ b/keyboards/cannonkeys/ortho48v2/rules.mk @@ -0,0 +1,2 @@ +EEPROM_DRIVER = wear_leveling +WEAR_LEVELING_DRIVER = rp2040_flash From 0bb16027ed538514ac8ee533b88decb858c30d88 Mon Sep 17 00:00:00 2001 From: Andrew Kannan Date: Thu, 27 Oct 2022 16:09:02 -0400 Subject: [PATCH 02/14] Add readme for ortho48 v2 --- keyboards/cannonkeys/ortho48v2/readme.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 keyboards/cannonkeys/ortho48v2/readme.md diff --git a/keyboards/cannonkeys/ortho48v2/readme.md b/keyboards/cannonkeys/ortho48v2/readme.md new file mode 100644 index 000000000000..aa62dfed9cc2 --- /dev/null +++ b/keyboards/cannonkeys/ortho48v2/readme.md @@ -0,0 +1,22 @@ +# Ortho 48 v2 + +A 4x12 Ortholinear keyboard powered by an onboard RP2040 + +Keyboard Maintainer: [Andrew Kannan](https://github.com/awkannan1) +Hardware Supported: RP2040 +* Hardware Availability: [CannonKeys](https://cannonkeys.com) + +Make example for this keyboard (after setting up your build environment): + + make cannonkeys/ortho48v2: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 key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard +* **Physical reset button**: Swap the boot switch on the back of the PCB to "1" and hit the reset button. Or double tap the reset button quickly while the boot switch is set to "0". +* **Keycode in layout**: Press the key mapped to `RESET` if it is available From 05d32a4acca6b3611f3602303cc04b2112b59107 Mon Sep 17 00:00:00 2001 From: Andrew Kannan Date: Thu, 27 Oct 2022 16:13:00 -0400 Subject: [PATCH 03/14] Update readme formatting --- keyboards/cannonkeys/ortho48v2/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/cannonkeys/ortho48v2/readme.md b/keyboards/cannonkeys/ortho48v2/readme.md index aa62dfed9cc2..bb96fbe51741 100644 --- a/keyboards/cannonkeys/ortho48v2/readme.md +++ b/keyboards/cannonkeys/ortho48v2/readme.md @@ -2,8 +2,8 @@ A 4x12 Ortholinear keyboard powered by an onboard RP2040 -Keyboard Maintainer: [Andrew Kannan](https://github.com/awkannan1) -Hardware Supported: RP2040 +* Keyboard Maintainer: [Andrew Kannan](https://github.com/awkannan) +* Hardware Supported: RP2040 * Hardware Availability: [CannonKeys](https://cannonkeys.com) Make example for this keyboard (after setting up your build environment): From e830ce4818c438d224c4d29c6bd1728574c87c95 Mon Sep 17 00:00:00 2001 From: Andrew Kannan Date: Fri, 18 Nov 2022 23:23:21 -0500 Subject: [PATCH 04/14] Actually enable the encoder and make it do something --- keyboards/cannonkeys/ortho48v2/info.json | 3 ++- keyboards/cannonkeys/ortho48v2/ortho48v2.c | 26 ++++++++++++++++++++++ keyboards/cannonkeys/ortho48v2/ortho48v2.h | 19 ++++++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 keyboards/cannonkeys/ortho48v2/ortho48v2.c create mode 100644 keyboards/cannonkeys/ortho48v2/ortho48v2.h diff --git a/keyboards/cannonkeys/ortho48v2/info.json b/keyboards/cannonkeys/ortho48v2/info.json index 7dc0f89a01d3..b2416f9b46c7 100644 --- a/keyboards/cannonkeys/ortho48v2/info.json +++ b/keyboards/cannonkeys/ortho48v2/info.json @@ -22,7 +22,8 @@ "extrakey": true, "mousekey": true, "nkro": true, - "backlight": true + "backlight": true, + "encoder": true }, "encoder": { "rotary": [ diff --git a/keyboards/cannonkeys/ortho48v2/ortho48v2.c b/keyboards/cannonkeys/ortho48v2/ortho48v2.c new file mode 100644 index 000000000000..aa1bfd89a417 --- /dev/null +++ b/keyboards/cannonkeys/ortho48v2/ortho48v2.c @@ -0,0 +1,26 @@ +/* +Copyright 2022 CannonKeys + +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 "ortho48v2.h" + +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (clockwise) { + tap_code_delay(KC_VOLU, 10); + } else { + tap_code_delay(KC_VOLD, 10); + } + return encoder_update_user(index, clockwise); +} diff --git a/keyboards/cannonkeys/ortho48v2/ortho48v2.h b/keyboards/cannonkeys/ortho48v2/ortho48v2.h new file mode 100644 index 000000000000..a9ca3d7e47ac --- /dev/null +++ b/keyboards/cannonkeys/ortho48v2/ortho48v2.h @@ -0,0 +1,19 @@ +/* +Copyright 2022 CannonKeys + +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" From ab288e72d0ad48712f70b8e6709f97c2d0572f75 Mon Sep 17 00:00:00 2001 From: Andrew Kannan Date: Tue, 1 Nov 2022 14:32:17 -0400 Subject: [PATCH 05/14] Apply suggestions from code review Co-authored-by: Drashna Jaelre --- keyboards/cannonkeys/ortho48v2/keymaps/default/keymap.c | 8 +++++--- keyboards/cannonkeys/ortho48v2/keymaps/via/rules.mk | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/keyboards/cannonkeys/ortho48v2/keymaps/default/keymap.c b/keyboards/cannonkeys/ortho48v2/keymaps/default/keymap.c index c02fc0a4702f..88a34a2eee3b 100644 --- a/keyboards/cannonkeys/ortho48v2/keymaps/default/keymap.c +++ b/keyboards/cannonkeys/ortho48v2/keymaps/default/keymap.c @@ -21,9 +21,11 @@ along with this program. If not, see . // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them // entirely and just use numbers. -#define _BASE 0 -#define _RAISE 1 -#define _LOWER 2 +enum custom_layers { + _BASE, + _RAISE, + _LOWER, +}; enum custom_keycodes { QWERTY = SAFE_RANGE, diff --git a/keyboards/cannonkeys/ortho48v2/keymaps/via/rules.mk b/keyboards/cannonkeys/ortho48v2/keymaps/via/rules.mk index 36b7ba9cbc98..1e5b99807cb7 100644 --- a/keyboards/cannonkeys/ortho48v2/keymaps/via/rules.mk +++ b/keyboards/cannonkeys/ortho48v2/keymaps/via/rules.mk @@ -1,2 +1 @@ VIA_ENABLE = yes -LTO_ENABLE = yes From af581c7227b00b42e67e9ded9d71c40ae64c8f18 Mon Sep 17 00:00:00 2001 From: Andrew Kannan Date: Sat, 12 Nov 2022 21:07:07 -0500 Subject: [PATCH 06/14] Update keyboards/cannonkeys/ortho48v2/info.json Co-authored-by: Drashna Jaelre --- keyboards/cannonkeys/ortho48v2/info.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/keyboards/cannonkeys/ortho48v2/info.json b/keyboards/cannonkeys/ortho48v2/info.json index b2416f9b46c7..e49d86d517cb 100644 --- a/keyboards/cannonkeys/ortho48v2/info.json +++ b/keyboards/cannonkeys/ortho48v2/info.json @@ -36,6 +36,9 @@ "levels": 15, "pin": "GP12" }, + "community_layouts": [ + "ortho_4x12" + ], "layouts": { "LAYOUT_ortho_4x12": { "layout": [ From 7f4eab4e8a7c4745dc51bef5de0d898ef4592a89 Mon Sep 17 00:00:00 2001 From: Andrew Kannan Date: Thu, 19 Jan 2023 15:37:02 -0500 Subject: [PATCH 07/14] Encoder map updates --- keyboards/cannonkeys/ortho48v2/info.json | 3 ++- keyboards/cannonkeys/ortho48v2/keymaps/default/keymap.c | 8 ++++++++ keyboards/cannonkeys/ortho48v2/keymaps/via/keymap.c | 9 +++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/keyboards/cannonkeys/ortho48v2/info.json b/keyboards/cannonkeys/ortho48v2/info.json index e49d86d517cb..b6d9c34ada01 100644 --- a/keyboards/cannonkeys/ortho48v2/info.json +++ b/keyboards/cannonkeys/ortho48v2/info.json @@ -23,7 +23,8 @@ "mousekey": true, "nkro": true, "backlight": true, - "encoder": true + "encoder": true, + "encoder_map": true }, "encoder": { "rotary": [ diff --git a/keyboards/cannonkeys/ortho48v2/keymaps/default/keymap.c b/keyboards/cannonkeys/ortho48v2/keymaps/default/keymap.c index 88a34a2eee3b..15a792da2ead 100644 --- a/keyboards/cannonkeys/ortho48v2/keymaps/default/keymap.c +++ b/keyboards/cannonkeys/ortho48v2/keymaps/default/keymap.c @@ -88,3 +88,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { RGB_TOG, RGB_MOD, BL_INC, BL_DEC, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), }; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [_LOWER] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN) }, + [_RAISE] = { ENCODER_CCW_CW(KC_MS_WH_LEFT, KC_MS_WH_RIGHT) }, +}; +#endif diff --git a/keyboards/cannonkeys/ortho48v2/keymaps/via/keymap.c b/keyboards/cannonkeys/ortho48v2/keymaps/via/keymap.c index ea9651f2d691..fc02a1986719 100644 --- a/keyboards/cannonkeys/ortho48v2/keymaps/via/keymap.c +++ b/keyboards/cannonkeys/ortho48v2/keymaps/via/keymap.c @@ -47,3 +47,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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] = { + [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [1] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN) }, + [2] = { ENCODER_CCW_CW(KC_MS_WH_LEFT, KC_MS_WH_RIGHT) }, + [3] = { ENCODER_CCW_CW(QK_BACKLIGHT_DOWN, QK_BACKLIGHT_UP) }, +}; +#endif From 6c24b7e839bc28aeb4527f806740e676bb0651f9 Mon Sep 17 00:00:00 2001 From: Andrew Kannan Date: Thu, 19 Jan 2023 15:40:37 -0500 Subject: [PATCH 08/14] Remove unnecessary code --- keyboards/cannonkeys/ortho48v2/ortho48v2.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/keyboards/cannonkeys/ortho48v2/ortho48v2.c b/keyboards/cannonkeys/ortho48v2/ortho48v2.c index aa1bfd89a417..f9a009c7a24e 100644 --- a/keyboards/cannonkeys/ortho48v2/ortho48v2.c +++ b/keyboards/cannonkeys/ortho48v2/ortho48v2.c @@ -15,12 +15,3 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "ortho48v2.h" - -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - return encoder_update_user(index, clockwise); -} From 3255ec2571578428c854086c1bd4b5b50c3275a1 Mon Sep 17 00:00:00 2001 From: Andrew Kannan Date: Thu, 19 Jan 2023 15:42:16 -0500 Subject: [PATCH 09/14] Update license header --- keyboards/cannonkeys/ortho48v2/halconf.h | 19 ++----------------- keyboards/cannonkeys/ortho48v2/mcuconf.h | 2 +- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/keyboards/cannonkeys/ortho48v2/halconf.h b/keyboards/cannonkeys/ortho48v2/halconf.h index 54f3d4ab1d44..8c1197b84c63 100644 --- a/keyboards/cannonkeys/ortho48v2/halconf.h +++ b/keyboards/cannonkeys/ortho48v2/halconf.h @@ -1,20 +1,5 @@ - /* - Copyright 2022 CannonKeys - - * 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 . - */ - +// Copyright 2022 Andrew Kannan +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/keyboards/cannonkeys/ortho48v2/mcuconf.h b/keyboards/cannonkeys/ortho48v2/mcuconf.h index 533c3f1e2300..75a6bb41ec7c 100644 --- a/keyboards/cannonkeys/ortho48v2/mcuconf.h +++ b/keyboards/cannonkeys/ortho48v2/mcuconf.h @@ -3,7 +3,7 @@ #pragma once -#include_next "mcuconf.h" +#include_next #undef RP_PWM_USE_PWM6 #define RP_PWM_USE_PWM6 TRUE From 1c6e537f7517498c3b85c1b99c13df06f8a1fe90 Mon Sep 17 00:00:00 2001 From: Andrew Kannan Date: Fri, 20 Jan 2023 11:24:18 -0500 Subject: [PATCH 10/14] Remove stub files --- keyboards/cannonkeys/ortho48v2/ortho48v2.c | 17 ----------------- keyboards/cannonkeys/ortho48v2/ortho48v2.h | 19 ------------------- 2 files changed, 36 deletions(-) delete mode 100644 keyboards/cannonkeys/ortho48v2/ortho48v2.c delete mode 100644 keyboards/cannonkeys/ortho48v2/ortho48v2.h diff --git a/keyboards/cannonkeys/ortho48v2/ortho48v2.c b/keyboards/cannonkeys/ortho48v2/ortho48v2.c deleted file mode 100644 index f9a009c7a24e..000000000000 --- a/keyboards/cannonkeys/ortho48v2/ortho48v2.c +++ /dev/null @@ -1,17 +0,0 @@ -/* -Copyright 2022 CannonKeys - -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 "ortho48v2.h" diff --git a/keyboards/cannonkeys/ortho48v2/ortho48v2.h b/keyboards/cannonkeys/ortho48v2/ortho48v2.h deleted file mode 100644 index a9ca3d7e47ac..000000000000 --- a/keyboards/cannonkeys/ortho48v2/ortho48v2.h +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2022 CannonKeys - -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" From e884fb02321adbc365a19b7d739e3610f0f97b9a Mon Sep 17 00:00:00 2001 From: Andrew Kannan Date: Mon, 6 Mar 2023 14:49:23 -0500 Subject: [PATCH 11/14] move encoder map settings to the keymap level --- keyboards/cannonkeys/ortho48v2/info.json | 1 - keyboards/cannonkeys/ortho48v2/keymaps/default/keymap.c | 6 ------ keyboards/cannonkeys/ortho48v2/keymaps/via/rules.mk | 1 + 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/keyboards/cannonkeys/ortho48v2/info.json b/keyboards/cannonkeys/ortho48v2/info.json index b6d9c34ada01..8b6dfe32ddce 100644 --- a/keyboards/cannonkeys/ortho48v2/info.json +++ b/keyboards/cannonkeys/ortho48v2/info.json @@ -24,7 +24,6 @@ "nkro": true, "backlight": true, "encoder": true, - "encoder_map": true }, "encoder": { "rotary": [ diff --git a/keyboards/cannonkeys/ortho48v2/keymaps/default/keymap.c b/keyboards/cannonkeys/ortho48v2/keymaps/default/keymap.c index 15a792da2ead..deb920441823 100644 --- a/keyboards/cannonkeys/ortho48v2/keymaps/default/keymap.c +++ b/keyboards/cannonkeys/ortho48v2/keymaps/default/keymap.c @@ -27,12 +27,6 @@ enum custom_layers { _LOWER, }; -enum custom_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE -}; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty diff --git a/keyboards/cannonkeys/ortho48v2/keymaps/via/rules.mk b/keyboards/cannonkeys/ortho48v2/keymaps/via/rules.mk index 1e5b99807cb7..f1adcab005e8 100644 --- a/keyboards/cannonkeys/ortho48v2/keymaps/via/rules.mk +++ b/keyboards/cannonkeys/ortho48v2/keymaps/via/rules.mk @@ -1 +1,2 @@ VIA_ENABLE = yes +ENCODER_MAP_ENABLE = yes From ecfcdd6b820290dc7d835c305c30161eaf5c13aa Mon Sep 17 00:00:00 2001 From: Andrew Kannan Date: Mon, 6 Mar 2023 14:51:22 -0500 Subject: [PATCH 12/14] Add missing rules.mk --- keyboards/cannonkeys/ortho48v2/keymaps/default/rules.mk | 1 + 1 file changed, 1 insertion(+) create mode 100644 keyboards/cannonkeys/ortho48v2/keymaps/default/rules.mk diff --git a/keyboards/cannonkeys/ortho48v2/keymaps/default/rules.mk b/keyboards/cannonkeys/ortho48v2/keymaps/default/rules.mk new file mode 100644 index 000000000000..ee325681483f --- /dev/null +++ b/keyboards/cannonkeys/ortho48v2/keymaps/default/rules.mk @@ -0,0 +1 @@ +ENCODER_MAP_ENABLE = yes From f2d42c18a37f932c7243be4cea10eef71cc9ea07 Mon Sep 17 00:00:00 2001 From: Andrew Kannan Date: Mon, 6 Mar 2023 14:54:00 -0500 Subject: [PATCH 13/14] Fix backlight codes --- keyboards/cannonkeys/ortho48v2/keymaps/default/keymap.c | 2 +- keyboards/cannonkeys/ortho48v2/keymaps/via/keymap.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/cannonkeys/ortho48v2/keymaps/default/keymap.c b/keyboards/cannonkeys/ortho48v2/keymaps/default/keymap.c index deb920441823..78e35ff821d5 100644 --- a/keyboards/cannonkeys/ortho48v2/keymaps/default/keymap.c +++ b/keyboards/cannonkeys/ortho48v2/keymaps/default/keymap.c @@ -79,7 +79,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, - RGB_TOG, RGB_MOD, BL_INC, BL_DEC, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + RGB_TOG, RGB_MOD, BL_UP , BL_DOWN, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), }; diff --git a/keyboards/cannonkeys/ortho48v2/keymaps/via/keymap.c b/keyboards/cannonkeys/ortho48v2/keymaps/via/keymap.c index fc02a1986719..4129b4e0f5c0 100644 --- a/keyboards/cannonkeys/ortho48v2/keymaps/via/keymap.c +++ b/keyboards/cannonkeys/ortho48v2/keymaps/via/keymap.c @@ -37,7 +37,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, - RGB_TOG, RGB_MOD, BL_INC, BL_DEC, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + RGB_TOG, RGB_MOD, BL_UP , BL_DOWN, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), [3] = LAYOUT_ortho_4x12( From 15aedef2bcad483234e76583a895e70aa8d0f987 Mon Sep 17 00:00:00 2001 From: Andrew Kannan Date: Mon, 6 Mar 2023 14:54:20 -0500 Subject: [PATCH 14/14] Fix bad JSON --- keyboards/cannonkeys/ortho48v2/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/cannonkeys/ortho48v2/info.json b/keyboards/cannonkeys/ortho48v2/info.json index 8b6dfe32ddce..e49d86d517cb 100644 --- a/keyboards/cannonkeys/ortho48v2/info.json +++ b/keyboards/cannonkeys/ortho48v2/info.json @@ -23,7 +23,7 @@ "mousekey": true, "nkro": true, "backlight": true, - "encoder": true, + "encoder": true }, "encoder": { "rotary": [