diff options
| -rw-r--r-- | keyboards/knobgoblin/info.json | 17 | ||||
| -rw-r--r-- | keyboards/knobgoblin/keymaps/ortho/keymap.c | 72 | ||||
| -rw-r--r-- | keyboards/knobgoblin/knobgoblin.c | 78 |
3 files changed, 88 insertions, 79 deletions
diff --git a/keyboards/knobgoblin/info.json b/keyboards/knobgoblin/info.json index b2da3efb3..16404131b 100644 --- a/keyboards/knobgoblin/info.json +++ b/keyboards/knobgoblin/info.json | |||
| @@ -2,17 +2,18 @@ | |||
| 2 | "keyboard_name": "knobgoblin", | 2 | "keyboard_name": "knobgoblin", |
| 3 | "url": "", | 3 | "url": "", |
| 4 | "maintainer": "MrT1ddl3s", | 4 | "maintainer": "MrT1ddl3s", |
| 5 | "width": 4, | 5 | "width": 5, |
| 6 | "height": 5, | 6 | "height": 5, |
| 7 | "layouts": { | 7 | "layouts": { |
| 8 | "LAYOUT": { | 8 | "LAYOUT_ortho": { |
| 9 | "layout_ortho": [ | 9 | "layout": [ |
| 10 | {"x": 1, "y": 0}, | 10 | |
| 11 | {"x": 1, "y": 0}, | ||
| 11 | {"x": 2, "y": 0}, | 12 | {"x": 2, "y": 0}, |
| 12 | {"x": 3, "y": 0}, | 13 | {"x": 3, "y": 0}, |
| 13 | {"x": 4, "y": 0}, | 14 | {"x": 4, "y": 0}, |
| 14 | 15 | ||
| 15 | {"x": 1, "y": 1}, | 16 | {"x": 1, "y": 1}, |
| 16 | {"x": 2, "y": 1}, | 17 | {"x": 2, "y": 1}, |
| 17 | {"x": 3, "y": 1}, | 18 | {"x": 3, "y": 1}, |
| 18 | {"x": 4, "y": 1}, | 19 | {"x": 4, "y": 1}, |
| @@ -22,12 +23,14 @@ | |||
| 22 | {"x": 3, "y": 2}, | 23 | {"x": 3, "y": 2}, |
| 23 | {"x": 4, "y": 2}, | 24 | {"x": 4, "y": 2}, |
| 24 | 25 | ||
| 25 | {"x": 1, "y": 3}, | 26 | {"x": 0, "y": 3}, |
| 27 | {"x": 1, "y": 3}, | ||
| 26 | {"x": 2, "y": 3}, | 28 | {"x": 2, "y": 3}, |
| 27 | {"x": 3, "y": 3}, | 29 | {"x": 3, "y": 3}, |
| 28 | {"x": 4, "y": 3}, | 30 | {"x": 4, "y": 3}, |
| 29 | 31 | ||
| 30 | {"x": 1, "y": 4}, | 32 | {"x": 0, "y": 4}, |
| 33 | {"x": 1, "y": 4}, | ||
| 31 | {"x": 2, "y": 4}, | 34 | {"x": 2, "y": 4}, |
| 32 | {"x": 3, "y": 4}, | 35 | {"x": 3, "y": 4}, |
| 33 | {"x": 4, "y": 4} | 36 | {"x": 4, "y": 4} |
diff --git a/keyboards/knobgoblin/keymaps/ortho/keymap.c b/keyboards/knobgoblin/keymaps/ortho/keymap.c index d545904a5..57c68a8b1 100644 --- a/keyboards/knobgoblin/keymaps/ortho/keymap.c +++ b/keyboards/knobgoblin/keymaps/ortho/keymap.c | |||
| @@ -16,7 +16,6 @@ | |||
| 16 | 16 | ||
| 17 | #include QMK_KEYBOARD_H | 17 | #include QMK_KEYBOARD_H |
| 18 | 18 | ||
| 19 | |||
| 20 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 19 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
| 21 | 20 | ||
| 22 | [0] = LAYOUT_ortho( | 21 | [0] = LAYOUT_ortho( |
| @@ -35,74 +34,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 35 | KC_TRNS, KC_TRNS, KC_BSPC, KC_DEL, KC_TRNS | 34 | KC_TRNS, KC_TRNS, KC_BSPC, KC_DEL, KC_TRNS |
| 36 | ) | 35 | ) |
| 37 | }; | 36 | }; |
| 38 | |||
| 39 | /* assign keycodes to the encoder rotation */ | ||
| 40 | void encoder_update_user(uint8_t index, bool clockwise) { | ||
| 41 | |||
| 42 | if (index == 1) { /* Bottom encoder */ | ||
| 43 | if (clockwise) { | ||
| 44 | tap_code(KC_VOLU); | ||
| 45 | } else { | ||
| 46 | tap_code(KC_VOLD); | ||
| 47 | } | ||
| 48 | } | ||
| 49 | if (index == 0) { /* Top encoder */ | ||
| 50 | if (clockwise) { | ||
| 51 | tap_code(KC_MNXT); | ||
| 52 | } else { | ||
| 53 | tap_code(KC_MPRV); | ||
| 54 | } | ||
| 55 | } | ||
| 56 | } | ||
| 57 | #ifdef OLED_DRIVER_ENABLE | ||
| 58 | /* rotate screen for proper orentation*/ | ||
| 59 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_270; } | ||
| 60 | |||
| 61 | /* byte map for the goblin logo, knob goblin text, and level text */ | ||
| 62 | static void render_logo(void) { | ||
| 63 | static const char PROGMEM my_logo[] = { | ||
| 64 | 0x00, 0xe0, 0x40, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0xc0, 0x60, 0x20, 0x10, 0x08, 0x08, 0x08, | ||
| 65 | 0x08, 0x08, 0x08, 0x10, 0x20, 0x60, 0xc0, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x40, 0xe0, 0x00, | ||
| 66 | 0x00, 0x03, 0x06, 0x3c, 0x49, 0x91, 0x21, 0x00, 0x40, 0x80, 0x80, 0x80, 0x80, 0x00, 0x60, 0x00, | ||
| 67 | 0x00, 0x60, 0x00, 0x80, 0x80, 0x80, 0x80, 0x40, 0x00, 0x21, 0x91, 0x49, 0x3c, 0x06, 0x03, 0x00, | ||
| 68 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1f, 0x60, 0x40, 0xc0, 0x06, 0x0e, 0x0f, 0x67, 0x50, 0xc0, | ||
| 69 | 0xc0, 0x50, 0x67, 0x0f, 0x0e, 0x06, 0xc0, 0x40, 0x60, 0x1f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 70 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x7b, 0xc7, 0x8e, 0x1e, 0x3e, 0x3e, | ||
| 71 | 0x3e, 0x3e, 0x1e, 0x8e, 0xc7, 0x7b, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 72 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x06, 0x04, | ||
| 73 | 0x04, 0x06, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 74 | 0x03, 0x03, 0x03, 0x03, 0x03, 0x83, 0x03, 0x03, 0x03, 0x83, 0x03, 0x83, 0x03, 0x03, 0x03, 0x83, | ||
| 75 | 0x03, 0x03, 0x83, 0x83, 0x83, 0x03, 0x03, 0x83, 0x83, 0x83, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, | ||
| 76 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x04, 0x06, 0x09, 0x10, 0x00, 0x1f, 0x03, 0x06, 0x0c, 0x1f, | ||
| 77 | 0x00, 0x0f, 0x10, 0x10, 0x10, 0x0f, 0x00, 0x1f, 0x12, 0x12, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 78 | 0x00, 0x78, 0xfc, 0x84, 0xa4, 0xa4, 0x68, 0x00, 0x78, 0x84, 0x84, 0x84, 0x78, 0x00, 0xfc, 0x94, | ||
| 79 | 0x94, 0x68, 0x00, 0xfc, 0x80, 0x80, 0x80, 0x00, 0xfc, 0x00, 0xfc, 0x18, 0x30, 0x60, 0xfc, 0x00, | ||
| 80 | 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, | ||
| 81 | 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, | ||
| 82 | 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x50, 0x50, 0x50, 0x00, 0xf0, 0x00, 0x00, | ||
| 83 | 0x00, 0xf0, 0x00, 0xf0, 0x50, 0x50, 0x50, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 84 | 0x00, 0x00, 0x00, 0x03, 0x02, 0x02, 0x02, 0x00, 0x03, 0x02, 0x02, 0x02, 0x00, 0x00, 0x01, 0x02, | ||
| 85 | 0x01, 0x00, 0x00, 0x03, 0x02, 0x02, 0x02, 0x00, 0x03, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00 | ||
| 86 | |||
| 87 | }; | ||
| 88 | oled_write_raw_P(my_logo, sizeof(my_logo)); | ||
| 89 | } | ||
| 90 | |||
| 91 | /* text display for layer indication */ | ||
| 92 | void oled_task_user(void) { | ||
| 93 | |||
| 94 | render_logo(); | ||
| 95 | oled_set_cursor(0,11); | ||
| 96 | oled_advance_char(); | ||
| 97 | switch (get_highest_layer(layer_state)) { | ||
| 98 | case 0: | ||
| 99 | oled_write_P(PSTR("ONE\n"), false); | ||
| 100 | break; | ||
| 101 | case 1: | ||
| 102 | oled_write_P(PSTR("TWO\n"), false); | ||
| 103 | break; | ||
| 104 | } | ||
| 105 | |||
| 106 | } | ||
| 107 | #endif | ||
| 108 | |||
diff --git a/keyboards/knobgoblin/knobgoblin.c b/keyboards/knobgoblin/knobgoblin.c index f82c0178a..8905e770f 100644 --- a/keyboards/knobgoblin/knobgoblin.c +++ b/keyboards/knobgoblin/knobgoblin.c | |||
| @@ -15,3 +15,81 @@ | |||
| 15 | */ | 15 | */ |
| 16 | 16 | ||
| 17 | #include "knobgoblin.h" | 17 | #include "knobgoblin.h" |
| 18 | |||
| 19 | #ifdef ENCODER_ENABLE | ||
| 20 | /* assign keycodes to the encoder rotation */ | ||
| 21 | __attribute__((weak)) void encoder_update_user(uint8_t index, bool clockwise) { | ||
| 22 | |||
| 23 | if (index == 1) { /* Bottom encoder */ | ||
| 24 | if (clockwise) { | ||
| 25 | tap_code(KC_VOLU); | ||
| 26 | } else { | ||
| 27 | tap_code(KC_VOLD); | ||
| 28 | } | ||
| 29 | } | ||
| 30 | if (index == 0) { /* Top encoder */ | ||
| 31 | if (clockwise) { | ||
| 32 | tap_code(KC_MNXT); | ||
| 33 | } else { | ||
| 34 | tap_code(KC_MPRV); | ||
| 35 | } | ||
| 36 | } | ||
| 37 | } | ||
| 38 | #endif | ||
| 39 | |||
| 40 | #ifdef OLED_DRIVER_ENABLE | ||
| 41 | /* rotate screen for proper orentation*/ | ||
| 42 | __attribute__((weak)) oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_270; } | ||
| 43 | |||
| 44 | /* byte map for the goblin logo, knob goblin text, and level text */ | ||
| 45 | static void render_goblin_logo(void) { | ||
| 46 | static const char PROGMEM my_logo[] = { | ||
| 47 | 0x00, 0xe0, 0x40, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0xc0, 0x60, 0x20, 0x10, 0x08, 0x08, 0x08, | ||
| 48 | 0x08, 0x08, 0x08, 0x10, 0x20, 0x60, 0xc0, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x40, 0xe0, 0x00, | ||
| 49 | 0x00, 0x03, 0x06, 0x3c, 0x49, 0x91, 0x21, 0x00, 0x40, 0x80, 0x80, 0x80, 0x80, 0x00, 0x60, 0x00, | ||
| 50 | 0x00, 0x60, 0x00, 0x80, 0x80, 0x80, 0x80, 0x40, 0x00, 0x21, 0x91, 0x49, 0x3c, 0x06, 0x03, 0x00, | ||
| 51 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1f, 0x60, 0x40, 0xc0, 0x06, 0x0e, 0x0f, 0x67, 0x50, 0xc0, | ||
| 52 | 0xc0, 0x50, 0x67, 0x0f, 0x0e, 0x06, 0xc0, 0x40, 0x60, 0x1f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 53 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x7b, 0xc7, 0x8e, 0x1e, 0x3e, 0x3e, | ||
| 54 | 0x3e, 0x3e, 0x1e, 0x8e, 0xc7, 0x7b, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 55 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x06, 0x04, | ||
| 56 | 0x04, 0x06, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 57 | 0x03, 0x03, 0x03, 0x03, 0x03, 0x83, 0x03, 0x03, 0x03, 0x83, 0x03, 0x83, 0x03, 0x03, 0x03, 0x83, | ||
| 58 | 0x03, 0x03, 0x83, 0x83, 0x83, 0x03, 0x03, 0x83, 0x83, 0x83, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, | ||
| 59 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x04, 0x06, 0x09, 0x10, 0x00, 0x1f, 0x03, 0x06, 0x0c, 0x1f, | ||
| 60 | 0x00, 0x0f, 0x10, 0x10, 0x10, 0x0f, 0x00, 0x1f, 0x12, 0x12, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 61 | 0x00, 0x78, 0xfc, 0x84, 0xa4, 0xa4, 0x68, 0x00, 0x78, 0x84, 0x84, 0x84, 0x78, 0x00, 0xfc, 0x94, | ||
| 62 | 0x94, 0x68, 0x00, 0xfc, 0x80, 0x80, 0x80, 0x00, 0xfc, 0x00, 0xfc, 0x18, 0x30, 0x60, 0xfc, 0x00, | ||
| 63 | 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, | ||
| 64 | 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, | ||
| 65 | 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x50, 0x50, 0x50, 0x00, 0xf0, 0x00, 0x00, | ||
| 66 | 0x00, 0xf0, 0x00, 0xf0, 0x50, 0x50, 0x50, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 67 | 0x00, 0x00, 0x00, 0x03, 0x02, 0x02, 0x02, 0x00, 0x03, 0x02, 0x02, 0x02, 0x00, 0x00, 0x01, 0x02, | ||
| 68 | 0x01, 0x00, 0x00, 0x03, 0x02, 0x02, 0x02, 0x00, 0x03, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00 | ||
| 69 | }; | ||
| 70 | oled_write_raw_P(my_logo, sizeof(my_logo)); | ||
| 71 | } | ||
| 72 | |||
| 73 | /* text display for layer indication */ | ||
| 74 | __attribute__((weak)) void oled_task_user(void) { | ||
| 75 | |||
| 76 | render_goblin_logo(); | ||
| 77 | |||
| 78 | switch (get_highest_layer(layer_state)) { | ||
| 79 | case 0: | ||
| 80 | oled_set_cursor(0,11); | ||
| 81 | oled_advance_char(); | ||
| 82 | oled_write_P(PSTR("ONE\n"), false); | ||
| 83 | break; | ||
| 84 | case 1: | ||
| 85 | oled_set_cursor(0,11); | ||
| 86 | oled_advance_char(); | ||
| 87 | oled_write_P(PSTR("TWO\n"), false); | ||
| 88 | break; | ||
| 89 | case 2: | ||
| 90 | oled_set_cursor(0,11); | ||
| 91 | oled_write_P(PSTR("THREE\n"), false); | ||
| 92 | break; | ||
| 93 | } | ||
| 94 | } | ||
| 95 | #endif | ||
