From 164c3526286f7dd09cff7e92d9c6fd780ae607f2 Mon Sep 17 00:00:00 2001 From: YakMM Date: Wed, 11 Oct 2023 21:35:18 +0200 Subject: [PATCH 1/4] Add files --- .../herringbone/pro/keymaps/vial/config.h | 9 + .../herringbone/pro/keymaps/vial/keymap.c | 105 ++++++ .../herringbone/pro/keymaps/vial/rules.mk | 8 + .../herringbone/pro/keymaps/vial/vial.json | 323 ++++++++++++++++++ 4 files changed, 445 insertions(+) create mode 100644 keyboards/rmi_kb/herringbone/pro/keymaps/vial/config.h create mode 100644 keyboards/rmi_kb/herringbone/pro/keymaps/vial/keymap.c create mode 100644 keyboards/rmi_kb/herringbone/pro/keymaps/vial/rules.mk create mode 100644 keyboards/rmi_kb/herringbone/pro/keymaps/vial/vial.json diff --git a/keyboards/rmi_kb/herringbone/pro/keymaps/vial/config.h b/keyboards/rmi_kb/herringbone/pro/keymaps/vial/config.h new file mode 100644 index 00000000000..c7afb0c5161 --- /dev/null +++ b/keyboards/rmi_kb/herringbone/pro/keymaps/vial/config.h @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#pragma once + +#define VIAL_KEYBOARD_UID {0xA3, 0x05, 0x8B, 0xF1, 0xAA, 0xE9, 0x97, 0xE8} +#define VIAL_UNLOCK_COMBO_ROWS { 0, 0 } +#define VIAL_UNLOCK_COMBO_COLS { 0, 2 } + +#define DYNAMIC_KEYMAP_LAYER_COUNT 1 diff --git a/keyboards/rmi_kb/herringbone/pro/keymaps/vial/keymap.c b/keyboards/rmi_kb/herringbone/pro/keymaps/vial/keymap.c new file mode 100644 index 00000000000..a0a2d3b6564 --- /dev/null +++ b/keyboards/rmi_kb/herringbone/pro/keymaps/vial/keymap.c @@ -0,0 +1,105 @@ +/* Copyright 2020 Ramon Imbao + * + * 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 + +#include "pattern.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ansi( + 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_MUTE, + 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_HOME, + 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_PGUP, + 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_PGDN, + 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_UP, KC_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), +}; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [0] = { ENCODER_CCW_CW(KC_VOLU, KC_VOLD) } +}; +#endif + +#ifdef OLED_ENABLE +uint32_t anim_timer = 0; +uint32_t anim_sleep = 0; +uint8_t current_frame = 0; + +#define FRAME_DURATION 50 + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (clockwise) { + tap_code(KC_VOLU); + anim_sleep = timer_read32(); + oled_on(); + } else { + tap_code(KC_VOLD); + anim_sleep = timer_read32(); + oled_on(); + } + return true; +} + +static void render_pattern(void) { + void animate(void) { + oled_set_cursor(4, 0); + oled_write_raw_P(pattern_a[current_frame], 96); + oled_set_cursor(4, 1); + oled_write_raw_P(pattern_b[current_frame], 96); + oled_set_cursor(4, 2); + oled_write_raw_P(pattern_a[current_frame], 96); + + current_frame = (current_frame + 1) % 32; + } + + if (get_current_wpm() != 000) { + oled_on(); + if (timer_elapsed32(anim_timer) > FRAME_DURATION) { + anim_timer = timer_read32(); + animate(); + } + anim_sleep = timer_read32(); + } else { + if (timer_elapsed32(anim_sleep) > OLED_TIMEOUT) { + oled_off(); + } else { + oled_on(); + if (timer_elapsed32(anim_timer) > FRAME_DURATION) { + anim_timer = timer_read32(); + animate(); + } + } + } +} + +bool oled_task_user(void) { + // Render Herringbone pattern + render_pattern(); + oled_render(); + + // Host Keyboard LED Status + led_t led_state = host_keyboard_led_state(); + oled_set_cursor(0, 0); + oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); + oled_set_cursor(0, 1); + oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); + oled_set_cursor(0, 2); + oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); + oled_render(); + return false; +} +#endif diff --git a/keyboards/rmi_kb/herringbone/pro/keymaps/vial/rules.mk b/keyboards/rmi_kb/herringbone/pro/keymaps/vial/rules.mk new file mode 100644 index 00000000000..aad96dbb98a --- /dev/null +++ b/keyboards/rmi_kb/herringbone/pro/keymaps/vial/rules.mk @@ -0,0 +1,8 @@ +VIA_ENABLE = yes +VIAL_ENABLE = yes +ENCODER_MAP_ENABLE = yes +LTO_ENABLE = yes +QMK_SETTINGS = no +TAP_DANCE_ENABLE = no +COMBO_ENABLE = no +KEY_OVERRIDE_ENABLE = no diff --git a/keyboards/rmi_kb/herringbone/pro/keymaps/vial/vial.json b/keyboards/rmi_kb/herringbone/pro/keymaps/vial/vial.json new file mode 100644 index 00000000000..f0ca6d3c9c5 --- /dev/null +++ b/keyboards/rmi_kb/herringbone/pro/keymaps/vial/vial.json @@ -0,0 +1,323 @@ +{ + "name": "Herringbone Pro", + "vendorId": "0xB16B", + "productId": "0x440B", + "matrix": {"rows": 7, "cols": 15}, + "layouts": { + "keymap": [ + [ + { + "x": 2.5, + "c": "#777777" + }, + "0,0", + { + "x": 0.25, + "c": "#aaaaaa" + }, + "0,1", + "0,2", + "0,3", + "0,4", + { + "x": 0.25, + "c": "#777777" + }, + "0,5", + "0,6", + "0,7", + "0,8", + { + "x": 0.25, + "c": "#aaaaaa" + }, + "0,9", + "0,10", + "0,11", + "0,12", + { + "x": 0.25 + }, + "0,13", + { + "x": 0.5, + "c": "#cccccc" + }, + "0,0\n\n\n\n\n\n\n\n\ne", + { + "c": "#777777" + }, + "0,14", + { + "c": "#cccccc" + }, + "0,1\n\n\n\n\n\n\n\n\ne" + ], + [ + { + "y": 0.25, + "x": 2.5 + }, + "1,0", + "1,1", + "1,2", + "1,3", + "1,4", + "1,5", + "1,6", + "1,7", + "1,8", + "1,9", + "1,10", + "1,11", + "1,12", + { + "c": "#aaaaaa", + "w": 2 + }, + "1,13\n\n\n0,0", + { + "x": 0.5 + }, + "1,14", + { + "x": 0.5 + }, + "1,13\n\n\n0,1", + "3,12\n\n\n0,1" + ], + [ + { + "x": 2.5, + "w": 1.5 + }, + "2,0", + { + "c": "#cccccc" + }, + "2,1", + "2,2", + "2,3", + "2,4", + "2,5", + "2,6", + "2,7", + "2,8", + "2,9", + "2,10", + "2,11", + "2,12", + { + "w": 1.5 + }, + "2,13\n\n\n1,0", + { + "x": 0.5, + "c": "#aaaaaa" + }, + "2,14", + { + "x": 1.25, + "c": "#777777", + "w": 1.25, + "h": 2, + "w2": 1.5, + "h2": 1, + "x2": -0.25 + }, + "2,13\n\n\n1,1" + ], + [ + { + "x": 2.5, + "c": "#aaaaaa", + "w": 1.75 + }, + "3,0", + { + "c": "#cccccc" + }, + "3,1", + "3,2", + "3,3", + "3,4", + "3,5", + "3,6", + "3,7", + "3,8", + "3,9", + "3,10", + "3,11", + { + "c": "#777777", + "w": 2.25 + }, + "3,13\n\n\n1,0", + { + "x": 0.5, + "c": "#aaaaaa" + }, + "3,14", + { + "x": 0.25, + "c": "#cccccc" + }, + "3,13\n\n\n1,1" + ], + [ + { + "c": "#aaaaaa", + "w": 1.25 + }, + "4,0\n\n\n2,1", + { + "c": "#cccccc" + }, + "5,1\n\n\n2,1", + { + "x": 0.25, + "c": "#aaaaaa", + "w": 2.25 + }, + "4,0\n\n\n2,0", + { + "c": "#cccccc" + }, + "4,1", + "4,2", + "4,3", + "4,4", + "4,5", + "4,6", + "4,7", + "4,8", + "4,9", + "4,10", + { + "c": "#aaaaaa", + "w": 1.75 + }, + "4,11", + { + "x": 1.5 + }, + "4,14" + ], + [ + { + "y": -0.75, + "x": 16.75, + "c": "#777777" + }, + "4,13" + ], + [ + { + "y": -0.25, + "x": 2.5, + "c": "#aaaaaa", + "w": 1.25 + }, + "5,0\n\n\n3,0", + { + "w": 1.25 + }, + "5,2\n\n\n3,0", + { + "w": 1.25 + }, + "5,3\n\n\n3,0", + { + "c": "#cccccc", + "w": 6.25 + }, + "5,5\n\n\n3,0", + { + "c": "#aaaaaa", + "w": 1.5 + }, + "5,9\n\n\n3,0", + { + "w": 1.5 + }, + "5,10\n\n\n3,0" + ], + [ + { + "y": -0.75, + "x": 15.75, + "c": "#777777" + }, + "5,12", + "5,13", + "5,14" + ], + [ + { + "x": 2.5, + "c": "#aaaaaa", + "w": 1.5 + }, + "5,0\n\n\n3,1", + { + "w": 1.5 + }, + "5,3\n\n\n3,1", + { + "c": "#cccccc", + "w": 7 + }, + "5,5\n\n\n3,1", + { + "c": "#aaaaaa", + "w": 1.5 + }, + "5,9\n\n\n3,1", + { + "w": 1.5 + }, + "5,10\n\n\n3,1" + ], + [ + { + "x": 2.5, + "w": 1.25 + }, + "5,0\n\n\n3,2", + { + "w": 1.25 + }, + "5,2\n\n\n3,2", + { + "w": 1.25 + }, + "5,3\n\n\n3,2", + { + "c": "#cccccc", + "w": 2.25 + }, + "5,4\n\n\n3,2", + "5,5\n\n\n3,2", + { + "w": 3 + }, + "5,7\n\n\n3,2", + { + "c": "#aaaaaa", + "w": 1.5 + }, + "5,9\n\n\n3,2", + { + "w": 1.5 + }, + "5,10\n\n\n3,2" + ] + ], + "labels": [ + ["Backspace", "Unified", "Split"], + ["Enter", "ANSI", "ISO"], + ["Left Shift", "Unified", "Split"], + ["Bottom Row", "6.25u", "7u", "Split"] + ] + } + } From e958b51402e8476e62fd1136678dbafc61afe7c6 Mon Sep 17 00:00:00 2001 From: YakMM Date: Fri, 13 Oct 2023 10:19:38 +0200 Subject: [PATCH 2/4] Adjust settings --- keyboards/rmi_kb/herringbone/pro/info.json | 2 +- .../herringbone/pro/keymaps/vial/config.h | 4 +- .../herringbone/pro/keymaps/vial/keymap.c | 70 ------------------- .../herringbone/pro/keymaps/vial/rules.mk | 5 +- keyboards/rmi_kb/herringbone/pro/readme.md | 7 +- 5 files changed, 9 insertions(+), 79 deletions(-) diff --git a/keyboards/rmi_kb/herringbone/pro/info.json b/keyboards/rmi_kb/herringbone/pro/info.json index bbef69f28aa..89d45135f1e 100644 --- a/keyboards/rmi_kb/herringbone/pro/info.json +++ b/keyboards/rmi_kb/herringbone/pro/info.json @@ -15,7 +15,7 @@ "diode_direction": "COL2ROW", "encoder": { "rotary": [ - {"pin_a": "C3", "pin_b": "C2"} + {"pin_a": "C3", "pin_b": "C2", "resolution": 2} ] }, "processor": "atmega32a", diff --git a/keyboards/rmi_kb/herringbone/pro/keymaps/vial/config.h b/keyboards/rmi_kb/herringbone/pro/keymaps/vial/config.h index c7afb0c5161..113e2257a67 100644 --- a/keyboards/rmi_kb/herringbone/pro/keymaps/vial/config.h +++ b/keyboards/rmi_kb/herringbone/pro/keymaps/vial/config.h @@ -4,6 +4,6 @@ #define VIAL_KEYBOARD_UID {0xA3, 0x05, 0x8B, 0xF1, 0xAA, 0xE9, 0x97, 0xE8} #define VIAL_UNLOCK_COMBO_ROWS { 0, 0 } -#define VIAL_UNLOCK_COMBO_COLS { 0, 2 } +#define VIAL_UNLOCK_COMBO_COLS { 0, 1 } -#define DYNAMIC_KEYMAP_LAYER_COUNT 1 +#define DYNAMIC_KEYMAP_LAYER_COUNT 2 diff --git a/keyboards/rmi_kb/herringbone/pro/keymaps/vial/keymap.c b/keyboards/rmi_kb/herringbone/pro/keymaps/vial/keymap.c index a0a2d3b6564..b11ba716868 100644 --- a/keyboards/rmi_kb/herringbone/pro/keymaps/vial/keymap.c +++ b/keyboards/rmi_kb/herringbone/pro/keymaps/vial/keymap.c @@ -33,73 +33,3 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { [0] = { ENCODER_CCW_CW(KC_VOLU, KC_VOLD) } }; #endif - -#ifdef OLED_ENABLE -uint32_t anim_timer = 0; -uint32_t anim_sleep = 0; -uint8_t current_frame = 0; - -#define FRAME_DURATION 50 - -bool encoder_update_user(uint8_t index, bool clockwise) { - if (clockwise) { - tap_code(KC_VOLU); - anim_sleep = timer_read32(); - oled_on(); - } else { - tap_code(KC_VOLD); - anim_sleep = timer_read32(); - oled_on(); - } - return true; -} - -static void render_pattern(void) { - void animate(void) { - oled_set_cursor(4, 0); - oled_write_raw_P(pattern_a[current_frame], 96); - oled_set_cursor(4, 1); - oled_write_raw_P(pattern_b[current_frame], 96); - oled_set_cursor(4, 2); - oled_write_raw_P(pattern_a[current_frame], 96); - - current_frame = (current_frame + 1) % 32; - } - - if (get_current_wpm() != 000) { - oled_on(); - if (timer_elapsed32(anim_timer) > FRAME_DURATION) { - anim_timer = timer_read32(); - animate(); - } - anim_sleep = timer_read32(); - } else { - if (timer_elapsed32(anim_sleep) > OLED_TIMEOUT) { - oled_off(); - } else { - oled_on(); - if (timer_elapsed32(anim_timer) > FRAME_DURATION) { - anim_timer = timer_read32(); - animate(); - } - } - } -} - -bool oled_task_user(void) { - // Render Herringbone pattern - render_pattern(); - oled_render(); - - // Host Keyboard LED Status - led_t led_state = host_keyboard_led_state(); - oled_set_cursor(0, 0); - oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); - oled_set_cursor(0, 1); - oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); - oled_set_cursor(0, 2); - oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); - oled_render(); - return false; -} -#endif diff --git a/keyboards/rmi_kb/herringbone/pro/keymaps/vial/rules.mk b/keyboards/rmi_kb/herringbone/pro/keymaps/vial/rules.mk index aad96dbb98a..c543e985db5 100644 --- a/keyboards/rmi_kb/herringbone/pro/keymaps/vial/rules.mk +++ b/keyboards/rmi_kb/herringbone/pro/keymaps/vial/rules.mk @@ -1,8 +1,5 @@ VIA_ENABLE = yes VIAL_ENABLE = yes ENCODER_MAP_ENABLE = yes +OLED_ENABLE = no LTO_ENABLE = yes -QMK_SETTINGS = no -TAP_DANCE_ENABLE = no -COMBO_ENABLE = no -KEY_OVERRIDE_ENABLE = no diff --git a/keyboards/rmi_kb/herringbone/pro/readme.md b/keyboards/rmi_kb/herringbone/pro/readme.md index 4e3eef39f68..efc458e433d 100644 --- a/keyboards/rmi_kb/herringbone/pro/readme.md +++ b/keyboards/rmi_kb/herringbone/pro/readme.md @@ -5,9 +5,12 @@ A through-hole 75% keyboard with a rotary encoder and OLED display! * Keyboard Maintainer: [Ramon Imbao](https://github.com/ramonimbao) +* Vial port: [Yak](https://github.com/yakMM) * Hardware Supported: ATmega32A * Hardware Availability: [Herringbone](https://github.com/ramonimbao/Herringbone) +NOTE: Oled is not enabled on the vial port, due to firmware size constraints. + To get to the bootloader, 1. Press and hold the BOOT button @@ -16,8 +19,8 @@ To get to the bootloader, 3. Release the BOOT button -Make example for this keyboard (after setting up your build environment): +Make vial for this keyboard (after setting up your build environment): - make rmi_kb/herringbone/pro:default + make rmi_kb/herringbone/pro:vial 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). From 490c8ab50b76297a3cfd6ab0e61dc835987d44bc Mon Sep 17 00:00:00 2001 From: YakMM Date: Fri, 13 Oct 2023 10:19:49 +0200 Subject: [PATCH 3/4] Revert top-level change --- keyboards/rmi_kb/herringbone/pro/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/rmi_kb/herringbone/pro/info.json b/keyboards/rmi_kb/herringbone/pro/info.json index 89d45135f1e..bbef69f28aa 100644 --- a/keyboards/rmi_kb/herringbone/pro/info.json +++ b/keyboards/rmi_kb/herringbone/pro/info.json @@ -15,7 +15,7 @@ "diode_direction": "COL2ROW", "encoder": { "rotary": [ - {"pin_a": "C3", "pin_b": "C2", "resolution": 2} + {"pin_a": "C3", "pin_b": "C2"} ] }, "processor": "atmega32a", From 368ad9ba9ed514ec1437d56e952930fba798c46a Mon Sep 17 00:00:00 2001 From: YakMM Date: Fri, 13 Oct 2023 10:19:54 +0200 Subject: [PATCH 4/4] revert readme --- keyboards/rmi_kb/herringbone/pro/readme.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/keyboards/rmi_kb/herringbone/pro/readme.md b/keyboards/rmi_kb/herringbone/pro/readme.md index efc458e433d..4e3eef39f68 100644 --- a/keyboards/rmi_kb/herringbone/pro/readme.md +++ b/keyboards/rmi_kb/herringbone/pro/readme.md @@ -5,12 +5,9 @@ A through-hole 75% keyboard with a rotary encoder and OLED display! * Keyboard Maintainer: [Ramon Imbao](https://github.com/ramonimbao) -* Vial port: [Yak](https://github.com/yakMM) * Hardware Supported: ATmega32A * Hardware Availability: [Herringbone](https://github.com/ramonimbao/Herringbone) -NOTE: Oled is not enabled on the vial port, due to firmware size constraints. - To get to the bootloader, 1. Press and hold the BOOT button @@ -19,8 +16,8 @@ To get to the bootloader, 3. Release the BOOT button -Make vial for this keyboard (after setting up your build environment): +Make example for this keyboard (after setting up your build environment): - make rmi_kb/herringbone/pro:vial + make rmi_kb/herringbone/pro: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).