From b4e8c50629897aff881619e59c88c4bcc9020f2d Mon Sep 17 00:00:00 2001
From: JX <572673807@qq.com>
Date: Sat, 7 Aug 2021 03:37:57 +0800
Subject: [PATCH] add yp87ble and fix zhou75 encoder pin error
---
keyboards/yandrstudio/yp87ble/M69.c | 63 -------
keyboards/yandrstudio/yp87ble/M69.h | 34 ----
keyboards/yandrstudio/yp87ble/info-via.json | 173 +++++++++---------
keyboards/yandrstudio/zhou75/f401/config.h | 4 +-
keyboards/yandrstudio/zhou75/f401/rules.mk | 1 -
.../yandrstudio/zhou75/keymaps/via/keymap.c | 6 +-
keyboards/yandrstudio/zhou75/zhou75.h | 2 +-
7 files changed, 92 insertions(+), 191 deletions(-)
delete mode 100644 keyboards/yandrstudio/yp87ble/M69.c
delete mode 100644 keyboards/yandrstudio/yp87ble/M69.h
diff --git a/keyboards/yandrstudio/yp87ble/M69.c b/keyboards/yandrstudio/yp87ble/M69.c
deleted file mode 100644
index 91a2890ec004..000000000000
--- a/keyboards/yandrstudio/yp87ble/M69.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Copyright 2021 JasonRen(biu)
- *
- * 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
-
-
-
-#ifdef RGB_MATRIX_ENABLE
-led_config_t g_led_config = {
- {
- {0, NO_LED, 1, 2, 3, 4, NO_LED, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, \
- {34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 19, 18, 17, 16}, \
- {35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, NO_LED, 48, 49, 50, 51}, \
- {66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, NO_LED, 53, NO_LED, NO_LED, NO_LED}, \
- {68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, NO_LED, 82, NO_LED, 83, NO_LED}, \
- {95, 94, 93, NO_LED, NO_LED, NO_LED, 91, NO_LED, NO_LED, NO_LED, 90, 89, 88, NO_LED, 87, 86, 85, 84}
- },
- {
- // LED Index to Physical Position
- {0,0}, {26,0},{40,0},{53,0},{66,0}, {92,0},{105,0},{119,0},{132,0},{145,0},{158,0},{171,0},{184,0},{198,0},{211,0},{224,0}, \
- {224,13},{211,13},{198,13},{184,13},{184,13},{171,13},{158,13},{145,13},{132,13},{119,13},{105,13},{92,13},{79,13},{66,13},{53,13},{40,13},{26,13},{13,13},{0,13}, \
- {0,26},{13,26},{26,26},{40,26},{53,26},{66,26},{79,26},{92,26},{105,26},{119,26},{132,26},{145,26},{158,26}, {184,26},{198,26},{211,26},{224,26}, \
- {184,38},{184,38}, {158,38},{145,38},{132,38},{119,38},{105,38},{92,38},{79,38},{66,38},{53,38},{40,38},{26,38},{13,38},{0,38}, \
- {0,51},{0,51},{13,51},{26,51},{40,51},{53,51},{66,51},{79,51},{92,51},{105,51},{119,51},{132,51},{145,51},{158,51},{171,51},{184,51}, {211,51}, \
- {224,64},{211,64},{198,64},{184,64}, {158,64},{145,64},{132,64}, {92,64},{66,64}, {26,64},{13,64},{0,64}
- },
- {
- // LED Index to Flag
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, \
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, \
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, \
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, \
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, \
- 4, 4, 4, 4, 4, 4
- }
-};
-
-
-#endif
-
-#ifdef RGB_DISABLE_WHEN_USB_SUSPENDED
-void suspend_power_down_kb(void) {
- rgb_matrix_set_suspend_state(true);
- suspend_power_down_user();
-}
-
-void suspend_wakeup_init_kb(void) {
- rgb_matrix_set_suspend_state(false);
- suspend_wakeup_init_user();
-}
-#endif
diff --git a/keyboards/yandrstudio/yp87ble/M69.h b/keyboards/yandrstudio/yp87ble/M69.h
deleted file mode 100644
index ce43359af2da..000000000000
--- a/keyboards/yandrstudio/yp87ble/M69.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright 2020 zvecr
- *
- * 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, K002, K003, K004, K005, K007, K008, K009, K010, K011, K012, K013, K014, K015, K016, K017, \
- K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, K217, \
- K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K314, K315, K316, K317, \
- K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K414, \
- K500, K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512, K514, K516, \
- K600, K601, K602, K606, K610, K611, K613, K614, K615, K616, K617 \
-) { \
- { K000, KC_NO, K002, K003, K004, K005, KC_NO, K007, K008, K009, K010, K011, K012, K013, K014, K015, K016, K017 }, \
- { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, K217 }, \
- { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, KC_NO, K314, K315, K316, K317 }, \
- { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, KC_NO, K414, KC_NO, KC_NO, KC_NO }, \
- { K500, K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512, KC_NO, K514, KC_NO, K516, KC_NO }, \
- { K600, K601, K602, KC_NO, KC_NO, KC_NO, K606, KC_NO, KC_NO, KC_NO, K610, K611, KC_NO, K613, K614, K615, K616, K617 } \
-}
diff --git a/keyboards/yandrstudio/yp87ble/info-via.json b/keyboards/yandrstudio/yp87ble/info-via.json
index 8999d4a6fffc..751845a03640 100644
--- a/keyboards/yandrstudio/yp87ble/info-via.json
+++ b/keyboards/yandrstudio/yp87ble/info-via.json
@@ -1,14 +1,14 @@
{
- "name": "M69_Y&R",
+ "name": "YP87BLE_Y&R",
"vendorId": "0xAA96",
- "productId": "0xAAA6",
+ "productId": "0xAAA8",
"lighting": {
"extends": "none",
"keycodes": "qmk"
},
"matrix": {
- "rows": 6,
- "cols": 18
+ "rows": 9,
+ "cols": 10
},
"layouts": {
"keymap": [
@@ -17,60 +17,34 @@
{
"x": 1
},
+ "0,1",
"0,2",
"0,3",
"0,4",
- "0,5",
{
"x": 0.5
},
+ "0,5",
+ "0,6",
"0,7",
"0,8",
- "0,9",
- "0,10",
{
"x": 0.5
},
- "0,11",
- "0,12",
- "0,13",
- "0,14",
- {
- "x": 0.25
- },
- "0,15",
- "0,16",
- "0,17"
- ],
- [
- {
- "y": 0.5
- },
+ "0,9",
"1,0",
"1,1",
"1,2",
+ {
+ "x": 0.5
+ },
"1,3",
"1,4",
- "1,5",
- "1,6",
- "1,7",
- "1,8",
- "1,9",
- "1,10",
- "1,11",
- "1,12",
- "1,13",
- "1,14",
- {
- "x": 0.25
- },
- "1,15",
- "1,16",
- "1,17"
+ "1,5"
],
[
{
- "w": 1.5
+ "y": 0.5
},
"2,0",
"2,1",
@@ -82,45 +56,23 @@
"2,7",
"2,8",
"2,9",
- "2,10",
- "2,11",
- "2,12",
- {
- "w": 1.5
- },
- "2,14",
- {
- "x": 0.25
- },
- "2,15",
- "2,16",
- "2,17"
- ],
- [
- {
- "w": 1.75
- },
"3,0",
"3,1",
"3,2",
+ {
+ "w": 2
+ },
"3,3",
- "3,4",
- "3,5",
- "3,6",
- "3,7",
- "3,8",
- "3,9",
- "3,10",
- "3,11",
- "3,12",
{
- "w": 1.25
+ "x": 0.5
},
- "3,14"
+ "3,4",
+ "3,5",
+ "3,6"
],
[
{
- "w": 1.25
+ "w": 1.5
},
"4,0",
"4,1",
@@ -132,57 +84,104 @@
"4,7",
"4,8",
"4,9",
- "4,10",
- "4,11",
+ "5,0",
+ "5,1",
+ "5,2",
+ {
+ "w": 1.5
+ },
+ "5,3",
+ {
+ "x": 0.5
+ },
+ "5,4",
+ "5,5",
+ "5,6"
+ ],
+ [
{
"w": 1.75
},
- "4,12",
- "4,14",
+ "6,0",
+ "6,1",
+ "6,2",
+ "6,3",
+ "6,4",
+ "6,5",
+ "6,6",
+ "6,7",
+ "6,8",
+ "6,9",
+ "1,7",
+ "1,8",
+ {
+ "w": 2.25
+ },
+ "1,9"
+ ],
+ [
+ {
+ "w": 2.25
+ },
+ "7,0",
+ "7,1",
+ "7,2",
+ "7,3",
+ "7,4",
+ "7,5",
+ "7,6",
+ "7,7",
+ "7,8",
+ "7,9",
+ "3,8",
+ {
+ "w": 2.75
+ },
+ "3,9",
{
- "x": 1.25
+ "x": 1.5
},
- "4,16"
+ "8,9"
],
[
{
"w": 1.25
},
- "5,0",
+ "8,0",
{
"w": 1.25
},
- "5,1",
+ "8,1",
{
"w": 1.25
},
- "5,2",
+ "8,2",
{
"w": 6.25
},
- "5,6",
+ "8,3",
{
"w": 1.25
},
- "5,10",
+ "8,4",
{
"w": 1.25
},
- "5,11",
+ "8,5",
{
"w": 1.25
},
- "5,12",
+ "8,6",
{
"w": 1.25
},
- "5,14",
+ "8,7",
{
- "x": 0.25
+ "x": 0.5
},
- "5,15",
- "5,16",
- "5,17"
+ "5,7",
+ "5,8",
+ "5,9"
]
]
}
diff --git a/keyboards/yandrstudio/zhou75/f401/config.h b/keyboards/yandrstudio/zhou75/f401/config.h
index 4451f0d1b31f..11cfdf9acc2e 100644
--- a/keyboards/yandrstudio/zhou75/f401/config.h
+++ b/keyboards/yandrstudio/zhou75/f401/config.h
@@ -81,8 +81,8 @@
#ifdef ENCODER_ENABLE
-#define ENCODERS_PAD_A { B7, A5 }
-#define ENCODERS_PAD_B { B8, A6 }
+#define ENCODERS_PAD_A { B7, A4 }
+#define ENCODERS_PAD_B { B8, A5 }
#define ENCODER_RESOLUTIONS { 4, 4 }
diff --git a/keyboards/yandrstudio/zhou75/f401/rules.mk b/keyboards/yandrstudio/zhou75/f401/rules.mk
index ecf955cb2b3d..3043f3a4a5c2 100644
--- a/keyboards/yandrstudio/zhou75/f401/rules.mk
+++ b/keyboards/yandrstudio/zhou75/f401/rules.mk
@@ -29,6 +29,5 @@ OPT_DEFS += -DEEPROM_EMU_STM32F401xC
COMMON_VPATH += patsubst$(%/, %, dir $(mkfile_patch))/eep
-
# Enter lower-power sleep mode when on the ChibiOS idle thread
OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE
diff --git a/keyboards/yandrstudio/zhou75/keymaps/via/keymap.c b/keyboards/yandrstudio/zhou75/keymaps/via/keymap.c
index 041d11484bbb..40adf0bb2c34 100644
--- a/keyboards/yandrstudio/zhou75/keymaps/via/keymap.c
+++ b/keyboards/yandrstudio/zhou75/keymaps/via/keymap.c
@@ -24,7 +24,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
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_INS,
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_PGUP,
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_PGDN,
- KC_LCTL, KC_LGUI, KC_LALT, KC_PGUP, KC_PGDN, KC_SPC, KC_VOLU, KC_VOLD, KC_RALT, M(1), KC_LEFT, KC_DOWN, KC_RGHT),
+ KC_LCTL, KC_LGUI, KC_LALT, KC_PGUP, KC_PGDN, KC_SPC, KC_VOLU, KC_VOLD, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT),
LAYOUT(
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
@@ -61,7 +61,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
bool encoder_update_user(uint8_t index, bool clockwise) {
switch (index) {
- case 0:
+ case 1:
if (clockwise) {
uint16_t keycode = dynamic_keymap_get_keycode(biton32(layer_state), 5, 4);
if (keycode >= MACRO00 && keycode <= MACRO15) {
@@ -78,7 +78,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
}
}
break;
- case 1:
+ case 0:
if (clockwise) {
uint16_t keycode = dynamic_keymap_get_keycode(biton32(layer_state), 5, 7);
if (keycode >= MACRO00 && keycode <= MACRO15) {
diff --git a/keyboards/yandrstudio/zhou75/zhou75.h b/keyboards/yandrstudio/zhou75/zhou75.h
index 3b3007c6c705..3e18b9474bf1 100644
--- a/keyboards/yandrstudio/zhou75/zhou75.h
+++ b/keyboards/yandrstudio/zhou75/zhou75.h
@@ -30,5 +30,5 @@
{ 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, KC_NO, K413, K414 }, \
{ K500, KC_NO, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512, K513, K514 }, \
- { K600, K601, KC_NO, K603, K604, K605, K606, K607, K608, KC_NO, K610, K611, K612, K613, K614 } \
+ { K600, K601, KC_NO, K603, K604, K605, K606, K607, K608, KC_NO, K610, K611, K612, K613, K614 } \
}