From c01ec114af3ed30c53983dc3fe7eb342e78b5846 Mon Sep 17 00:00:00 2001 From: TW59420 <1393018289@qq.com> Date: Fri, 15 Oct 2021 23:18:11 +0800 Subject: [PATCH 01/22] =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=AC=A1=E6=8F=90?= =?UTF-8?q?=E4=BA=A4MW75=E9=94=AE=E7=9B=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- keyboards/mwstudio/README.md | 6 + keyboards/mwstudio/mw75/config.h | 81 +++++++++++ keyboards/mwstudio/mw75/info.json | 95 ++++++++++++ .../mwstudio/mw75/keymaps/default/keymap.c | 135 ++++++++++++++++++ keyboards/mwstudio/mw75/keymaps/via/keymap.c | 135 ++++++++++++++++++ keyboards/mwstudio/mw75/keymaps/via/rules.mk | 2 + keyboards/mwstudio/mw75/mw75.c | 44 ++++++ keyboards/mwstudio/mw75/mw75.h | 36 +++++ keyboards/mwstudio/mw75/readme.md | 22 +++ keyboards/mwstudio/mw75/rules.mk | 26 ++++ 10 files changed, 582 insertions(+) create mode 100644 keyboards/mwstudio/README.md create mode 100644 keyboards/mwstudio/mw75/config.h create mode 100644 keyboards/mwstudio/mw75/info.json create mode 100644 keyboards/mwstudio/mw75/keymaps/default/keymap.c create mode 100644 keyboards/mwstudio/mw75/keymaps/via/keymap.c create mode 100644 keyboards/mwstudio/mw75/keymaps/via/rules.mk create mode 100644 keyboards/mwstudio/mw75/mw75.c create mode 100644 keyboards/mwstudio/mw75/mw75.h create mode 100644 keyboards/mwstudio/mw75/readme.md create mode 100644 keyboards/mwstudio/mw75/rules.mk diff --git a/keyboards/mwstudio/README.md b/keyboards/mwstudio/README.md new file mode 100644 index 000000000000..eb479dc9c8fb --- /dev/null +++ b/keyboards/mwstudio/README.md @@ -0,0 +1,6 @@ +# MWStudio PCB + +This is a series of PCB +* MW75 The chip is ATmega32U4 + + diff --git a/keyboards/mwstudio/mw75/config.h b/keyboards/mwstudio/mw75/config.h new file mode 100644 index 000000000000..6ec1bae4e52a --- /dev/null +++ b/keyboards/mwstudio/mw75/config.h @@ -0,0 +1,81 @@ +/* Copyright 2021 DZTECH + * + * 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 "config_common.h" + + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x7BA1 +#define PRODUCT_ID 0x7501 +#define DEVICE_VER 0x0001 +#define MANUFACTURER MWStudio +#define PRODUCT MW75 + +/* key matrix size */ +#define MATRIX_ROWS 7 +#define MATRIX_COLS 15 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { B7, D0, D1, D2, D3, D5, B0} +#define MATRIX_COL_PINS { D4, D6, D7, B4, B5, B6, C6, C7, F7, F6, F5, F4, F1, F0, E6 } + +#define BOOTMAGIC_LITE_ROW 0 +#define BOOTMAGIC_LITE_COLUMN 1 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* prevent stuck modifiers */ +#define PREVENT_STUCK_MODIFIERS + +#define RGB_DI_PIN B3 +#define RGBLIGHT_SLEEP + +#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 +#define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS +#define DRIVER_LED_TOTAL 97 +#define RGBLED_NUM 97 +#define RGB_MATRIX_KEYPRESSES + +// #define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN +// #define DISABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +// #define DISABLE_RGB_MATRIX_TYPING_HEATMAP +// #define DISABLE_RGB_MATRIX_DIGITAL_RAIN +// #define DISABLE_RGB_MATRIX_BAND_SAT +// #define DISABLE_RGB_MATRIX_BAND_VAL +// #define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +// #define DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +// #define DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT +// #define DISABLE_RGB_MATRIX_BAND_SPIRAL_VAL + +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 + +#define ENCODERS_PAD_A { B1 } +#define ENCODERS_PAD_B { B2 } diff --git a/keyboards/mwstudio/mw75/info.json b/keyboards/mwstudio/mw75/info.json new file mode 100644 index 000000000000..8ea173bb08d6 --- /dev/null +++ b/keyboards/mwstudio/mw75/info.json @@ -0,0 +1,95 @@ +{ + "keyboard_name": "MW75", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":1.5, "y":0}, + {"label":"F2", "x":2.5, "y":0}, + {"label":"F3", "x":3.5, "y":0}, + {"label":"F4", "x":4.5, "y":0}, + {"label":"F5", "x":6, "y":0}, + {"label":"F6", "x":7, "y":0}, + {"label":"F7", "x":8, "y":0}, + {"label":"F8", "x":9, "y":0}, + {"label":"F9", "x":10.5, "y":0}, + {"label":"F10", "x":11.5, "y":0}, + {"label":"F11", "x":12.5, "y":0}, + {"label":"F12", "x":13.5, "y":0}, + {"label":"DEL", "x":15, "y":0}, + + {"label":"`", "x":0, "y":1.5}, + {"label":"1", "x":1, "y":1.5}, + {"label":"2", "x":2, "y":1.5}, + {"label":"3", "x":3, "y":1.5}, + {"label":"4", "x":4, "y":1.5}, + {"label":"5", "x":5, "y":1.5}, + {"label":"6", "x":6, "y":1.5}, + {"label":"7", "x":7, "y":1.5}, + {"label":"8", "x":8, "y":1.5}, + {"label":"9", "x":9, "y":1.5}, + {"label":"0", "x":10, "y":1.5}, + {"label":"-", "x":11, "y":1.5}, + {"label":"=", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Home", "x":15, "y":1.5}, + + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"[", "x":11.5, "y":2.5}, + {"label":"]", "x":12.5, "y":2.5}, + {"label":"\\", "x":13.5, "y":2.5, "w":1.5}, + {"label":"Delete", "x":15, "y":2.5}, + + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":";", "x":10.75, "y":3.5}, + {"label":"'", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + + {"label":"Shift", "x":0, "y":4.5, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":",", "x":9.25, "y":4.5}, + {"label":".", "x":10.25, "y":4.5}, + {"label":"/", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, + {"label":"\u2191", "x":14, "y":4.5}, + + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, + {"x":3.75, "y":5.5, "w":6.25}, + {"label":"Alt", "x":10, "y":5.5, "w":1.5}, + {"label":"Fn", "x":11.25, "y":5.5, "w":1.5}, + {"label":"\u2190", "x":13, "y":5.5}, + {"label":"\u2193", "x":14, "y":5.5}, + {"label":"\u2192", "x":15, "y":5.5} + ] + } + } +} diff --git a/keyboards/mwstudio/mw75/keymaps/default/keymap.c b/keyboards/mwstudio/mw75/keymaps/default/keymap.c new file mode 100644 index 000000000000..d4e6087f3a96 --- /dev/null +++ b/keyboards/mwstudio/mw75/keymaps/default/keymap.c @@ -0,0 +1,135 @@ +/* Copyright 2021 Your Name (@yourgithub) + * + * 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 "mw75.h" + +typedef union { + uint32_t raw; + struct { + bool top_rgb_change :1; + bool bottom_rgb_change :1; + }; +} user_config_t; + +user_config_t user_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_default( + KC_ESC, 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, RGB_TOG, + 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_DEL, + 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_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_VOLU, KC_VOLD, _______, KC_SPACE, _______, _______, _______, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [1] = LAYOUT_default( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F23, KC_F24, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUI, + RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAI, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, RGB_SAD, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, _______, RGB_SPD, RGB_VAD, RGB_SPI, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [2] = LAYOUT_default( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [3] = LAYOUT_default( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +}; + +void keyboard_post_init_user(void) { + // Read the user config from EEPROM + user_config.raw = eeconfig_read_user(); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_F23: + if (record->event.pressed) { + // Do something when pressed + user_config.top_rgb_change ^= 1; // Toggles the status + eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM + } else { + // Do something else when release + } + return false; // Skip all further processing of this key + case KC_F24: + if (record->event.pressed) { + // Do something when pressed + user_config.bottom_rgb_change ^= 1; // Toggles the status + eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM + } else { + // Do something else when release + } + return false; // Skip all further processing of this key + default: + return true; // Process all other keycodes normally + } +} + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { + if (clockwise) { + tap_code(dynamic_keymap_get_keycode(biton32(layer_state), 5, 3)); + } else { + tap_code(dynamic_keymap_get_keycode(biton32(layer_state), 5, 4)); + } + } + return true; +} + +void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { + + if (user_config.top_rgb_change) + { + for (size_t i = 0; i < 81; i++) + { + RGB_MATRIX_INDICATOR_SET_COLOR(i, 0, 0, 0); + } + } + + if (host_keyboard_led_state().caps_lock) { + RGB_MATRIX_INDICATOR_SET_COLOR(36, 0, 255, 255); + } + + if (user_config.bottom_rgb_change) + { + for (size_t i = 81; i < 97; i++) + { + RGB_MATRIX_INDICATOR_SET_COLOR(i, 0, 0, 0); + } + } +} diff --git a/keyboards/mwstudio/mw75/keymaps/via/keymap.c b/keyboards/mwstudio/mw75/keymaps/via/keymap.c new file mode 100644 index 000000000000..16ba0b3be1e8 --- /dev/null +++ b/keyboards/mwstudio/mw75/keymaps/via/keymap.c @@ -0,0 +1,135 @@ +/* Copyright 2021 Your Name (@yourgithub) + * + * 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 "mw75.h" + +typedef union { + uint32_t raw; + struct { + bool top_rgb_change :1; + bool bottom_rgb_change :1; + }; +} user_config_t; + +user_config_t user_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT( + KC_ESC, 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, RGB_TOG, + 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_DEL, + 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_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_VOLU, KC_VOLD, _______, KC_SPACE, _______, _______, _______, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [1] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F23, KC_F24, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUI, + RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAI, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, RGB_SAD, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, _______, RGB_SPD, RGB_VAD, RGB_SPI, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [2] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [3] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +}; + +void keyboard_post_init_user(void) { + // Read the user config from EEPROM + user_config.raw = eeconfig_read_user(); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_F23: + if (record->event.pressed) { + // Do something when pressed + user_config.top_rgb_change ^= 1; // Toggles the status + eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM + } else { + // Do something else when release + } + return false; // Skip all further processing of this key + case KC_F24: + if (record->event.pressed) { + // Do something when pressed + user_config.bottom_rgb_change ^= 1; // Toggles the status + eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM + } else { + // Do something else when release + } + return false; // Skip all further processing of this key + default: + return true; // Process all other keycodes normally + } +} + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { + if (clockwise) { + tap_code(dynamic_keymap_get_keycode(biton32(layer_state), 5, 3)); + } else { + tap_code(dynamic_keymap_get_keycode(biton32(layer_state), 5, 4)); + } + } + return true; +} + +void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { + + if (user_config.top_rgb_change) + { + for (size_t i = 0; i < 81; i++) + { + RGB_MATRIX_INDICATOR_SET_COLOR(i, 0, 0, 0); + } + } + + if (host_keyboard_led_state().caps_lock) { + RGB_MATRIX_INDICATOR_SET_COLOR(36, 0, 255, 255); + } + + if (user_config.bottom_rgb_change) + { + for (size_t i = 81; i < 97; i++) + { + RGB_MATRIX_INDICATOR_SET_COLOR(i, 0, 0, 0); + } + } +} diff --git a/keyboards/mwstudio/mw75/keymaps/via/rules.mk b/keyboards/mwstudio/mw75/keymaps/via/rules.mk new file mode 100644 index 000000000000..36b7ba9cbc98 --- /dev/null +++ b/keyboards/mwstudio/mw75/keymaps/via/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +LTO_ENABLE = yes diff --git a/keyboards/mwstudio/mw75/mw75.c b/keyboards/mwstudio/mw75/mw75.c new file mode 100644 index 000000000000..d7ee3412e9a9 --- /dev/null +++ b/keyboards/mwstudio/mw75/mw75.c @@ -0,0 +1,44 @@ +/* Copyright 2021 DZTECH + * + * 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 "mw75.h" + +led_config_t g_led_config = { { + { 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67 }, + { 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52 }, + { 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37 }, + { 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, NO_LED, 24, 23 }, + { 22, NO_LED, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9 }, + { 8, 7, 6, NO_LED, NO_LED, NO_LED, 5, NO_LED, NO_LED, NO_LED, 4, 3, 2, 1, 0 }, + { 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96 } +}, { + { 217, 60 }, { 203, 60 }, { 189, 60 }, { 166, 60 }, { 150, 60 }, { 95, 60 }, { 40, 60 }, { 24, 60 }, { 8, 60 }, + { 217, 50 }, { 203, 50 }, { 184, 50 }, { 165, 50 }, { 151, 50 }, { 137, 50 }, { 123, 50 }, { 109, 50 }, { 95, 50 }, { 81, 50 }, { 67, 50 }, { 53, 50 }, { 39, 50 }, { 17, 50 }, + { 217, 40 }, { 195, 40 }, { 172, 40 }, { 158, 40 }, { 144, 40 }, { 130, 40 }, { 116, 40 }, { 102, 40 }, { 88, 40 }, { 74, 40 }, { 60, 40 }, { 46, 40 }, { 32, 40 }, { 13, 40 }, + { 217, 30 }, { 199, 30 }, { 181, 30 }, { 165, 30 }, { 151, 30 }, { 137, 30 }, { 123, 30 }, { 109, 30 }, { 95, 30 }, { 81, 30 }, { 67, 30 }, { 53, 30 }, { 39, 30 }, { 25, 30 }, { 9, 30 }, + { 217, 20 }, { 196, 20 }, { 175, 20 }, { 161, 20 }, { 147, 20 }, { 133, 20 }, { 119, 20 }, { 105, 20 }, { 91, 20 }, { 77, 20 }, { 63, 20 }, { 49, 20 }, { 35, 20 }, { 21, 20 }, { 7, 20 }, + { 217, 5 }, { 196, 5 }, { 182, 5 }, { 168, 5 }, { 154, 5 }, { 133, 5 }, { 119, 5 }, { 105, 5 }, { 91, 5 }, { 70, 5 }, { 56, 5 }, { 42, 5 }, { 28, 5 }, { 7, 5 }, + + { 14, 14 }, { 42, 14 }, { 98, 14 }, { 154, 14 }, { 182, 14 }, { 210, 14 }, { 210, 25 }, { 210, 40 }, + { 210, 55 },{ 182, 55 },{ 126, 55 },{ 98, 55 }, { 42, 55 }, { 14, 55 }, { 14, 40 }, { 14, 25 } +}, { + 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 +} }; diff --git a/keyboards/mwstudio/mw75/mw75.h b/keyboards/mwstudio/mw75/mw75.h new file mode 100644 index 000000000000..a24f57b82a06 --- /dev/null +++ b/keyboards/mwstudio/mw75/mw75.h @@ -0,0 +1,36 @@ +/* Copyright 2021 DZTECH + * + * 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" + +#define LAYOUT( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014,\ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114,\ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214,\ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314,\ + K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414,\ + K500, K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512, K513, K514,\ + K600, K601, K602, K603, K604, K605, K606, K607, K608, K609, K610, K611, K612, K613, K614 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 },\ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 },\ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 },\ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 },\ + { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414 },\ + { K500, K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512, K513, K514 },\ + { K600, K601, K602, K603, K604, K605, K606, K607, K608, K609, K610, K611, K612, K613, K614 } \ +} diff --git a/keyboards/mwstudio/mw75/readme.md b/keyboards/mwstudio/mw75/readme.md new file mode 100644 index 000000000000..72e8e3e9ac70 --- /dev/null +++ b/keyboards/mwstudio/mw75/readme.md @@ -0,0 +1,22 @@ +# MW75 + +![MW75](https://i.imgur.com/TdVxYNE.jpg) + +Support Atmega32u4 keyboard. + +* Keyboard Maintainer: [TW59420](https://github.com/TW59420) +* Hardware Supported: Atmega32u4 + +Make example for this keyboard (after setting up your build environment): + + make mwstudio/mw75:default + +Flashing example for this keyboard: + + make mwstudio/mw75:default:flash + +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 +* **Physical reset button**: Short press the button on the back of the PCB to enter the Bootloader and flash the firmware +* **Keycode in layout**: Press the key mapped to RESET if it is available diff --git a/keyboards/mwstudio/mw75/rules.mk b/keyboards/mwstudio/mw75/rules.mk new file mode 100644 index 000000000000..475e6708f9d5 --- /dev/null +++ b/keyboards/mwstudio/mw75/rules.mk @@ -0,0 +1,26 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = atmel-dfu + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend + +RGB_MATRIX_ENABLE = yes +RGB_MATRIX_DRIVER = WS2812 +VIA_ENABLE = yes +ENCODER_ENABLE = yes +NKRO_ENABLE = yes + +# USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = no +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration From 08346e1b8d1c9c8a0cab65fa18fb431c869ac1cf Mon Sep 17 00:00:00 2001 From: TW59420 <1393018289@qq.com> Date: Sat, 16 Oct 2021 10:54:46 +0800 Subject: [PATCH 02/22] Make corresponding modifications according to PR checklist --- keyboards/mwstudio/mw75/config.h | 7 +-- .../mwstudio/mw75/keymaps/default/keymap.c | 56 +++++++++---------- keyboards/mwstudio/mw75/keymaps/via/keymap.c | 44 +++++++-------- keyboards/mwstudio/mw75/mw75.c | 3 +- keyboards/mwstudio/mw75/mw75.h | 22 ++++---- keyboards/mwstudio/mw75/rules.mk | 1 - 6 files changed, 61 insertions(+), 72 deletions(-) diff --git a/keyboards/mwstudio/mw75/config.h b/keyboards/mwstudio/mw75/config.h index 6ec1bae4e52a..8ca47aee7d8e 100644 --- a/keyboards/mwstudio/mw75/config.h +++ b/keyboards/mwstudio/mw75/config.h @@ -1,4 +1,4 @@ -/* Copyright 2021 DZTECH +/* Copyright 2021 TW59420 * * 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 @@ -41,10 +41,7 @@ #define DIODE_DIRECTION COL2ROW /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 - -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE +#define DEBOUNCE 5 /* prevent stuck modifiers */ #define PREVENT_STUCK_MODIFIERS diff --git a/keyboards/mwstudio/mw75/keymaps/default/keymap.c b/keyboards/mwstudio/mw75/keymaps/default/keymap.c index d4e6087f3a96..bdb8a385b482 100644 --- a/keyboards/mwstudio/mw75/keymaps/default/keymap.c +++ b/keyboards/mwstudio/mw75/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -/* Copyright 2021 Your Name (@yourgithub) +/* Copyright 2021 TW59420 * * 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 @@ -14,8 +14,8 @@ * along with this program. If not, see . */ + #include QMK_KEYBOARD_H -#include "mw75.h" typedef union { uint32_t raw; @@ -29,44 +29,40 @@ user_config_t user_config; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_default( - KC_ESC, 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, RGB_TOG, - 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_DEL, - 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_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_VOLU, KC_VOLD, _______, KC_SPACE, _______, _______, _______, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + [0] = LAYOUT( + 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, RGB_TOG, + 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_DEL, + 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_VOLU, KC_VOLD, KC_SPACE, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT ), - [1] = LAYOUT_default( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F23, KC_F24, _______, + [1] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F23, KC_F24, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUI, RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAI, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, RGB_SAD, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, _______, RGB_SPD, RGB_VAD, RGB_SPI, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAI, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, RGB_SAD, + _______, _______, _______, _______, _______, _______, RGB_MOD, _______, RGB_SPD, RGB_VAD, RGB_SPI ), - [2] = LAYOUT_default( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + [2] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), - [3] = LAYOUT_default( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + [3] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), }; @@ -103,9 +99,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool encoder_update_user(uint8_t index, bool clockwise) { if (index == 0) { if (clockwise) { - tap_code(dynamic_keymap_get_keycode(biton32(layer_state), 5, 3)); + tap_code(KC_VOLU); } else { - tap_code(dynamic_keymap_get_keycode(biton32(layer_state), 5, 4)); + tap_code(KC_VOLD); } } return true; diff --git a/keyboards/mwstudio/mw75/keymaps/via/keymap.c b/keyboards/mwstudio/mw75/keymaps/via/keymap.c index 16ba0b3be1e8..315166c19af8 100644 --- a/keyboards/mwstudio/mw75/keymaps/via/keymap.c +++ b/keyboards/mwstudio/mw75/keymaps/via/keymap.c @@ -1,4 +1,4 @@ -/* Copyright 2021 Your Name (@yourgithub) +/* Copyright 2021 TW59420 * * 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 @@ -14,8 +14,8 @@ * along with this program. If not, see . */ + #include QMK_KEYBOARD_H -#include "mw75.h" typedef union { uint32_t raw; @@ -30,43 +30,39 @@ user_config_t user_config; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( - KC_ESC, 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, RGB_TOG, - 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_DEL, - 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_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_VOLU, KC_VOLD, _______, KC_SPACE, _______, _______, _______, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + 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, RGB_TOG, + 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_DEL, + 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_VOLU, KC_VOLD, KC_SPACE, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT ), [1] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F23, KC_F24, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F23, KC_F24, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUI, RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAI, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, RGB_SAD, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, _______, RGB_SPD, RGB_VAD, RGB_SPI, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAI, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, RGB_SAD, + _______, _______, _______, _______, _______, _______, RGB_MOD, _______, RGB_SPD, RGB_VAD, RGB_SPI ), [2] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), [3] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), }; diff --git a/keyboards/mwstudio/mw75/mw75.c b/keyboards/mwstudio/mw75/mw75.c index d7ee3412e9a9..e062a3ed019c 100644 --- a/keyboards/mwstudio/mw75/mw75.c +++ b/keyboards/mwstudio/mw75/mw75.c @@ -1,4 +1,4 @@ -/* Copyright 2021 DZTECH +/* Copyright 2021 TW59420 * * 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 @@ -13,6 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #include "mw75.h" led_config_t g_led_config = { { diff --git a/keyboards/mwstudio/mw75/mw75.h b/keyboards/mwstudio/mw75/mw75.h index a24f57b82a06..a322ed4a1b63 100644 --- a/keyboards/mwstudio/mw75/mw75.h +++ b/keyboards/mwstudio/mw75/mw75.h @@ -1,4 +1,4 @@ -/* Copyright 2021 DZTECH +/* Copyright 2021 TW59420 * * 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 @@ -13,24 +13,24 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #pragma once #include "quantum.h" #define LAYOUT( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014,\ + K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014,\ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114,\ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214,\ - K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314,\ - K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414,\ - K500, K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512, K513, K514,\ - K600, K601, K602, K603, K604, K605, K606, K607, K608, K609, K610, K611, K612, K613, K614 \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314,\ + K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414,\ + K500, K501, K502, K503, K504, K506, K510, K511, K512, K513, K514\ ) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 },\ + { KC_NO, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 },\ { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 },\ { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 },\ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 },\ - { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414 },\ - { K500, K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512, K513, K514 },\ - { K600, K601, K602, K603, K604, K605, K606, K607, K608, K609, K610, K611, K612, K613, K614 } \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 },\ + { K400, KC_NO, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414 },\ + { K500, K501, K502, K503, K504, KC_NO, K506, KC_NO, KC_NO, KC_NO, K510, K511, K512, K513, K514 },\ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ } diff --git a/keyboards/mwstudio/mw75/rules.mk b/keyboards/mwstudio/mw75/rules.mk index 475e6708f9d5..75b321223b6c 100644 --- a/keyboards/mwstudio/mw75/rules.mk +++ b/keyboards/mwstudio/mw75/rules.mk @@ -14,7 +14,6 @@ SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend RGB_MATRIX_ENABLE = yes RGB_MATRIX_DRIVER = WS2812 -VIA_ENABLE = yes ENCODER_ENABLE = yes NKRO_ENABLE = yes From 9cb9ae7e0e0c0b0665235781020a7495ebca42b6 Mon Sep 17 00:00:00 2001 From: TW59420 <40019210+TW59420@users.noreply.github.com> Date: Sat, 16 Oct 2021 11:40:42 +0800 Subject: [PATCH 03/22] Update config.h --- keyboards/mwstudio/mw75/config.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/keyboards/mwstudio/mw75/config.h b/keyboards/mwstudio/mw75/config.h index 8ca47aee7d8e..58fcdf2c7c00 100644 --- a/keyboards/mwstudio/mw75/config.h +++ b/keyboards/mwstudio/mw75/config.h @@ -43,9 +43,6 @@ /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - #define RGB_DI_PIN B3 #define RGBLIGHT_SLEEP From 054e4dc19ec066e8ef96dfbaca48cfe1e8f6c67e Mon Sep 17 00:00:00 2001 From: TW59420 <40019210+TW59420@users.noreply.github.com> Date: Sat, 16 Oct 2021 13:09:37 +0800 Subject: [PATCH 04/22] Update README.md --- keyboards/mwstudio/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/mwstudio/README.md b/keyboards/mwstudio/README.md index eb479dc9c8fb..6123eb8abaab 100644 --- a/keyboards/mwstudio/README.md +++ b/keyboards/mwstudio/README.md @@ -1,4 +1,4 @@ -# MWStudio PCB +# mwstudio pcb This is a series of PCB * MW75 The chip is ATmega32U4 From 6c0cba649c2f2ea98a63fc76cd5cc8c041a5c617 Mon Sep 17 00:00:00 2001 From: TW59420 <40019210+TW59420@users.noreply.github.com> Date: Sat, 16 Oct 2021 13:10:18 +0800 Subject: [PATCH 05/22] Update rules.mk --- keyboards/mwstudio/mw75/rules.mk | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/keyboards/mwstudio/mw75/rules.mk b/keyboards/mwstudio/mw75/rules.mk index 75b321223b6c..ded3ce624d18 100644 --- a/keyboards/mwstudio/mw75/rules.mk +++ b/keyboards/mwstudio/mw75/rules.mk @@ -4,22 +4,20 @@ MCU = atmega32u4 # Bootloader selection BOOTLOADER = atmel-dfu -# Build Options -# comment out to disable the options. +# change yes to no to disable # -BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend - +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output RGB_MATRIX_ENABLE = yes RGB_MATRIX_DRIVER = WS2812 ENCODER_ENABLE = yes -NKRO_ENABLE = yes - -# USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -AUDIO_ENABLE = no -RGBLIGHT_ENABLE = no -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration From ebc1f49b8a43ae3e173315568f28509437154e5f Mon Sep 17 00:00:00 2001 From: TW59420 <40019210+TW59420@users.noreply.github.com> Date: Sat, 16 Oct 2021 13:11:15 +0800 Subject: [PATCH 06/22] fix the rotation on this image. --- keyboards/mwstudio/mw75/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/mwstudio/mw75/readme.md b/keyboards/mwstudio/mw75/readme.md index 72e8e3e9ac70..ecabf568aa55 100644 --- a/keyboards/mwstudio/mw75/readme.md +++ b/keyboards/mwstudio/mw75/readme.md @@ -1,6 +1,6 @@ # MW75 -![MW75](https://i.imgur.com/TdVxYNE.jpg) +![MW75](https://i.imgur.com/TdVxYNE.jpg?2) Support Atmega32u4 keyboard. From 04871b3b6af09b4cc6ae10030ff4f472893d4d68 Mon Sep 17 00:00:00 2001 From: TW59420 <40019210+TW59420@users.noreply.github.com> Date: Sat, 16 Oct 2021 13:14:09 +0800 Subject: [PATCH 07/22] Update and rename README.md to readme.md --- keyboards/mwstudio/{README.md => readme.md} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename keyboards/mwstudio/{README.md => readme.md} (79%) diff --git a/keyboards/mwstudio/README.md b/keyboards/mwstudio/readme.md similarity index 79% rename from keyboards/mwstudio/README.md rename to keyboards/mwstudio/readme.md index 6123eb8abaab..4fcaa057defe 100644 --- a/keyboards/mwstudio/README.md +++ b/keyboards/mwstudio/readme.md @@ -1,4 +1,4 @@ -# mwstudio pcb +# MWStudio pcb This is a series of PCB * MW75 The chip is ATmega32U4 From 8267acdb7c0a5f5ea93a801f1f2ef70b49796093 Mon Sep 17 00:00:00 2001 From: TW59420 <40019210+TW59420@users.noreply.github.com> Date: Sat, 16 Oct 2021 13:17:13 +0800 Subject: [PATCH 08/22] Update info.json --- keyboards/mwstudio/mw75/info.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/keyboards/mwstudio/mw75/info.json b/keyboards/mwstudio/mw75/info.json index 8ea173bb08d6..72c94fcf9869 100644 --- a/keyboards/mwstudio/mw75/info.json +++ b/keyboards/mwstudio/mw75/info.json @@ -34,7 +34,7 @@ {"label":"-", "x":11, "y":1.5}, {"label":"=", "x":12, "y":1.5}, {"label":"Backspace", "x":13, "y":1.5, "w":2}, - {"label":"Home", "x":15, "y":1.5}, + {"label":"Delete", "x":15, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, @@ -50,7 +50,7 @@ {"label":"[", "x":11.5, "y":2.5}, {"label":"]", "x":12.5, "y":2.5}, {"label":"\\", "x":13.5, "y":2.5, "w":1.5}, - {"label":"Delete", "x":15, "y":2.5}, + {"label":"PgUp", "x":15, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, @@ -65,6 +65,7 @@ {"label":";", "x":10.75, "y":3.5}, {"label":"'", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + {"label":"PgDn", "x":15, "y":3.5}, {"label":"Shift", "x":0, "y":4.5, "w":2.25}, {"label":"Z", "x":2.25, "y":4.5}, @@ -79,6 +80,7 @@ {"label":"/", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, {"label":"\u2191", "x":14, "y":4.5}, + {"label":"End", "x":15, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, From 1eb02f2d880a3801cfd4e95cfad5836ce7aa5a18 Mon Sep 17 00:00:00 2001 From: TW59420 <40019210+TW59420@users.noreply.github.com> Date: Sat, 16 Oct 2021 13:18:42 +0800 Subject: [PATCH 09/22] Update rules.mk --- keyboards/mwstudio/mw75/rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/mwstudio/mw75/rules.mk b/keyboards/mwstudio/mw75/rules.mk index ded3ce624d18..c3400d7733c0 100644 --- a/keyboards/mwstudio/mw75/rules.mk +++ b/keyboards/mwstudio/mw75/rules.mk @@ -12,7 +12,7 @@ EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work NKRO_ENABLE = yes # USB Nkey Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality From 210eaadf629a0d0996e4958d5fe73e3f8765fd8e Mon Sep 17 00:00:00 2001 From: TW59420 <40019210+TW59420@users.noreply.github.com> Date: Sat, 16 Oct 2021 13:21:14 +0800 Subject: [PATCH 10/22] Update info.json --- keyboards/mwstudio/mw75/info.json | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/keyboards/mwstudio/mw75/info.json b/keyboards/mwstudio/mw75/info.json index 72c94fcf9869..0c53689865bc 100644 --- a/keyboards/mwstudio/mw75/info.json +++ b/keyboards/mwstudio/mw75/info.json @@ -85,9 +85,11 @@ {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, - {"x":3.75, "y":5.5, "w":6.25}, - {"label":"Alt", "x":10, "y":5.5, "w":1.5}, - {"label":"Fn", "x":11.25, "y":5.5, "w":1.5}, + {"label":"Vol-", "x":3.75, "y":5.5 }, + {"label":"Vol+", "x":4.75, "y":5.5 }, + {"x":5.75, "y":5.5, "w":4.25}, + {"label":"Alt", "x":10, "y":5.5, "w":1.25}, + {"label":"Fn", "x":11.25, "y":5.5, "w":1.25}, {"label":"\u2190", "x":13, "y":5.5}, {"label":"\u2193", "x":14, "y":5.5}, {"label":"\u2192", "x":15, "y":5.5} From 44b321f88a84ecce07ea5ee60179ec87078212c4 Mon Sep 17 00:00:00 2001 From: TW59420 <40019210+TW59420@users.noreply.github.com> Date: Sat, 16 Oct 2021 14:39:37 +0800 Subject: [PATCH 11/22] Update keymap.c --- .../mwstudio/mw75/keymaps/default/keymap.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/keyboards/mwstudio/mw75/keymaps/default/keymap.c b/keyboards/mwstudio/mw75/keymaps/default/keymap.c index bdb8a385b482..956ab2d9b925 100644 --- a/keyboards/mwstudio/mw75/keymaps/default/keymap.c +++ b/keyboards/mwstudio/mw75/keymaps/default/keymap.c @@ -96,16 +96,19 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } } -bool encoder_update_user(uint8_t index, bool clockwise) { - if (index == 0) { - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); +#ifdef ENCODER_ENABLE +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 0) { + if (clockwise) { + tap_code_delay(KC_VOLU, 10); + } else { + tap_code_delay(KC_VOLD, 10); + } } - } - return true; + return true; } +#endif void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { From 600c1ef2c7eeace27e003ad1627f01dd2a29f736 Mon Sep 17 00:00:00 2001 From: TW59420 <40019210+TW59420@users.noreply.github.com> Date: Sat, 16 Oct 2021 14:40:02 +0800 Subject: [PATCH 12/22] Update keymap.c --- keyboards/mwstudio/mw75/keymaps/via/keymap.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/keyboards/mwstudio/mw75/keymaps/via/keymap.c b/keyboards/mwstudio/mw75/keymaps/via/keymap.c index 315166c19af8..956ab2d9b925 100644 --- a/keyboards/mwstudio/mw75/keymaps/via/keymap.c +++ b/keyboards/mwstudio/mw75/keymaps/via/keymap.c @@ -96,16 +96,19 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } } -bool encoder_update_user(uint8_t index, bool clockwise) { - if (index == 0) { - if (clockwise) { - tap_code(dynamic_keymap_get_keycode(biton32(layer_state), 5, 3)); - } else { - tap_code(dynamic_keymap_get_keycode(biton32(layer_state), 5, 4)); +#ifdef ENCODER_ENABLE +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 0) { + if (clockwise) { + tap_code_delay(KC_VOLU, 10); + } else { + tap_code_delay(KC_VOLD, 10); + } } - } - return true; + return true; } +#endif void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { From cf0360653a3b31a7b01231d94e37c03b825f1150 Mon Sep 17 00:00:00 2001 From: TW59420 <40019210+TW59420@users.noreply.github.com> Date: Sat, 16 Oct 2021 14:40:57 +0800 Subject: [PATCH 13/22] Update mw75.c --- keyboards/mwstudio/mw75/mw75.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/keyboards/mwstudio/mw75/mw75.c b/keyboards/mwstudio/mw75/mw75.c index e062a3ed019c..7e6641d5dbdc 100644 --- a/keyboards/mwstudio/mw75/mw75.c +++ b/keyboards/mwstudio/mw75/mw75.c @@ -16,6 +16,7 @@ #include "mw75.h" +#ifdef RGB_MATRIX_ENABLE led_config_t g_led_config = { { { 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67 }, { 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52 }, @@ -43,3 +44,4 @@ led_config_t g_led_config = { { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; +#endif From 84dbebfc15a762c49302f719e58bb659cb5eb9ee Mon Sep 17 00:00:00 2001 From: TW59420 <1393018289@qq.com> Date: Sat, 16 Oct 2021 19:56:06 +0800 Subject: [PATCH 14/22] add mw65_r2 and mw65_rgb support --- keyboards/mwstudio/mw65_r2/config.h | 63 +++++++++ keyboards/mwstudio/mw65_r2/info.json | 84 ++++++++++++ .../mwstudio/mw65_r2/keymaps/default/keymap.c | 65 +++++++++ .../mwstudio/mw65_r2/keymaps/via/keymap.c | 65 +++++++++ .../mwstudio/mw65_r2/keymaps/via/rules.mk | 2 + keyboards/mwstudio/mw65_r2/mw65_r2.c | 28 ++++ keyboards/mwstudio/mw65_r2/mw65_r2.h | 30 ++++ keyboards/mwstudio/mw65_r2/readme.md | 22 +++ keyboards/mwstudio/mw65_r2/rules.mk | 23 ++++ keyboards/mwstudio/mw65_rgb/config.h | 61 +++++++++ keyboards/mwstudio/mw65_rgb/info.json | 84 ++++++++++++ .../mw65_rgb/keymaps/default/keymap.c | 128 ++++++++++++++++++ .../mwstudio/mw65_rgb/keymaps/via/keymap.c | 128 ++++++++++++++++++ .../mwstudio/mw65_rgb/keymaps/via/rules.mk | 2 + keyboards/mwstudio/mw65_rgb/mw65_rgb.c | 45 ++++++ keyboards/mwstudio/mw65_rgb/mw65_rgb.h | 33 +++++ keyboards/mwstudio/mw65_rgb/readme.md | 22 +++ keyboards/mwstudio/mw65_rgb/rules.mk | 23 ++++ keyboards/mwstudio/readme.md | 2 + 19 files changed, 910 insertions(+) create mode 100644 keyboards/mwstudio/mw65_r2/config.h create mode 100644 keyboards/mwstudio/mw65_r2/info.json create mode 100644 keyboards/mwstudio/mw65_r2/keymaps/default/keymap.c create mode 100644 keyboards/mwstudio/mw65_r2/keymaps/via/keymap.c create mode 100644 keyboards/mwstudio/mw65_r2/keymaps/via/rules.mk create mode 100644 keyboards/mwstudio/mw65_r2/mw65_r2.c create mode 100644 keyboards/mwstudio/mw65_r2/mw65_r2.h create mode 100644 keyboards/mwstudio/mw65_r2/readme.md create mode 100644 keyboards/mwstudio/mw65_r2/rules.mk create mode 100644 keyboards/mwstudio/mw65_rgb/config.h create mode 100644 keyboards/mwstudio/mw65_rgb/info.json create mode 100644 keyboards/mwstudio/mw65_rgb/keymaps/default/keymap.c create mode 100644 keyboards/mwstudio/mw65_rgb/keymaps/via/keymap.c create mode 100644 keyboards/mwstudio/mw65_rgb/keymaps/via/rules.mk create mode 100644 keyboards/mwstudio/mw65_rgb/mw65_rgb.c create mode 100644 keyboards/mwstudio/mw65_rgb/mw65_rgb.h create mode 100644 keyboards/mwstudio/mw65_rgb/readme.md create mode 100644 keyboards/mwstudio/mw65_rgb/rules.mk diff --git a/keyboards/mwstudio/mw65_r2/config.h b/keyboards/mwstudio/mw65_r2/config.h new file mode 100644 index 000000000000..4eccc68c8bec --- /dev/null +++ b/keyboards/mwstudio/mw65_r2/config.h @@ -0,0 +1,63 @@ +/* Copyright 2021 TW59420 + * + * 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 "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x7BA1 +#define PRODUCT_ID 0x6501 +#define DEVICE_VER 0x0001 +#define MANUFACTURER MWStudio +#define PRODUCT MW65 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D0, D1, D2, D3, B7 } +#define MATRIX_COL_PINS { D6, D4, C7, C6, B6, B5, B4, D7, F7, F1, F4, F5, F6, E6, F0 } + +#define BOOTMAGIC_LITE_ROW 0 +#define BOOTMAGIC_LITE_COLUMN 0 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Set 0 if debouncing isn't neede */ +#define DEBOUNCE 5 + +#define RGB_DI_PIN B3 +#ifdef RGB_DI_PIN + #define RGBLIGHT_SLEEP + + #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 255 + #define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS + + #define DRIVER_LED_TOTAL 16 + + #define RGBLED_NUM 16 + //#define RGB_MATRIX_KEYPRESSES + + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 +#endif + +#define ENCODERS_PAD_A { B1 } +#define ENCODERS_PAD_B { B2 } diff --git a/keyboards/mwstudio/mw65_r2/info.json b/keyboards/mwstudio/mw65_r2/info.json new file mode 100644 index 000000000000..bd7a335dfc77 --- /dev/null +++ b/keyboards/mwstudio/mw65_r2/info.json @@ -0,0 +1,84 @@ +{ + "keyboard_name": "MW65_R2", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"ESC", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":2}, + {"label":"Delete", "x":15, "y":0}, + + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"[", "x":11.5, "y":1}, + {"label":"]", "x":12.5, "y":1}, + {"label":"\\", "x":13.5, "y":1, "w":1.5}, + {"label":"PgUp", "x":15, "y":1}, + + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":";", "x":10.75, "y":2}, + {"label":"'", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + {"label":"PgDn", "x":15, "y":2}, + + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":",", "x":9.25, "y":3}, + {"label":".", "x":10.25, "y":3}, + {"label":"/", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":1.75}, + {"label":"\u2191", "x":14, "y":3}, + {"label":"End", "x":15, "y":3}, + + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"Win", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"label":"Vol-", "x":3.75, "y":4 }, + {"label":"Vol+", "x":4.75, "y":4 }, + {"x":5.75, "y":4, "w":4.25}, + {"label":"Alt", "x":10, "y":4, "w":1.25}, + {"label":"Fn", "x":11.25, "y":4, "w":1.25}, + {"label":"\u2190", "x":13, "y":4}, + {"label":"\u2193", "x":14, "y":4}, + {"label":"\u2192", "x":15, "y":4} + ] + } + } +} diff --git a/keyboards/mwstudio/mw65_r2/keymaps/default/keymap.c b/keyboards/mwstudio/mw65_r2/keymaps/default/keymap.c new file mode 100644 index 000000000000..b5001d4a10a7 --- /dev/null +++ b/keyboards/mwstudio/mw65_r2/keymaps/default/keymap.c @@ -0,0 +1,65 @@ +/* Copyright 2021 TW59420 + * + * 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( + KC_ESC, 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_DEL, + 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, RGB_TOG, + KC_LCTL, KC_LGUI, KC_LALT, KC_VOLU, KC_VOLD, KC_SPACE, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT + ), + + [1] = LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, RGB_HUI, + RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F23, RGB_SAI, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F24, RGB_VAI, RGB_SAD, + _______, _______, _______, _______, _______, _______, RGB_MOD, _______, RGB_SPD, RGB_VAD, RGB_SPI + ), + + [2] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [3] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +}; + +#ifdef ENCODER_ENABLE +bool encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } + return true; +} +#endif diff --git a/keyboards/mwstudio/mw65_r2/keymaps/via/keymap.c b/keyboards/mwstudio/mw65_r2/keymaps/via/keymap.c new file mode 100644 index 000000000000..072fa158076d --- /dev/null +++ b/keyboards/mwstudio/mw65_r2/keymaps/via/keymap.c @@ -0,0 +1,65 @@ +/* Copyright 2021 TW59420 + * + * 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( + KC_ESC, 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_DEL, + 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, RGB_TOG, + KC_LCTL, KC_LGUI, KC_LALT, KC_VOLU, KC_VOLD, KC_SPACE, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT + ), + + [1] = LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, RGB_HUI, + RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F23, RGB_SAI, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F24, RGB_VAI, RGB_SAD, + _______, _______, _______, _______, _______, _______, RGB_MOD, _______, RGB_SPD, RGB_VAD, RGB_SPI + ), + + [2] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [3] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +}; + +#ifdef ENCODER_ENABLE +bool encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { + if (clockwise) { + tap_code(dynamic_keymap_get_keycode(biton32(layer_state), 4, 3)); + } else { + tap_code(dynamic_keymap_get_keycode(biton32(layer_state), 4, 4)); + } + } + return true; +} +#endif diff --git a/keyboards/mwstudio/mw65_r2/keymaps/via/rules.mk b/keyboards/mwstudio/mw65_r2/keymaps/via/rules.mk new file mode 100644 index 000000000000..36b7ba9cbc98 --- /dev/null +++ b/keyboards/mwstudio/mw65_r2/keymaps/via/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +LTO_ENABLE = yes diff --git a/keyboards/mwstudio/mw65_r2/mw65_r2.c b/keyboards/mwstudio/mw65_r2/mw65_r2.c new file mode 100644 index 000000000000..ed057224349b --- /dev/null +++ b/keyboards/mwstudio/mw65_r2/mw65_r2.c @@ -0,0 +1,28 @@ +/* Copyright 2021 TW59420 + * + * 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 "mw65_r2.h" + +#ifdef RGB_MATRIX_ENABLE +led_config_t g_led_config = { { + { 0, 1, 2, 3, 4, 5, 6, 7 }, + { 8, 9, 10, 11, 12, 13, 14, 15 } +}, { + { 175, 45 }, { 130, 45 }, { 85, 45 }, { 50, 45 }, { 15, 45 }, { 15, 35 }, { 15, 25 }, { 15, 10 }, { 50, 10 }, { 85, 10 }, { 130, 10 }, { 175, 10 }, { 210, 10 }, { 210, 25 }, { 210, 35 }, { 210, 45 }, +}, { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 +} }; +#endif diff --git a/keyboards/mwstudio/mw65_r2/mw65_r2.h b/keyboards/mwstudio/mw65_r2/mw65_r2.h new file mode 100644 index 000000000000..ec676d4bc440 --- /dev/null +++ b/keyboards/mwstudio/mw65_r2/mw65_r2.h @@ -0,0 +1,30 @@ +/* Copyright 2021 TW59420 + * + * 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 "quantum.h" + +#define LAYOUT( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, \ + K400, K401, K402, K403, K404, K406, K410, K411, K412, K413, K414 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \ + { K400, K401, K402, K403, K404, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, K412, K413, K414 } \ +} diff --git a/keyboards/mwstudio/mw65_r2/readme.md b/keyboards/mwstudio/mw65_r2/readme.md new file mode 100644 index 000000000000..42cdd87e7138 --- /dev/null +++ b/keyboards/mwstudio/mw65_r2/readme.md @@ -0,0 +1,22 @@ +# MW65_R2 + +![MW65_R2](https://i.imgur.com/QzECiuJ.jpg?2) + +Support Atmega32u4 keyboard. + +* Keyboard Maintainer: [TW59420](https://github.com/TW59420) +* Hardware Supported: Atmega32u4 + +Make example for this keyboard (after setting up your build environment): + + make mwstudio/mw65_r2:default + +Flashing example for this keyboard: + + make mwstudio/mw65_r2:default:flash + +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 +* **Physical reset button**: Short press the button on the back of the PCB to enter the Bootloader and flash the firmware +* **Keycode in layout**: Press the key mapped to RESET if it is available diff --git a/keyboards/mwstudio/mw65_r2/rules.mk b/keyboards/mwstudio/mw65_r2/rules.mk new file mode 100644 index 000000000000..c3400d7733c0 --- /dev/null +++ b/keyboards/mwstudio/mw65_r2/rules.mk @@ -0,0 +1,23 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = atmel-dfu + +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output +RGB_MATRIX_ENABLE = yes +RGB_MATRIX_DRIVER = WS2812 +ENCODER_ENABLE = yes diff --git a/keyboards/mwstudio/mw65_rgb/config.h b/keyboards/mwstudio/mw65_rgb/config.h new file mode 100644 index 000000000000..8a320664a9a7 --- /dev/null +++ b/keyboards/mwstudio/mw65_rgb/config.h @@ -0,0 +1,61 @@ +/* Copyright 2021 TW59420 + * + * 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 "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x7BA1 +#define PRODUCT_ID 0x6502 +#define DEVICE_VER 0x0001 +#define MANUFACTURER MWStudio +#define PRODUCT MW65 + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 15 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D0, D1, D2, D3, B7, B0 } +#define MATRIX_COL_PINS { C6, B6, B5, B4, D7, D6, D4, C7, F7, F6, F5, F4, F1, F0, E6 } + +#define BOOTMAGIC_LITE_ROW 0 +#define BOOTMAGIC_LITE_COLUMN 0 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +#define RGB_DI_PIN B3 +#ifdef RGB_DI_PIN + #define RGBLIGHT_SLEEP + + #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 + #define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS + #define DRIVER_LED_TOTAL 83 + #define RGBLED_NUM 83 + #define RGB_MATRIX_KEYPRESSES + + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 +#endif + +#define ENCODERS_PAD_A { B1 } +#define ENCODERS_PAD_B { B2 } diff --git a/keyboards/mwstudio/mw65_rgb/info.json b/keyboards/mwstudio/mw65_rgb/info.json new file mode 100644 index 000000000000..affcdadbc0f6 --- /dev/null +++ b/keyboards/mwstudio/mw65_rgb/info.json @@ -0,0 +1,84 @@ +{ + "keyboard_name": "MW65_RGB", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"ESC", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":2}, + {"label":"Delete", "x":15, "y":0}, + + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"[", "x":11.5, "y":1}, + {"label":"]", "x":12.5, "y":1}, + {"label":"\\", "x":13.5, "y":1, "w":1.5}, + {"label":"PgUp", "x":15, "y":1}, + + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":";", "x":10.75, "y":2}, + {"label":"'", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + {"label":"PgDn", "x":15, "y":2}, + + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":",", "x":9.25, "y":3}, + {"label":".", "x":10.25, "y":3}, + {"label":"/", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":1.75}, + {"label":"\u2191", "x":14, "y":3}, + {"label":"End", "x":15, "y":3}, + + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"Win", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"label":"Vol-", "x":3.75, "y":4 }, + {"label":"Vol+", "x":4.75, "y":4 }, + {"x":5.75, "y":4, "w":4.25}, + {"label":"Alt", "x":10, "y":4, "w":1.25}, + {"label":"Fn", "x":11.25, "y":4, "w":1.25}, + {"label":"\u2190", "x":13, "y":4}, + {"label":"\u2193", "x":14, "y":4}, + {"label":"\u2192", "x":15, "y":4} + ] + } + } +} diff --git a/keyboards/mwstudio/mw65_rgb/keymaps/default/keymap.c b/keyboards/mwstudio/mw65_rgb/keymaps/default/keymap.c new file mode 100644 index 000000000000..f8fb438a4538 --- /dev/null +++ b/keyboards/mwstudio/mw65_rgb/keymaps/default/keymap.c @@ -0,0 +1,128 @@ +/* Copyright 2021 TW59420 + * + * 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 + +typedef union { + uint32_t raw; + struct { + bool top_rgb_change :1; + bool bottom_rgb_change :1; + }; +} user_config_t; + +user_config_t user_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT( + KC_ESC, 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_DEL, + 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, RGB_TOG, + KC_LCTL, KC_LGUI, KC_LALT, KC_VOLU, KC_VOLD, KC_SPACE, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT + ), + + [1] = LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, RGB_HUI, + RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F23, RGB_SAI, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F24, RGB_VAI, RGB_SAD, + _______, _______, _______, _______, _______, _______, RGB_MOD, _______, RGB_SPD, RGB_VAD, RGB_SPI + ), + + [2] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [3] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +}; + +void keyboard_post_init_user(void) { + // Read the user config from EEPROM + user_config.raw = eeconfig_read_user(); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_F23: + if (record->event.pressed) { + // Do something when pressed + user_config.top_rgb_change ^= 1; // Toggles the status + eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM + } else { + // Do something else when release + } + return false; // Skip all further processing of this key + case KC_F24: + if (record->event.pressed) { + // Do something when pressed + user_config.bottom_rgb_change ^= 1; // Toggles the status + eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM + } else { + // Do something else when release + } + return false; // Skip all further processing of this key + default: + return true; // Process all other keycodes normally + } +} + +#ifdef ENCODER_ENABLE +bool encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } + return true; +} +#endif + +void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { + + if (user_config.top_rgb_change) + { + for (size_t i = 16; i < 83; i++) + { + RGB_MATRIX_INDICATOR_SET_COLOR(i, 0, 0, 0); + } + } + + if (host_keyboard_led_state().caps_lock) { + RGB_MATRIX_INDICATOR_SET_COLOR(52, 0, 255, 255); // assuming caps lock is at led #5 + } + + if (user_config.bottom_rgb_change) + { + for (size_t i = 0; i < 16; i++) + { + RGB_MATRIX_INDICATOR_SET_COLOR(i, 0, 0, 0); + } + } +} diff --git a/keyboards/mwstudio/mw65_rgb/keymaps/via/keymap.c b/keyboards/mwstudio/mw65_rgb/keymaps/via/keymap.c new file mode 100644 index 000000000000..ceb4ce3724e7 --- /dev/null +++ b/keyboards/mwstudio/mw65_rgb/keymaps/via/keymap.c @@ -0,0 +1,128 @@ +/* Copyright 2021 TW59420 + * + * 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 + +typedef union { + uint32_t raw; + struct { + bool top_rgb_change :1; + bool bottom_rgb_change :1; + }; +} user_config_t; + +user_config_t user_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT( + KC_ESC, 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_DEL, + 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, RGB_TOG, + KC_LCTL, KC_LGUI, KC_LALT, KC_VOLU, KC_VOLD, KC_SPACE, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT + ), + + [1] = LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, RGB_HUI, + RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F23, RGB_SAI, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F24, RGB_VAI, RGB_SAD, + _______, _______, _______, _______, _______, _______, RGB_MOD, _______, RGB_SPD, RGB_VAD, RGB_SPI + ), + + [2] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [3] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +}; + +void keyboard_post_init_user(void) { + // Read the user config from EEPROM + user_config.raw = eeconfig_read_user(); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_F23: + if (record->event.pressed) { + // Do something when pressed + user_config.top_rgb_change ^= 1; // Toggles the status + eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM + } else { + // Do something else when release + } + return false; // Skip all further processing of this key + case KC_F24: + if (record->event.pressed) { + // Do something when pressed + user_config.bottom_rgb_change ^= 1; // Toggles the status + eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM + } else { + // Do something else when release + } + return false; // Skip all further processing of this key + default: + return true; // Process all other keycodes normally + } +} + +#ifdef ENCODER_ENABLE +bool encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { + if (clockwise) { + tap_code(dynamic_keymap_get_keycode(biton32(layer_state), 4, 3)); + } else { + tap_code(dynamic_keymap_get_keycode(biton32(layer_state), 4, 4)); + } + } + return true; +} +#endif + +void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { + + if (user_config.top_rgb_change) + { + for (size_t i = 16; i < 83; i++) + { + RGB_MATRIX_INDICATOR_SET_COLOR(i, 0, 0, 0); + } + } + + if (host_keyboard_led_state().caps_lock) { + RGB_MATRIX_INDICATOR_SET_COLOR(52, 0, 255, 255); // assuming caps lock is at led #5 + } + + if (user_config.bottom_rgb_change) + { + for (size_t i = 0; i < 16; i++) + { + RGB_MATRIX_INDICATOR_SET_COLOR(i, 0, 0, 0); + } + } +} diff --git a/keyboards/mwstudio/mw65_rgb/keymaps/via/rules.mk b/keyboards/mwstudio/mw65_rgb/keymaps/via/rules.mk new file mode 100644 index 000000000000..36b7ba9cbc98 --- /dev/null +++ b/keyboards/mwstudio/mw65_rgb/keymaps/via/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +LTO_ENABLE = yes diff --git a/keyboards/mwstudio/mw65_rgb/mw65_rgb.c b/keyboards/mwstudio/mw65_rgb/mw65_rgb.c new file mode 100644 index 000000000000..e49944f1ce2e --- /dev/null +++ b/keyboards/mwstudio/mw65_rgb/mw65_rgb.c @@ -0,0 +1,45 @@ +/* Copyright 2021 TW59420 + * + * 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 "mw65_rgb.h" + +#ifdef RGB_MATRIX_ENABLE +led_config_t g_led_config = { { + { 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68 }, + { 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67 }, + { 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, NO_LED, 40, 39 }, + { 25, NO_LED, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 }, + { 24, 23, 22, NO_LED, NO_LED, NO_LED, 21, NO_LED, NO_LED, 15, 20, 19, 18, 17, 16 }, + + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 } +}, { + { 175, 45 },{ 130, 45 },{ 85, 45 }, { 50, 45 }, { 15, 45 }, { 15, 35 }, { 15, 25 }, { 15, 10 }, + { 50, 10 }, { 85, 10 }, { 130, 10 }, { 175, 10 }, { 210, 10 }, { 210, 25 }, { 210, 35 }, { 210, 45 }, + { 217, 54 }, { 203, 54 }, { 189, 54 }, { 166, 54 }, { 150, 54 }, { 95, 54 }, { 40, 54 }, { 24, 54 }, { 8, 54 }, + { 17, 42 }, { 39, 42 }, { 53, 42 }, { 67, 42 }, { 81, 42 }, { 95, 42 }, { 109, 42 }, { 123, 42 }, { 137, 42 }, { 151, 42 }, { 165, 42 }, { 184, 42 }, { 203, 42 }, { 217, 42 }, + { 217, 30 }, { 195, 30 }, { 172, 30 }, { 158, 30 }, { 144, 30 }, { 130, 30 }, { 116, 30 }, { 102, 30 }, { 88, 30 }, { 74, 30 }, { 60, 30 }, { 46, 30 }, { 32, 30 },{ 13, 30 }, + { 9, 18 }, { 25, 18 }, { 39, 18 }, { 53, 18 }, { 67, 18 }, { 81, 18 }, { 95, 18 }, { 109, 18 }, { 123, 18 }, { 137, 18 }, { 151, 18 }, { 165, 18 }, { 181, 18 }, { 199, 18 }, { 217, 18 }, + { 217, 6 }, { 196, 6 }, { 175, 6 }, { 161, 6 }, { 147, 6 }, { 133, 6 }, { 119, 6 }, { 105, 6 }, { 91, 6 }, { 77, 6 }, { 63, 6 }, { 49, 6 }, { 35, 6 }, { 21, 6 }, { 7, 6 }, +}, { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 +} }; +#endif + diff --git a/keyboards/mwstudio/mw65_rgb/mw65_rgb.h b/keyboards/mwstudio/mw65_rgb/mw65_rgb.h new file mode 100644 index 000000000000..b491e324e28a --- /dev/null +++ b/keyboards/mwstudio/mw65_rgb/mw65_rgb.h @@ -0,0 +1,33 @@ +/* Copyright 2021 TW59420 + * + * 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" + +#define LAYOUT( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K213, K214, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, \ + K400, K401, K402, K403, K404, K406, K410, K411, K412, K413, K414 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, KC_NO, K213, K214 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \ + { K400, K401, K402, K403, K404, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, K412, K413, K414 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ +} diff --git a/keyboards/mwstudio/mw65_rgb/readme.md b/keyboards/mwstudio/mw65_rgb/readme.md new file mode 100644 index 000000000000..e15b5f9de9b2 --- /dev/null +++ b/keyboards/mwstudio/mw65_rgb/readme.md @@ -0,0 +1,22 @@ +# MW65_RGB + +![MW65_RGB](https://i.imgur.com/MPb8Lba.jpg?2) + +Support Atmega32u4 keyboard. + +* Keyboard Maintainer: [TW59420](https://github.com/TW59420) +* Hardware Supported: Atmega32u4 + +Make example for this keyboard (after setting up your build environment): + + make mwstudio/mw65_rgb:default + +Flashing example for this keyboard: + + make mwstudio/mw65_rgb:default:flash + +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 +* **Physical reset button**: Short press the button on the back of the PCB to enter the Bootloader and flash the firmware +* **Keycode in layout**: Press the key mapped to RESET if it is available diff --git a/keyboards/mwstudio/mw65_rgb/rules.mk b/keyboards/mwstudio/mw65_rgb/rules.mk new file mode 100644 index 000000000000..c3400d7733c0 --- /dev/null +++ b/keyboards/mwstudio/mw65_rgb/rules.mk @@ -0,0 +1,23 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = atmel-dfu + +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output +RGB_MATRIX_ENABLE = yes +RGB_MATRIX_DRIVER = WS2812 +ENCODER_ENABLE = yes diff --git a/keyboards/mwstudio/readme.md b/keyboards/mwstudio/readme.md index 4fcaa057defe..38f1b15d1d69 100644 --- a/keyboards/mwstudio/readme.md +++ b/keyboards/mwstudio/readme.md @@ -2,5 +2,7 @@ This is a series of PCB * MW75 The chip is ATmega32U4 +* MW65_R2 The chip is ATmega32U4 +* MW65_RGB The chip is ATmega32U4 From 9c8a0fb98b6d33ebe0acf0e12e9ae6f5dadbcc42 Mon Sep 17 00:00:00 2001 From: TW59420 <40019210+TW59420@users.noreply.github.com> Date: Sat, 16 Oct 2021 21:18:52 +0800 Subject: [PATCH 15/22] Update rules.mk --- keyboards/mwstudio/mw65_r2/rules.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/keyboards/mwstudio/mw65_r2/rules.mk b/keyboards/mwstudio/mw65_r2/rules.mk index c3400d7733c0..58d8da3e898b 100644 --- a/keyboards/mwstudio/mw65_r2/rules.mk +++ b/keyboards/mwstudio/mw65_r2/rules.mk @@ -4,6 +4,7 @@ MCU = atmega32u4 # Bootloader selection BOOTLOADER = atmel-dfu +# Build Options # change yes to no to disable # BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite From 401ad6c789578bc9b6fd85fc91dcc92f6d767149 Mon Sep 17 00:00:00 2001 From: TW59420 <40019210+TW59420@users.noreply.github.com> Date: Sat, 16 Oct 2021 21:19:07 +0800 Subject: [PATCH 16/22] Update rules.mk --- keyboards/mwstudio/mw65_rgb/rules.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/keyboards/mwstudio/mw65_rgb/rules.mk b/keyboards/mwstudio/mw65_rgb/rules.mk index c3400d7733c0..58d8da3e898b 100644 --- a/keyboards/mwstudio/mw65_rgb/rules.mk +++ b/keyboards/mwstudio/mw65_rgb/rules.mk @@ -4,6 +4,7 @@ MCU = atmega32u4 # Bootloader selection BOOTLOADER = atmel-dfu +# Build Options # change yes to no to disable # BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite From 0b83637ecac5b436dc17c166435ca5e77825559b Mon Sep 17 00:00:00 2001 From: TW59420 <40019210+TW59420@users.noreply.github.com> Date: Sat, 16 Oct 2021 21:19:29 +0800 Subject: [PATCH 17/22] Update rules.mk --- keyboards/mwstudio/mw75/rules.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/keyboards/mwstudio/mw75/rules.mk b/keyboards/mwstudio/mw75/rules.mk index c3400d7733c0..58d8da3e898b 100644 --- a/keyboards/mwstudio/mw75/rules.mk +++ b/keyboards/mwstudio/mw75/rules.mk @@ -4,6 +4,7 @@ MCU = atmega32u4 # Bootloader selection BOOTLOADER = atmel-dfu +# Build Options # change yes to no to disable # BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite From 3cb185ce3dc5431f4503331ee042e882d282ba66 Mon Sep 17 00:00:00 2001 From: TW59420 <40019210+TW59420@users.noreply.github.com> Date: Sun, 17 Oct 2021 07:49:18 +0800 Subject: [PATCH 18/22] Delete keyboards/mwstudio/mw65_rgb directory --- keyboards/mwstudio/mw65_rgb/config.h | 61 --------- keyboards/mwstudio/mw65_rgb/info.json | 84 ------------ .../mw65_rgb/keymaps/default/keymap.c | 128 ------------------ .../mwstudio/mw65_rgb/keymaps/via/keymap.c | 128 ------------------ .../mwstudio/mw65_rgb/keymaps/via/rules.mk | 2 - keyboards/mwstudio/mw65_rgb/mw65_rgb.c | 45 ------ keyboards/mwstudio/mw65_rgb/mw65_rgb.h | 33 ----- keyboards/mwstudio/mw65_rgb/readme.md | 22 --- keyboards/mwstudio/mw65_rgb/rules.mk | 24 ---- 9 files changed, 527 deletions(-) delete mode 100644 keyboards/mwstudio/mw65_rgb/config.h delete mode 100644 keyboards/mwstudio/mw65_rgb/info.json delete mode 100644 keyboards/mwstudio/mw65_rgb/keymaps/default/keymap.c delete mode 100644 keyboards/mwstudio/mw65_rgb/keymaps/via/keymap.c delete mode 100644 keyboards/mwstudio/mw65_rgb/keymaps/via/rules.mk delete mode 100644 keyboards/mwstudio/mw65_rgb/mw65_rgb.c delete mode 100644 keyboards/mwstudio/mw65_rgb/mw65_rgb.h delete mode 100644 keyboards/mwstudio/mw65_rgb/readme.md delete mode 100644 keyboards/mwstudio/mw65_rgb/rules.mk diff --git a/keyboards/mwstudio/mw65_rgb/config.h b/keyboards/mwstudio/mw65_rgb/config.h deleted file mode 100644 index 8a320664a9a7..000000000000 --- a/keyboards/mwstudio/mw65_rgb/config.h +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright 2021 TW59420 - * - * 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 "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0x7BA1 -#define PRODUCT_ID 0x6502 -#define DEVICE_VER 0x0001 -#define MANUFACTURER MWStudio -#define PRODUCT MW65 - -/* key matrix size */ -#define MATRIX_ROWS 6 -#define MATRIX_COLS 15 - -/* key matrix pins */ -#define MATRIX_ROW_PINS { D0, D1, D2, D3, B7, B0 } -#define MATRIX_COL_PINS { C6, B6, B5, B4, D7, D6, D4, C7, F7, F6, F5, F4, F1, F0, E6 } - -#define BOOTMAGIC_LITE_ROW 0 -#define BOOTMAGIC_LITE_COLUMN 0 - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCE 5 - -#define RGB_DI_PIN B3 -#ifdef RGB_DI_PIN - #define RGBLIGHT_SLEEP - - #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 - #define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS - #define DRIVER_LED_TOTAL 83 - #define RGBLED_NUM 83 - #define RGB_MATRIX_KEYPRESSES - - #define RGBLIGHT_HUE_STEP 8 - #define RGBLIGHT_SAT_STEP 8 - #define RGBLIGHT_VAL_STEP 8 -#endif - -#define ENCODERS_PAD_A { B1 } -#define ENCODERS_PAD_B { B2 } diff --git a/keyboards/mwstudio/mw65_rgb/info.json b/keyboards/mwstudio/mw65_rgb/info.json deleted file mode 100644 index affcdadbc0f6..000000000000 --- a/keyboards/mwstudio/mw65_rgb/info.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "keyboard_name": "MW65_RGB", - "url": "", - "maintainer": "qmk", - "layouts": { - "LAYOUT": { - "layout": [ - {"label":"ESC", "x":0, "y":0}, - {"label":"1", "x":1, "y":0}, - {"label":"2", "x":2, "y":0}, - {"label":"3", "x":3, "y":0}, - {"label":"4", "x":4, "y":0}, - {"label":"5", "x":5, "y":0}, - {"label":"6", "x":6, "y":0}, - {"label":"7", "x":7, "y":0}, - {"label":"8", "x":8, "y":0}, - {"label":"9", "x":9, "y":0}, - {"label":"0", "x":10, "y":0}, - {"label":"-", "x":11, "y":0}, - {"label":"=", "x":12, "y":0}, - {"label":"Backspace", "x":13, "y":0, "w":2}, - {"label":"Delete", "x":15, "y":0}, - - {"label":"Tab", "x":0, "y":1, "w":1.5}, - {"label":"Q", "x":1.5, "y":1}, - {"label":"W", "x":2.5, "y":1}, - {"label":"E", "x":3.5, "y":1}, - {"label":"R", "x":4.5, "y":1}, - {"label":"T", "x":5.5, "y":1}, - {"label":"Y", "x":6.5, "y":1}, - {"label":"U", "x":7.5, "y":1}, - {"label":"I", "x":8.5, "y":1}, - {"label":"O", "x":9.5, "y":1}, - {"label":"P", "x":10.5, "y":1}, - {"label":"[", "x":11.5, "y":1}, - {"label":"]", "x":12.5, "y":1}, - {"label":"\\", "x":13.5, "y":1, "w":1.5}, - {"label":"PgUp", "x":15, "y":1}, - - {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, - {"label":"A", "x":1.75, "y":2}, - {"label":"S", "x":2.75, "y":2}, - {"label":"D", "x":3.75, "y":2}, - {"label":"F", "x":4.75, "y":2}, - {"label":"G", "x":5.75, "y":2}, - {"label":"H", "x":6.75, "y":2}, - {"label":"J", "x":7.75, "y":2}, - {"label":"K", "x":8.75, "y":2}, - {"label":"L", "x":9.75, "y":2}, - {"label":";", "x":10.75, "y":2}, - {"label":"'", "x":11.75, "y":2}, - {"label":"Enter", "x":12.75, "y":2, "w":2.25}, - {"label":"PgDn", "x":15, "y":2}, - - {"label":"Shift", "x":0, "y":3, "w":2.25}, - {"label":"Z", "x":2.25, "y":3}, - {"label":"X", "x":3.25, "y":3}, - {"label":"C", "x":4.25, "y":3}, - {"label":"V", "x":5.25, "y":3}, - {"label":"B", "x":6.25, "y":3}, - {"label":"N", "x":7.25, "y":3}, - {"label":"M", "x":8.25, "y":3}, - {"label":",", "x":9.25, "y":3}, - {"label":".", "x":10.25, "y":3}, - {"label":"/", "x":11.25, "y":3}, - {"label":"Shift", "x":12.25, "y":3, "w":1.75}, - {"label":"\u2191", "x":14, "y":3}, - {"label":"End", "x":15, "y":3}, - - {"label":"Ctrl", "x":0, "y":4, "w":1.25}, - {"label":"Win", "x":1.25, "y":4, "w":1.25}, - {"label":"Alt", "x":2.5, "y":4, "w":1.25}, - {"label":"Vol-", "x":3.75, "y":4 }, - {"label":"Vol+", "x":4.75, "y":4 }, - {"x":5.75, "y":4, "w":4.25}, - {"label":"Alt", "x":10, "y":4, "w":1.25}, - {"label":"Fn", "x":11.25, "y":4, "w":1.25}, - {"label":"\u2190", "x":13, "y":4}, - {"label":"\u2193", "x":14, "y":4}, - {"label":"\u2192", "x":15, "y":4} - ] - } - } -} diff --git a/keyboards/mwstudio/mw65_rgb/keymaps/default/keymap.c b/keyboards/mwstudio/mw65_rgb/keymaps/default/keymap.c deleted file mode 100644 index f8fb438a4538..000000000000 --- a/keyboards/mwstudio/mw65_rgb/keymaps/default/keymap.c +++ /dev/null @@ -1,128 +0,0 @@ -/* Copyright 2021 TW59420 - * - * 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 - -typedef union { - uint32_t raw; - struct { - bool top_rgb_change :1; - bool bottom_rgb_change :1; - }; -} user_config_t; - -user_config_t user_config; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [0] = LAYOUT( - KC_ESC, 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_DEL, - 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, RGB_TOG, - KC_LCTL, KC_LGUI, KC_LALT, KC_VOLU, KC_VOLD, KC_SPACE, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT - ), - - [1] = LAYOUT( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, RGB_HUI, - RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F23, RGB_SAI, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F24, RGB_VAI, RGB_SAD, - _______, _______, _______, _______, _______, _______, RGB_MOD, _______, RGB_SPD, RGB_VAD, RGB_SPI - ), - - [2] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - - [3] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), -}; - -void keyboard_post_init_user(void) { - // Read the user config from EEPROM - user_config.raw = eeconfig_read_user(); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KC_F23: - if (record->event.pressed) { - // Do something when pressed - user_config.top_rgb_change ^= 1; // Toggles the status - eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM - } else { - // Do something else when release - } - return false; // Skip all further processing of this key - case KC_F24: - if (record->event.pressed) { - // Do something when pressed - user_config.bottom_rgb_change ^= 1; // Toggles the status - eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM - } else { - // Do something else when release - } - return false; // Skip all further processing of this key - default: - return true; // Process all other keycodes normally - } -} - -#ifdef ENCODER_ENABLE -bool encoder_update_user(uint8_t index, bool clockwise) { - if (index == 0) { - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - return true; -} -#endif - -void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { - - if (user_config.top_rgb_change) - { - for (size_t i = 16; i < 83; i++) - { - RGB_MATRIX_INDICATOR_SET_COLOR(i, 0, 0, 0); - } - } - - if (host_keyboard_led_state().caps_lock) { - RGB_MATRIX_INDICATOR_SET_COLOR(52, 0, 255, 255); // assuming caps lock is at led #5 - } - - if (user_config.bottom_rgb_change) - { - for (size_t i = 0; i < 16; i++) - { - RGB_MATRIX_INDICATOR_SET_COLOR(i, 0, 0, 0); - } - } -} diff --git a/keyboards/mwstudio/mw65_rgb/keymaps/via/keymap.c b/keyboards/mwstudio/mw65_rgb/keymaps/via/keymap.c deleted file mode 100644 index ceb4ce3724e7..000000000000 --- a/keyboards/mwstudio/mw65_rgb/keymaps/via/keymap.c +++ /dev/null @@ -1,128 +0,0 @@ -/* Copyright 2021 TW59420 - * - * 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 - -typedef union { - uint32_t raw; - struct { - bool top_rgb_change :1; - bool bottom_rgb_change :1; - }; -} user_config_t; - -user_config_t user_config; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [0] = LAYOUT( - KC_ESC, 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_DEL, - 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, RGB_TOG, - KC_LCTL, KC_LGUI, KC_LALT, KC_VOLU, KC_VOLD, KC_SPACE, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT - ), - - [1] = LAYOUT( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, RGB_HUI, - RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F23, RGB_SAI, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F24, RGB_VAI, RGB_SAD, - _______, _______, _______, _______, _______, _______, RGB_MOD, _______, RGB_SPD, RGB_VAD, RGB_SPI - ), - - [2] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - - [3] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), -}; - -void keyboard_post_init_user(void) { - // Read the user config from EEPROM - user_config.raw = eeconfig_read_user(); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KC_F23: - if (record->event.pressed) { - // Do something when pressed - user_config.top_rgb_change ^= 1; // Toggles the status - eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM - } else { - // Do something else when release - } - return false; // Skip all further processing of this key - case KC_F24: - if (record->event.pressed) { - // Do something when pressed - user_config.bottom_rgb_change ^= 1; // Toggles the status - eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM - } else { - // Do something else when release - } - return false; // Skip all further processing of this key - default: - return true; // Process all other keycodes normally - } -} - -#ifdef ENCODER_ENABLE -bool encoder_update_user(uint8_t index, bool clockwise) { - if (index == 0) { - if (clockwise) { - tap_code(dynamic_keymap_get_keycode(biton32(layer_state), 4, 3)); - } else { - tap_code(dynamic_keymap_get_keycode(biton32(layer_state), 4, 4)); - } - } - return true; -} -#endif - -void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { - - if (user_config.top_rgb_change) - { - for (size_t i = 16; i < 83; i++) - { - RGB_MATRIX_INDICATOR_SET_COLOR(i, 0, 0, 0); - } - } - - if (host_keyboard_led_state().caps_lock) { - RGB_MATRIX_INDICATOR_SET_COLOR(52, 0, 255, 255); // assuming caps lock is at led #5 - } - - if (user_config.bottom_rgb_change) - { - for (size_t i = 0; i < 16; i++) - { - RGB_MATRIX_INDICATOR_SET_COLOR(i, 0, 0, 0); - } - } -} diff --git a/keyboards/mwstudio/mw65_rgb/keymaps/via/rules.mk b/keyboards/mwstudio/mw65_rgb/keymaps/via/rules.mk deleted file mode 100644 index 36b7ba9cbc98..000000000000 --- a/keyboards/mwstudio/mw65_rgb/keymaps/via/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -VIA_ENABLE = yes -LTO_ENABLE = yes diff --git a/keyboards/mwstudio/mw65_rgb/mw65_rgb.c b/keyboards/mwstudio/mw65_rgb/mw65_rgb.c deleted file mode 100644 index e49944f1ce2e..000000000000 --- a/keyboards/mwstudio/mw65_rgb/mw65_rgb.c +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright 2021 TW59420 - * - * 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 "mw65_rgb.h" - -#ifdef RGB_MATRIX_ENABLE -led_config_t g_led_config = { { - { 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68 }, - { 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67 }, - { 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, NO_LED, 40, 39 }, - { 25, NO_LED, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 }, - { 24, 23, 22, NO_LED, NO_LED, NO_LED, 21, NO_LED, NO_LED, 15, 20, 19, 18, 17, 16 }, - - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 } -}, { - { 175, 45 },{ 130, 45 },{ 85, 45 }, { 50, 45 }, { 15, 45 }, { 15, 35 }, { 15, 25 }, { 15, 10 }, - { 50, 10 }, { 85, 10 }, { 130, 10 }, { 175, 10 }, { 210, 10 }, { 210, 25 }, { 210, 35 }, { 210, 45 }, - { 217, 54 }, { 203, 54 }, { 189, 54 }, { 166, 54 }, { 150, 54 }, { 95, 54 }, { 40, 54 }, { 24, 54 }, { 8, 54 }, - { 17, 42 }, { 39, 42 }, { 53, 42 }, { 67, 42 }, { 81, 42 }, { 95, 42 }, { 109, 42 }, { 123, 42 }, { 137, 42 }, { 151, 42 }, { 165, 42 }, { 184, 42 }, { 203, 42 }, { 217, 42 }, - { 217, 30 }, { 195, 30 }, { 172, 30 }, { 158, 30 }, { 144, 30 }, { 130, 30 }, { 116, 30 }, { 102, 30 }, { 88, 30 }, { 74, 30 }, { 60, 30 }, { 46, 30 }, { 32, 30 },{ 13, 30 }, - { 9, 18 }, { 25, 18 }, { 39, 18 }, { 53, 18 }, { 67, 18 }, { 81, 18 }, { 95, 18 }, { 109, 18 }, { 123, 18 }, { 137, 18 }, { 151, 18 }, { 165, 18 }, { 181, 18 }, { 199, 18 }, { 217, 18 }, - { 217, 6 }, { 196, 6 }, { 175, 6 }, { 161, 6 }, { 147, 6 }, { 133, 6 }, { 119, 6 }, { 105, 6 }, { 91, 6 }, { 77, 6 }, { 63, 6 }, { 49, 6 }, { 35, 6 }, { 21, 6 }, { 7, 6 }, -}, { - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 -} }; -#endif - diff --git a/keyboards/mwstudio/mw65_rgb/mw65_rgb.h b/keyboards/mwstudio/mw65_rgb/mw65_rgb.h deleted file mode 100644 index b491e324e28a..000000000000 --- a/keyboards/mwstudio/mw65_rgb/mw65_rgb.h +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright 2021 TW59420 - * - * 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" - -#define LAYOUT( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ - K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ - K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K213, K214, \ - K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, \ - K400, K401, K402, K403, K404, K406, K410, K411, K412, K413, K414 \ -) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ - { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ - { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, KC_NO, K213, K214 }, \ - { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \ - { K400, K401, K402, K403, K404, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, K412, K413, K414 }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ -} diff --git a/keyboards/mwstudio/mw65_rgb/readme.md b/keyboards/mwstudio/mw65_rgb/readme.md deleted file mode 100644 index e15b5f9de9b2..000000000000 --- a/keyboards/mwstudio/mw65_rgb/readme.md +++ /dev/null @@ -1,22 +0,0 @@ -# MW65_RGB - -![MW65_RGB](https://i.imgur.com/MPb8Lba.jpg?2) - -Support Atmega32u4 keyboard. - -* Keyboard Maintainer: [TW59420](https://github.com/TW59420) -* Hardware Supported: Atmega32u4 - -Make example for this keyboard (after setting up your build environment): - - make mwstudio/mw65_rgb:default - -Flashing example for this keyboard: - - make mwstudio/mw65_rgb:default:flash - -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 -* **Physical reset button**: Short press the button on the back of the PCB to enter the Bootloader and flash the firmware -* **Keycode in layout**: Press the key mapped to RESET if it is available diff --git a/keyboards/mwstudio/mw65_rgb/rules.mk b/keyboards/mwstudio/mw65_rgb/rules.mk deleted file mode 100644 index 58d8da3e898b..000000000000 --- a/keyboards/mwstudio/mw65_rgb/rules.mk +++ /dev/null @@ -1,24 +0,0 @@ -# MCU name -MCU = atmega32u4 - -# Bootloader selection -BOOTLOADER = atmel-dfu - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite -MOUSEKEY_ENABLE = yes # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = no # Console for debug -COMMAND_ENABLE = no # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = yes # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow -AUDIO_ENABLE = no # Audio output -RGB_MATRIX_ENABLE = yes -RGB_MATRIX_DRIVER = WS2812 -ENCODER_ENABLE = yes From 4d326a80cef22061fb886220ad3020321ae0eff5 Mon Sep 17 00:00:00 2001 From: TW59420 <40019210+TW59420@users.noreply.github.com> Date: Sun, 17 Oct 2021 07:49:26 +0800 Subject: [PATCH 19/22] Delete keyboards/mwstudio/mw65_r2 directory --- keyboards/mwstudio/mw65_r2/config.h | 63 -------------- keyboards/mwstudio/mw65_r2/info.json | 84 ------------------- .../mwstudio/mw65_r2/keymaps/default/keymap.c | 65 -------------- .../mwstudio/mw65_r2/keymaps/via/keymap.c | 65 -------------- .../mwstudio/mw65_r2/keymaps/via/rules.mk | 2 - keyboards/mwstudio/mw65_r2/mw65_r2.c | 28 ------- keyboards/mwstudio/mw65_r2/mw65_r2.h | 30 ------- keyboards/mwstudio/mw65_r2/readme.md | 22 ----- keyboards/mwstudio/mw65_r2/rules.mk | 24 ------ 9 files changed, 383 deletions(-) delete mode 100644 keyboards/mwstudio/mw65_r2/config.h delete mode 100644 keyboards/mwstudio/mw65_r2/info.json delete mode 100644 keyboards/mwstudio/mw65_r2/keymaps/default/keymap.c delete mode 100644 keyboards/mwstudio/mw65_r2/keymaps/via/keymap.c delete mode 100644 keyboards/mwstudio/mw65_r2/keymaps/via/rules.mk delete mode 100644 keyboards/mwstudio/mw65_r2/mw65_r2.c delete mode 100644 keyboards/mwstudio/mw65_r2/mw65_r2.h delete mode 100644 keyboards/mwstudio/mw65_r2/readme.md delete mode 100644 keyboards/mwstudio/mw65_r2/rules.mk diff --git a/keyboards/mwstudio/mw65_r2/config.h b/keyboards/mwstudio/mw65_r2/config.h deleted file mode 100644 index 4eccc68c8bec..000000000000 --- a/keyboards/mwstudio/mw65_r2/config.h +++ /dev/null @@ -1,63 +0,0 @@ -/* Copyright 2021 TW59420 - * - * 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 "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0x7BA1 -#define PRODUCT_ID 0x6501 -#define DEVICE_VER 0x0001 -#define MANUFACTURER MWStudio -#define PRODUCT MW65 - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 15 - -/* key matrix pins */ -#define MATRIX_ROW_PINS { D0, D1, D2, D3, B7 } -#define MATRIX_COL_PINS { D6, D4, C7, C6, B6, B5, B4, D7, F7, F1, F4, F5, F6, E6, F0 } - -#define BOOTMAGIC_LITE_ROW 0 -#define BOOTMAGIC_LITE_COLUMN 0 - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* Set 0 if debouncing isn't neede */ -#define DEBOUNCE 5 - -#define RGB_DI_PIN B3 -#ifdef RGB_DI_PIN - #define RGBLIGHT_SLEEP - - #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 255 - #define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS - - #define DRIVER_LED_TOTAL 16 - - #define RGBLED_NUM 16 - //#define RGB_MATRIX_KEYPRESSES - - #define RGBLIGHT_HUE_STEP 8 - #define RGBLIGHT_SAT_STEP 8 - #define RGBLIGHT_VAL_STEP 8 -#endif - -#define ENCODERS_PAD_A { B1 } -#define ENCODERS_PAD_B { B2 } diff --git a/keyboards/mwstudio/mw65_r2/info.json b/keyboards/mwstudio/mw65_r2/info.json deleted file mode 100644 index bd7a335dfc77..000000000000 --- a/keyboards/mwstudio/mw65_r2/info.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "keyboard_name": "MW65_R2", - "url": "", - "maintainer": "qmk", - "layouts": { - "LAYOUT": { - "layout": [ - {"label":"ESC", "x":0, "y":0}, - {"label":"1", "x":1, "y":0}, - {"label":"2", "x":2, "y":0}, - {"label":"3", "x":3, "y":0}, - {"label":"4", "x":4, "y":0}, - {"label":"5", "x":5, "y":0}, - {"label":"6", "x":6, "y":0}, - {"label":"7", "x":7, "y":0}, - {"label":"8", "x":8, "y":0}, - {"label":"9", "x":9, "y":0}, - {"label":"0", "x":10, "y":0}, - {"label":"-", "x":11, "y":0}, - {"label":"=", "x":12, "y":0}, - {"label":"Backspace", "x":13, "y":0, "w":2}, - {"label":"Delete", "x":15, "y":0}, - - {"label":"Tab", "x":0, "y":1, "w":1.5}, - {"label":"Q", "x":1.5, "y":1}, - {"label":"W", "x":2.5, "y":1}, - {"label":"E", "x":3.5, "y":1}, - {"label":"R", "x":4.5, "y":1}, - {"label":"T", "x":5.5, "y":1}, - {"label":"Y", "x":6.5, "y":1}, - {"label":"U", "x":7.5, "y":1}, - {"label":"I", "x":8.5, "y":1}, - {"label":"O", "x":9.5, "y":1}, - {"label":"P", "x":10.5, "y":1}, - {"label":"[", "x":11.5, "y":1}, - {"label":"]", "x":12.5, "y":1}, - {"label":"\\", "x":13.5, "y":1, "w":1.5}, - {"label":"PgUp", "x":15, "y":1}, - - {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, - {"label":"A", "x":1.75, "y":2}, - {"label":"S", "x":2.75, "y":2}, - {"label":"D", "x":3.75, "y":2}, - {"label":"F", "x":4.75, "y":2}, - {"label":"G", "x":5.75, "y":2}, - {"label":"H", "x":6.75, "y":2}, - {"label":"J", "x":7.75, "y":2}, - {"label":"K", "x":8.75, "y":2}, - {"label":"L", "x":9.75, "y":2}, - {"label":";", "x":10.75, "y":2}, - {"label":"'", "x":11.75, "y":2}, - {"label":"Enter", "x":12.75, "y":2, "w":2.25}, - {"label":"PgDn", "x":15, "y":2}, - - {"label":"Shift", "x":0, "y":3, "w":2.25}, - {"label":"Z", "x":2.25, "y":3}, - {"label":"X", "x":3.25, "y":3}, - {"label":"C", "x":4.25, "y":3}, - {"label":"V", "x":5.25, "y":3}, - {"label":"B", "x":6.25, "y":3}, - {"label":"N", "x":7.25, "y":3}, - {"label":"M", "x":8.25, "y":3}, - {"label":",", "x":9.25, "y":3}, - {"label":".", "x":10.25, "y":3}, - {"label":"/", "x":11.25, "y":3}, - {"label":"Shift", "x":12.25, "y":3, "w":1.75}, - {"label":"\u2191", "x":14, "y":3}, - {"label":"End", "x":15, "y":3}, - - {"label":"Ctrl", "x":0, "y":4, "w":1.25}, - {"label":"Win", "x":1.25, "y":4, "w":1.25}, - {"label":"Alt", "x":2.5, "y":4, "w":1.25}, - {"label":"Vol-", "x":3.75, "y":4 }, - {"label":"Vol+", "x":4.75, "y":4 }, - {"x":5.75, "y":4, "w":4.25}, - {"label":"Alt", "x":10, "y":4, "w":1.25}, - {"label":"Fn", "x":11.25, "y":4, "w":1.25}, - {"label":"\u2190", "x":13, "y":4}, - {"label":"\u2193", "x":14, "y":4}, - {"label":"\u2192", "x":15, "y":4} - ] - } - } -} diff --git a/keyboards/mwstudio/mw65_r2/keymaps/default/keymap.c b/keyboards/mwstudio/mw65_r2/keymaps/default/keymap.c deleted file mode 100644 index b5001d4a10a7..000000000000 --- a/keyboards/mwstudio/mw65_r2/keymaps/default/keymap.c +++ /dev/null @@ -1,65 +0,0 @@ -/* Copyright 2021 TW59420 - * - * 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( - KC_ESC, 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_DEL, - 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, RGB_TOG, - KC_LCTL, KC_LGUI, KC_LALT, KC_VOLU, KC_VOLD, KC_SPACE, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT - ), - - [1] = LAYOUT( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, RGB_HUI, - RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F23, RGB_SAI, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F24, RGB_VAI, RGB_SAD, - _______, _______, _______, _______, _______, _______, RGB_MOD, _______, RGB_SPD, RGB_VAD, RGB_SPI - ), - - [2] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - - [3] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), -}; - -#ifdef ENCODER_ENABLE -bool encoder_update_user(uint8_t index, bool clockwise) { - if (index == 0) { - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - return true; -} -#endif diff --git a/keyboards/mwstudio/mw65_r2/keymaps/via/keymap.c b/keyboards/mwstudio/mw65_r2/keymaps/via/keymap.c deleted file mode 100644 index 072fa158076d..000000000000 --- a/keyboards/mwstudio/mw65_r2/keymaps/via/keymap.c +++ /dev/null @@ -1,65 +0,0 @@ -/* Copyright 2021 TW59420 - * - * 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( - KC_ESC, 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_DEL, - 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, RGB_TOG, - KC_LCTL, KC_LGUI, KC_LALT, KC_VOLU, KC_VOLD, KC_SPACE, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT - ), - - [1] = LAYOUT( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, RGB_HUI, - RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F23, RGB_SAI, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F24, RGB_VAI, RGB_SAD, - _______, _______, _______, _______, _______, _______, RGB_MOD, _______, RGB_SPD, RGB_VAD, RGB_SPI - ), - - [2] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - - [3] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), -}; - -#ifdef ENCODER_ENABLE -bool encoder_update_user(uint8_t index, bool clockwise) { - if (index == 0) { - if (clockwise) { - tap_code(dynamic_keymap_get_keycode(biton32(layer_state), 4, 3)); - } else { - tap_code(dynamic_keymap_get_keycode(biton32(layer_state), 4, 4)); - } - } - return true; -} -#endif diff --git a/keyboards/mwstudio/mw65_r2/keymaps/via/rules.mk b/keyboards/mwstudio/mw65_r2/keymaps/via/rules.mk deleted file mode 100644 index 36b7ba9cbc98..000000000000 --- a/keyboards/mwstudio/mw65_r2/keymaps/via/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -VIA_ENABLE = yes -LTO_ENABLE = yes diff --git a/keyboards/mwstudio/mw65_r2/mw65_r2.c b/keyboards/mwstudio/mw65_r2/mw65_r2.c deleted file mode 100644 index ed057224349b..000000000000 --- a/keyboards/mwstudio/mw65_r2/mw65_r2.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright 2021 TW59420 - * - * 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 "mw65_r2.h" - -#ifdef RGB_MATRIX_ENABLE -led_config_t g_led_config = { { - { 0, 1, 2, 3, 4, 5, 6, 7 }, - { 8, 9, 10, 11, 12, 13, 14, 15 } -}, { - { 175, 45 }, { 130, 45 }, { 85, 45 }, { 50, 45 }, { 15, 45 }, { 15, 35 }, { 15, 25 }, { 15, 10 }, { 50, 10 }, { 85, 10 }, { 130, 10 }, { 175, 10 }, { 210, 10 }, { 210, 25 }, { 210, 35 }, { 210, 45 }, -}, { - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 -} }; -#endif diff --git a/keyboards/mwstudio/mw65_r2/mw65_r2.h b/keyboards/mwstudio/mw65_r2/mw65_r2.h deleted file mode 100644 index ec676d4bc440..000000000000 --- a/keyboards/mwstudio/mw65_r2/mw65_r2.h +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright 2021 TW59420 - * - * 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 "quantum.h" - -#define LAYOUT( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ - K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ - K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ - K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, \ - K400, K401, K402, K403, K404, K406, K410, K411, K412, K413, K414 \ -) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ - { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ - { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \ - { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \ - { K400, K401, K402, K403, K404, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, K412, K413, K414 } \ -} diff --git a/keyboards/mwstudio/mw65_r2/readme.md b/keyboards/mwstudio/mw65_r2/readme.md deleted file mode 100644 index 42cdd87e7138..000000000000 --- a/keyboards/mwstudio/mw65_r2/readme.md +++ /dev/null @@ -1,22 +0,0 @@ -# MW65_R2 - -![MW65_R2](https://i.imgur.com/QzECiuJ.jpg?2) - -Support Atmega32u4 keyboard. - -* Keyboard Maintainer: [TW59420](https://github.com/TW59420) -* Hardware Supported: Atmega32u4 - -Make example for this keyboard (after setting up your build environment): - - make mwstudio/mw65_r2:default - -Flashing example for this keyboard: - - make mwstudio/mw65_r2:default:flash - -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 -* **Physical reset button**: Short press the button on the back of the PCB to enter the Bootloader and flash the firmware -* **Keycode in layout**: Press the key mapped to RESET if it is available diff --git a/keyboards/mwstudio/mw65_r2/rules.mk b/keyboards/mwstudio/mw65_r2/rules.mk deleted file mode 100644 index 58d8da3e898b..000000000000 --- a/keyboards/mwstudio/mw65_r2/rules.mk +++ /dev/null @@ -1,24 +0,0 @@ -# MCU name -MCU = atmega32u4 - -# Bootloader selection -BOOTLOADER = atmel-dfu - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite -MOUSEKEY_ENABLE = yes # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = no # Console for debug -COMMAND_ENABLE = no # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = yes # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow -AUDIO_ENABLE = no # Audio output -RGB_MATRIX_ENABLE = yes -RGB_MATRIX_DRIVER = WS2812 -ENCODER_ENABLE = yes From 1603bfdfa41dae80141f55932662a0f552db0215 Mon Sep 17 00:00:00 2001 From: TW59420 <40019210+TW59420@users.noreply.github.com> Date: Sun, 17 Oct 2021 07:55:41 +0800 Subject: [PATCH 20/22] Update readme.md --- keyboards/mwstudio/readme.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/keyboards/mwstudio/readme.md b/keyboards/mwstudio/readme.md index 38f1b15d1d69..d4433a8c9613 100644 --- a/keyboards/mwstudio/readme.md +++ b/keyboards/mwstudio/readme.md @@ -2,7 +2,4 @@ This is a series of PCB * MW75 The chip is ATmega32U4 -* MW65_R2 The chip is ATmega32U4 -* MW65_RGB The chip is ATmega32U4 - From 0ffe39d57165ba6f4b80903777246adaf4521ab7 Mon Sep 17 00:00:00 2001 From: TW59420 <40019210+TW59420@users.noreply.github.com> Date: Mon, 18 Oct 2021 14:52:11 +0800 Subject: [PATCH 21/22] Update keymap.c --- .../mwstudio/mw75/keymaps/default/keymap.c | 79 +------------------ 1 file changed, 1 insertion(+), 78 deletions(-) diff --git a/keyboards/mwstudio/mw75/keymaps/default/keymap.c b/keyboards/mwstudio/mw75/keymaps/default/keymap.c index 956ab2d9b925..44eb8d0c04ae 100644 --- a/keyboards/mwstudio/mw75/keymaps/default/keymap.c +++ b/keyboards/mwstudio/mw75/keymaps/default/keymap.c @@ -17,16 +17,6 @@ #include QMK_KEYBOARD_H -typedef union { - uint32_t raw; - struct { - bool top_rgb_change :1; - bool bottom_rgb_change :1; - }; -} user_config_t; - -user_config_t user_config; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( @@ -39,7 +29,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [1] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F23, KC_F24, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUI, RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAI, @@ -65,70 +55,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), }; - -void keyboard_post_init_user(void) { - // Read the user config from EEPROM - user_config.raw = eeconfig_read_user(); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KC_F23: - if (record->event.pressed) { - // Do something when pressed - user_config.top_rgb_change ^= 1; // Toggles the status - eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM - } else { - // Do something else when release - } - return false; // Skip all further processing of this key - case KC_F24: - if (record->event.pressed) { - // Do something when pressed - user_config.bottom_rgb_change ^= 1; // Toggles the status - eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM - } else { - // Do something else when release - } - return false; // Skip all further processing of this key - default: - return true; // Process all other keycodes normally - } -} - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } - return true; -} -#endif - -void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { - - if (user_config.top_rgb_change) - { - for (size_t i = 0; i < 81; i++) - { - RGB_MATRIX_INDICATOR_SET_COLOR(i, 0, 0, 0); - } - } - - if (host_keyboard_led_state().caps_lock) { - RGB_MATRIX_INDICATOR_SET_COLOR(36, 0, 255, 255); - } - - if (user_config.bottom_rgb_change) - { - for (size_t i = 81; i < 97; i++) - { - RGB_MATRIX_INDICATOR_SET_COLOR(i, 0, 0, 0); - } - } -} From 2572b1ec7a4f9aad1d13147f3a016e9a51dcbe95 Mon Sep 17 00:00:00 2001 From: TW59420 <40019210+TW59420@users.noreply.github.com> Date: Mon, 18 Oct 2021 14:53:22 +0800 Subject: [PATCH 22/22] Update keymap.c --- keyboards/mwstudio/mw75/keymaps/via/keymap.c | 79 +------------------- 1 file changed, 1 insertion(+), 78 deletions(-) diff --git a/keyboards/mwstudio/mw75/keymaps/via/keymap.c b/keyboards/mwstudio/mw75/keymaps/via/keymap.c index 956ab2d9b925..44eb8d0c04ae 100644 --- a/keyboards/mwstudio/mw75/keymaps/via/keymap.c +++ b/keyboards/mwstudio/mw75/keymaps/via/keymap.c @@ -17,16 +17,6 @@ #include QMK_KEYBOARD_H -typedef union { - uint32_t raw; - struct { - bool top_rgb_change :1; - bool bottom_rgb_change :1; - }; -} user_config_t; - -user_config_t user_config; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( @@ -39,7 +29,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [1] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F23, KC_F24, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUI, RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAI, @@ -65,70 +55,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), }; - -void keyboard_post_init_user(void) { - // Read the user config from EEPROM - user_config.raw = eeconfig_read_user(); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KC_F23: - if (record->event.pressed) { - // Do something when pressed - user_config.top_rgb_change ^= 1; // Toggles the status - eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM - } else { - // Do something else when release - } - return false; // Skip all further processing of this key - case KC_F24: - if (record->event.pressed) { - // Do something when pressed - user_config.bottom_rgb_change ^= 1; // Toggles the status - eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM - } else { - // Do something else when release - } - return false; // Skip all further processing of this key - default: - return true; // Process all other keycodes normally - } -} - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } - return true; -} -#endif - -void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { - - if (user_config.top_rgb_change) - { - for (size_t i = 0; i < 81; i++) - { - RGB_MATRIX_INDICATOR_SET_COLOR(i, 0, 0, 0); - } - } - - if (host_keyboard_led_state().caps_lock) { - RGB_MATRIX_INDICATOR_SET_COLOR(36, 0, 255, 255); - } - - if (user_config.bottom_rgb_change) - { - for (size_t i = 81; i < 97; i++) - { - RGB_MATRIX_INDICATOR_SET_COLOR(i, 0, 0, 0); - } - } -}