From a8bbebba5aff8fa7ef9dc6925f06319703b383f1 Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Sun, 18 Jul 2021 12:48:34 -0400 Subject: [PATCH] Cleaned up config for murphpad build (#32) --- .../mechwild/murphpad/keymaps/vial/config.h | 29 +++++ .../mechwild/murphpad/keymaps/vial/keymap.c | 123 ++++++++++++++++++ .../mechwild/murphpad/keymaps/vial/rules.mk | 7 + .../mechwild/murphpad/keymaps/vial/vial.json | 33 +++++ 4 files changed, 192 insertions(+) create mode 100644 keyboards/mechwild/murphpad/keymaps/vial/config.h create mode 100644 keyboards/mechwild/murphpad/keymaps/vial/keymap.c create mode 100644 keyboards/mechwild/murphpad/keymaps/vial/rules.mk create mode 100644 keyboards/mechwild/murphpad/keymaps/vial/vial.json diff --git a/keyboards/mechwild/murphpad/keymaps/vial/config.h b/keyboards/mechwild/murphpad/keymaps/vial/config.h new file mode 100644 index 0000000000..418673f081 --- /dev/null +++ b/keyboards/mechwild/murphpad/keymaps/vial/config.h @@ -0,0 +1,29 @@ +/* +Copyright 2021 Kyle McCreery +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 + +/* Saving space by including fewer RGB Animations */ +#undef RGBLIGHT_ANIMATIONS + +#define RGBLIGHT_EFFECT_BREATHING +#define RGBLIGHT_EFFECT_RAINBOW_MOOD +#define RGBLIGHT_EFFECT_RAINBOW_SWIRL +#define RGBLIGHT_EFFECT_STATIC_GRADIENT + +/* VIAL Specific definitions */ +#define VIAL_KEYBOARD_UID {0x3B, 0x87, 0xE1, 0xE7, 0x57, 0x30, 0x78, 0x13} +#define VIAL_UNLOCK_COMBO_ROWS { 0, 0 } +#define VIAL_UNLOCK_COMBO_COLS { 1, 4 } +#define VIAL_ENCODER_DEFAULT { KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS } \ No newline at end of file diff --git a/keyboards/mechwild/murphpad/keymaps/vial/keymap.c b/keyboards/mechwild/murphpad/keymaps/vial/keymap.c new file mode 100644 index 0000000000..901c7d9ee1 --- /dev/null +++ b/keyboards/mechwild/murphpad/keymaps/vial/keymap.c @@ -0,0 +1,123 @@ +/* Copyright 2021 Kyle McCreery + * + * 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 + +// Defines names for use in layer keycodes and the keymap +enum layer_names { + _BASE, + _FN1, + _FN2, + _FN3 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Base */ + [_BASE] = LAYOUT( + KC_F1, KC_F2, KC_F3, KC_F4, + KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_MUTE, KC_P4, KC_P5, KC_P6, KC_NO, + MO(_FN1), KC_P1, KC_P2, KC_P3, KC_PENT, + KC_BSPC, KC_P0, KC_NO, KC_PDOT, KC_NO, + + _______, _______, _______ + + ), + [_FN1] = LAYOUT( + _______, _______, _______, _______, + _______, _______, _______, _______, + RGB_HUD, RGB_SPI, RGB_HUI, _______, + _______, RGB_RMOD, RGB_TOG, RGB_MOD, KC_NO, + _______, RGB_VAD, RGB_SPD, RGB_VAI, _______, + _______, RGB_SAD, KC_NO, RGB_SAI, KC_NO, + + _______, _______, _______ + + ), + [_FN2] = LAYOUT( + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______, KC_NO, + _______, _______, _______, _______, _______, + _______, _______, _______, _______, KC_NO, + + _______, _______, _______ + + ), + [_FN3] = LAYOUT( + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______, KC_NO, + _______, _______, _______, _______, _______, + _______, _______, _______, _______, KC_NO, + + _______, _______, _______ + + ) +}; + +#ifdef OLED_DRIVER_ENABLE + oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_270; // flips the display 270 degrees + } + + static void render_logo(void) { // Render MechWild "MW" Logo + static const char PROGMEM logo_1[] = {0x8A, 0x8B, 0x8C, 0x8D, 0x00}; + static const char PROGMEM logo_2[] = {0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0x00}; + static const char PROGMEM logo_3[] = {0xCA, 0xCB, 0xCC, 0xCD, 0x00}; + static const char PROGMEM logo_4[] = {0x20, 0x8E, 0x8F, 0x90, 0x00}; + oled_set_cursor(0,0); + oled_write_P(logo_1, false); + oled_set_cursor(0,1); + oled_write_P(logo_2, false); + oled_set_cursor(0,2); + oled_write_P(logo_3, false); + oled_set_cursor(0,3); + oled_write_P(logo_4, false); + } + + void oled_task_user(void) { + render_logo(); + oled_set_cursor(0,6); + + oled_write_ln_P(PSTR("Layer"), false); + + switch (get_highest_layer(layer_state)) { + case _BASE: + oled_write_ln_P(PSTR("Base"), false); + break; + case _FN1: + oled_write_ln_P(PSTR("FN 1"), false); + break; + case _FN2: + oled_write_ln_P(PSTR("FN 2"), false); + break; + case _FN3: + oled_write_ln_P(PSTR("FN 3"), false); + break; + default: + oled_write_ln_P(PSTR("Undef"), false); + } + oled_write_ln_P(PSTR(""), false); + // Host Keyboard LED Status + led_t led_state = host_keyboard_led_state(); + oled_write_ln_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); + oled_write_ln_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); + oled_write_ln_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); + } +#endif \ No newline at end of file diff --git a/keyboards/mechwild/murphpad/keymaps/vial/rules.mk b/keyboards/mechwild/murphpad/keymaps/vial/rules.mk new file mode 100644 index 0000000000..7ff71a8ed3 --- /dev/null +++ b/keyboards/mechwild/murphpad/keymaps/vial/rules.mk @@ -0,0 +1,7 @@ +VIA_ENABLE = yes +VIAL_ENABLE = yes +VIAL_ENCODERS_ENABLE = yes +MOUSEKEY_ENABLE = no +QMK_SETTINGS = no + +EXTRAFLAGS += -flto \ No newline at end of file diff --git a/keyboards/mechwild/murphpad/keymaps/vial/vial.json b/keyboards/mechwild/murphpad/keymaps/vial/vial.json new file mode 100644 index 0000000000..6c752180d1 --- /dev/null +++ b/keyboards/mechwild/murphpad/keymaps/vial/vial.json @@ -0,0 +1,33 @@ +{ + "name": "MechWild MurphPad", + "vendorId": "0x6D77", + "productId": "0x1705", + "lighting": "qmk_rgblight", + "matrix": { "rows": 6, "cols": 5 }, + "layouts": { + "labels": [ + "Left Plus Sign", + "Split Right Plus Sign", + ["Bottom Left", "Left 2U 0 Key", "Left Enter", "All 1U Left"], + ["Bottom Right", "Right Enter", "Right 2U 0 Key", "All 1U Right"] + ], + "keymap": [ + [{"x":6.75},"1,1\n\n\n\n\n\n\n\n\ne"], + [{"y":-0.5,"x":2.5},"0,1","0,2","0,3","0,4"], + [{"y":-0.5,"x":6.75},"1,0\n\n\n\n\n\n\n\n\ne"], + [{"y":-0.25,"x":2.5},"1,1","1,2","1,3","1,4"], + ["0,1\n\n\n\n\n\n\n\n\ne",{"x":1.5},"2,1\n\n\n0,0","2,2","2,3",{"c":"#777777","h":2},"2,4\n\n\n1,0",{"x":0.25,"c":"#cccccc"},"2,4\n\n\n1,1",{"x":0.25,"c":"#777777","h":2},"2,1\n\n\n0,1"], + [{"y":-0.5,"x":1.25,"c":"#cccccc"},"3,0"], + [{"y":-0.5},"0,0\n\n\n\n\n\n\n\n\ne",{"x":1.5},"3,1\n\n\n0,0","3,2","3,3",{"x":1.25},"3,4\n\n\n1,1"], + [{"x":1.25},"4,0",{"x":0.25},"4,1\n\n\n2,0","4,2","4,3",{"c":"#777777","h":2},"4,4\n\n\n3,0"], + [{"x":1.25,"c":"#cccccc"},"5,0",{"x":0.25,"c":"#777777","w":2},"5,1\n\n\n2,0",{"c":"#cccccc"},"5,3\n\n\n3,0"], + [{"y":0.5,"x":3},"0,0","1,0","2,0"], + [{"y":0.25,"x":2.5,"c":"#777777","h":2},"4,1\n\n\n2,1",{"x":2,"c":"#cccccc"},"4,4\n\n\n3,1"], + [{"x":3.5},"5,2\n\n\n2,1",{"c":"#777777","w":2},"5,4\n\n\n3,1"], + [{"y":0.25,"x":2.5,"c":"#cccccc"},"4,1\n\n\n2,2",{"x":2},"4,4\n\n\n3,2"], + [{"x":2.5},"5,1\n\n\n2,2","5,2\n\n\n2,2","5,3\n\n\n3,2","5,4\n\n\n3,2"] + ] + } +} + +