From 9a2b0a5db15a48a0297a4b82665d462361261600 Mon Sep 17 00:00:00 2001 From: mrT1ddl3s <60518619+mrT1ddl3s@users.noreply.github.com> Date: Tue, 16 Feb 2021 10:46:02 -0700 Subject: [PATCH] [Keyboard] Knob Goblin add via support (#11831) Co-authored-by: Ryan Co-authored-by: Drashna Jaelre Co-authored-by: Joel Challis --- keyboards/knobgoblin/config.h | 9 ++-- keyboards/knobgoblin/info.json | 45 ++++++++--------- keyboards/knobgoblin/keymaps/ortho/keymap.c | 5 +- keyboards/knobgoblin/keymaps/via/keymap.c | 53 +++++++++++++++++++++ keyboards/knobgoblin/keymaps/via/readme.md | 3 ++ keyboards/knobgoblin/keymaps/via/rules.mk | 2 + keyboards/knobgoblin/knobgoblin.c | 21 +++++--- keyboards/knobgoblin/readme.md | 4 +- keyboards/knobgoblin/rules.mk | 2 +- 9 files changed, 107 insertions(+), 37 deletions(-) create mode 100644 keyboards/knobgoblin/keymaps/via/keymap.c create mode 100644 keyboards/knobgoblin/keymaps/via/readme.md create mode 100644 keyboards/knobgoblin/keymaps/via/rules.mk diff --git a/keyboards/knobgoblin/config.h b/keyboards/knobgoblin/config.h index bee6056a02..ed6d69d6f0 100644 --- a/keyboards/knobgoblin/config.h +++ b/keyboards/knobgoblin/config.h @@ -19,12 +19,11 @@ #include "config_common.h" /* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED +#define VENDOR_ID 0x4B47 // KG #define PRODUCT_ID 0x0000 #define DEVICE_VER 0x0001 #define MANUFACTURER MrT1ddl3s -#define PRODUCT knobgoblin - +#define PRODUCT Knob Goblin /* key matrix size */ #define MATRIX_ROWS 5 #define MATRIX_COLS 5 @@ -43,3 +42,7 @@ #define DIODE_DIRECTION COL2ROW #define DEBOUNCE 2 + +/*Bootmagic position definition because (0,0) is not used*/ +#define BOOTMAGIC_LITE_ROW 0 +#define BOOTMAGIC_LITE_COLUMN 1 diff --git a/keyboards/knobgoblin/info.json b/keyboards/knobgoblin/info.json index 16404131bb..f63e00b44a 100644 --- a/keyboards/knobgoblin/info.json +++ b/keyboards/knobgoblin/info.json @@ -8,32 +8,33 @@ "LAYOUT_ortho": { "layout": [ - {"x": 1, "y": 0}, - {"x": 2, "y": 0}, - {"x": 3, "y": 0}, - {"x": 4, "y": 0}, + {"Label": "F17", "x": 1, "y": 0}, + {"Label": "F18", "x": 2, "y": 0}, + {"Label": "F19", "x": 3, "y": 0}, + {"Label": "F20", "x": 4, "y": 0}, - {"x": 1, "y": 1}, - {"x": 2, "y": 1}, - {"x": 3, "y": 1}, - {"x": 4, "y": 1}, + {"Label": "F13", "x": 1, "y": 1}, + {"Label": "F14", "x": 2, "y": 1}, + {"Label": "F15", "x": 3, "y": 1}, + {"Label": "F16", "x": 4, "y": 1}, - {"x": 1, "y": 2}, - {"x": 2, "y": 2}, - {"x": 3, "y": 2}, - {"x": 4, "y": 2}, + {"Label": "F9", "x": 1, "y": 2}, + {"Label": "F10", "x": 2, "y": 2}, + {"Label": "F11", "x": 3, "y": 2}, + {"Label": "F12", "x": 4, "y": 2}, - {"x": 0, "y": 3}, - {"x": 1, "y": 3}, - {"x": 2, "y": 3}, - {"x": 3, "y": 3}, - {"x": 4, "y": 3}, + {"Label": "K2", "x": 0, "y": 3}, + {"Label": "F5", "x": 1, "y": 3}, + {"Label": "F6", "x": 2, "y": 3}, + {"Label": "F7", "x": 3, "y": 3}, + {"Label": "F8", "x": 4, "y": 3}, + + {"Label": "K1", "x": 0, "y": 4}, + {"Label": "F1", "x": 1, "y": 4}, + {"Label": "F2", "x": 2, "y": 4}, + {"Label": "F3", "x": 3, "y": 4}, + {"Label": "F4", "x": 4, "y": 4} - {"x": 0, "y": 4}, - {"x": 1, "y": 4}, - {"x": 2, "y": 4}, - {"x": 3, "y": 4}, - {"x": 4, "y": 4} ] } } diff --git a/keyboards/knobgoblin/keymaps/ortho/keymap.c b/keyboards/knobgoblin/keymaps/ortho/keymap.c index 57c68a8b1b..8c2955ea7f 100644 --- a/keyboards/knobgoblin/keymaps/ortho/keymap.c +++ b/keyboards/knobgoblin/keymaps/ortho/keymap.c @@ -25,12 +25,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_MPLY, KC_P1, KC_P2, KC_P3, KC_PENT, KC_MUTE, MO(1), KC_P0, KC_PDOT, KC_PENT ), - + [1] = LAYOUT_ortho( KC_ESC, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_TRNS, KC_PGUP, KC_TRNS, KC_END , KC_UP, KC_PGDN, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_SPC, KC_TRNS, KC_TRNS, KC_BSPC, KC_DEL, KC_TRNS - ) + + ) }; diff --git a/keyboards/knobgoblin/keymaps/via/keymap.c b/keyboards/knobgoblin/keymaps/via/keymap.c new file mode 100644 index 0000000000..afe3226bb0 --- /dev/null +++ b/keyboards/knobgoblin/keymaps/via/keymap.c @@ -0,0 +1,53 @@ +/* Copyright 2020 MrT1ddl3s + * + * 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( + KC_EQL, KC_PSLS, KC_PAST, KC_PMNS, + KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_MPLY, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_MUTE, MO(1), KC_P0, KC_PDOT, KC_PENT + ), + + [1] = LAYOUT_ortho( + KC_ESC, KC_TRNS, KC_TRNS, KC_TRNS, + KC_HOME, KC_TRNS, KC_PGUP, KC_TRNS, + KC_END , KC_UP, KC_PGDN, KC_TRNS, + KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_SPC, + KC_TRNS, KC_TRNS, KC_BSPC, KC_DEL, KC_TRNS + ), + + [2] = LAYOUT_ortho( + 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 + ), + + [3] = LAYOUT_ortho( + 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 + ) + +}; \ No newline at end of file diff --git a/keyboards/knobgoblin/keymaps/via/readme.md b/keyboards/knobgoblin/keymaps/via/readme.md new file mode 100644 index 0000000000..f137c78c3a --- /dev/null +++ b/keyboards/knobgoblin/keymaps/via/readme.md @@ -0,0 +1,3 @@ +# Ortho Knob Goblin Layout + +Via functionality for the Knob Goblin. Ortho layout. \ No newline at end of file diff --git a/keyboards/knobgoblin/keymaps/via/rules.mk b/keyboards/knobgoblin/keymaps/via/rules.mk new file mode 100644 index 0000000000..ee1c5e7aef --- /dev/null +++ b/keyboards/knobgoblin/keymaps/via/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = YES +LTO_ENABLE = YES diff --git a/keyboards/knobgoblin/knobgoblin.c b/keyboards/knobgoblin/knobgoblin.c index 8905e770f1..2f5e02b138 100644 --- a/keyboards/knobgoblin/knobgoblin.c +++ b/keyboards/knobgoblin/knobgoblin.c @@ -74,22 +74,29 @@ static void render_goblin_logo(void) { __attribute__((weak)) void oled_task_user(void) { render_goblin_logo(); + + oled_set_cursor(0,11); switch (get_highest_layer(layer_state)) { case 0: - oled_set_cursor(0,11); - oled_advance_char(); - oled_write_P(PSTR("ONE\n"), false); + oled_write_P(PSTR(" ONE\n"), false); break; case 1: - oled_set_cursor(0,11); - oled_advance_char(); - oled_write_P(PSTR("TWO\n"), false); + oled_write_P(PSTR(" TWO\n"), false); break; case 2: - oled_set_cursor(0,11); oled_write_P(PSTR("THREE\n"), false); break; + case 3: + oled_write_P(PSTR(" FOUR\n"), false); + break; + case 4: + oled_write_P(PSTR(" FIVE\n"), false); + break; + case 5: + oled_write_P(PSTR(" SIX\n"), false); + break; + } } #endif diff --git a/keyboards/knobgoblin/readme.md b/keyboards/knobgoblin/readme.md index 20ebc92e94..0ce2b0c9c9 100644 --- a/keyboards/knobgoblin/readme.md +++ b/keyboards/knobgoblin/readme.md @@ -1,12 +1,12 @@ # KNOBGOBLIN -![Knob Goblin](https://i.imgur.com/oYnzqqNl.jpg) +![Knob Goblin](https://i.imgur.com/oYnzqqN.jpg) A 5x4 numpad with 2x rotary encoder and OLED support. * Keyboard Maintainer: [MrT1ddl3s](https://github.com/mrT1ddl3s) * Hardware Supported: knobgoblin PCB -* Hardware Availability: Occasional group buy.[knobgoblin.xyz](https://knobgoblin.xyz) +* Hardware Availability: Occasional group buy - [knob-goblin.com](https://knob-goblin.com) Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/knobgoblin/rules.mk b/keyboards/knobgoblin/rules.mk index d1c86defb6..17211c095d 100644 --- a/keyboards/knobgoblin/rules.mk +++ b/keyboards/knobgoblin/rules.mk @@ -7,7 +7,7 @@ BOOTLOADER = caterina # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration MOUSEKEY_ENABLE = no # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = yes # Console for debug