From 2b9f0e287885f75b1c7c4fab16cb521fd77094fe Mon Sep 17 00:00:00 2001 From: James yun Date: Tue, 21 May 2024 16:20:41 +0900 Subject: [PATCH 1/9] add Aplusx keyboard --- keyboards/aplusx_pulsar/xboard_qs/board.h | 21 + keyboards/aplusx_pulsar/xboard_qs/config.h | 34 ++ keyboards/aplusx_pulsar/xboard_qs/halconf.h | 24 ++ keyboards/aplusx_pulsar/xboard_qs/info.json | 327 +++++++++++++++ .../xboard_qs/keymaps/default/keymap.c | 96 +++++ .../xboard_qs/keymaps/default/rules.mk | 1 + .../xboard_qs/keymaps/via/keymap.c | 371 ++++++++++++++++++ .../xboard_qs/keymaps/via/rules.mk | 2 + keyboards/aplusx_pulsar/xboard_qs/mcuconf.h | 38 ++ keyboards/aplusx_pulsar/xboard_qs/readme.md | 35 ++ keyboards/aplusx_pulsar/xboard_qs/rules.mk | 1 + 11 files changed, 950 insertions(+) create mode 100644 keyboards/aplusx_pulsar/xboard_qs/board.h create mode 100644 keyboards/aplusx_pulsar/xboard_qs/config.h create mode 100644 keyboards/aplusx_pulsar/xboard_qs/halconf.h create mode 100644 keyboards/aplusx_pulsar/xboard_qs/info.json create mode 100644 keyboards/aplusx_pulsar/xboard_qs/keymaps/default/keymap.c create mode 100644 keyboards/aplusx_pulsar/xboard_qs/keymaps/default/rules.mk create mode 100644 keyboards/aplusx_pulsar/xboard_qs/keymaps/via/keymap.c create mode 100644 keyboards/aplusx_pulsar/xboard_qs/keymaps/via/rules.mk create mode 100644 keyboards/aplusx_pulsar/xboard_qs/mcuconf.h create mode 100644 keyboards/aplusx_pulsar/xboard_qs/readme.md create mode 100644 keyboards/aplusx_pulsar/xboard_qs/rules.mk diff --git a/keyboards/aplusx_pulsar/xboard_qs/board.h b/keyboards/aplusx_pulsar/xboard_qs/board.h new file mode 100644 index 00000000000..feac895ad29 --- /dev/null +++ b/keyboards/aplusx_pulsar/xboard_qs/board.h @@ -0,0 +1,21 @@ +/* Copyright 2020 QMK + +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 + +#define STM32_HSECLK 12000000U +#include_next +#undef STM32_HSE_BYPASS diff --git a/keyboards/aplusx_pulsar/xboard_qs/config.h b/keyboards/aplusx_pulsar/xboard_qs/config.h new file mode 100644 index 00000000000..6c5beed891a --- /dev/null +++ b/keyboards/aplusx_pulsar/xboard_qs/config.h @@ -0,0 +1,34 @@ +/* Copyright 2024 Aplusx Inc. + * + * 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 + +#define WAIT_US_TIMER GPTD3 // Encoder 및 RGB ANI가 부드러워짐 + +/* USB Hub Control pins */ +#define GPIO_KM_PWEN C1 // Hub Device Power on/off +#define GPIO_KM_OE C2 // Hub Host Connection on/off +#define GPIO_KM_SEL C0 // Hub Host Selection +#define GPIO_TEST_DEBUG C9 // C3-LED / C9-GPIO PAD + +/* RGB Underglow or WS2812 RGB Matirx */ +#define WS2812_SPI_DRIVER SPID2 +#define WS2812_SPI_MOSI_PAL_MODE 0 +#define WS2812_SPI_SCK_PIN B13 +#define WS2812_SPI_SCK_PAL_MODE 5 +#define WS2812_SPI_DIVISOR 16 +#define WS2812_SPI_USE_CIRCULAR_BUFFER + diff --git a/keyboards/aplusx_pulsar/xboard_qs/halconf.h b/keyboards/aplusx_pulsar/xboard_qs/halconf.h new file mode 100644 index 00000000000..ddee01ab0d8 --- /dev/null +++ b/keyboards/aplusx_pulsar/xboard_qs/halconf.h @@ -0,0 +1,24 @@ +/* Copyright 2020 QMK + * + * 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 + +#define HAL_USE_PAL TRUE +#define HAL_USE_GPT TRUE + +#define HAL_USE_SPI TRUE + +#include_next diff --git a/keyboards/aplusx_pulsar/xboard_qs/info.json b/keyboards/aplusx_pulsar/xboard_qs/info.json new file mode 100644 index 00000000000..3e6f0eee73b --- /dev/null +++ b/keyboards/aplusx_pulsar/xboard_qs/info.json @@ -0,0 +1,327 @@ +{ + "keyboard_name": "Pulsar XBOARD QS", + "manufacturer": "Pulsar", + "url": "https://pulsargg.kr/", + "maintainer": "James Yun", + + "processor": "STM32F072", + "bootloader": "stm32-dfu", + + "usb": { + "vid": "0x3710", + "pid": "0x2400", + "device_version": "0.0.5" + }, + + "matrix_pins": { + "rows": ["A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7"], + "cols": ["C4", "C5", "B0", "B1", "B2", "B10", "B11", "B12", "B13", "B14", "A15", "C6", "C7", "C10", "C11", "C12"] + }, + "diode_direction": "ROW2COL", + "build": { + "lto": true + }, + "features": { + "bootmagic": true, + "extrakey": true, + "mousekey": true, + "nkro": true, + "encoder": true, + "rgb_matrix": true + }, + "bootmagic": { + "matrix": [2, 7] + }, + "eeprom": { + "wear_leveling": { + "backing_size": 4096 + } + }, + "encoder": { + "rotary": [ + {"pin_a": "C13", "pin_b": "C14"} + ] + }, + "rgb_matrix": { + "driver": "ws2812", + "default":{ + "val": 60 + }, + "sleep": true, + "max_brightness": 220, + "center_point": [80, 30], + "sat_steps": 8, + "speed_steps": 10, + "val_steps": 8, + "animations": { + "alphas_mods": true, + "gradient_up_down": true, + "gradient_left_right": true, + "breathing": true, + "band_sat": true, + "band_val": true, + "band_pinwheel_sat": true, + "band_pinwheel_val": true, + "band_spiral_sat": true, + "band_spiral_val": true, + "cycle_all": true, + "cycle_left_right": true, + "cycle_up_down": true, + "cycle_out_in": true, + "cycle_out_in_dual": true, + "rainbow_moving_chevron": true, + "cycle_pinwheel": true, + "cycle_spiral": true, + "dual_beacon": true, + "rainbow_beacon": true, + "rainbow_pinwheels": true, + "raindrops": true, + "jellybean_raindrops": true, + "hue_breathing": true, + "hue_pendulum": true, + "hue_wave": true, + "pixel_fractal": true, + "pixel_flow": true, + "pixel_rain": true, + "typing_heatmap": true, + "digital_rain": true, + "solid_reactive_simple": true, + "solid_reactive": true, + "solid_reactive_wide": true, + "solid_reactive_multiwide": true, + "solid_reactive_cross": true, + "solid_reactive_multicross": true, + "solid_reactive_nexus": true, + "solid_reactive_multinexus": true, + "splash": true, + "multisplash": true, + "solid_splash": true, + "solid_multisplash": true + }, + + "layout": [ + {"x": 0, "y": 0, "flags": 1}, + {"x": 9, "y": 0, "flags": 1}, + {"x": 18, "y": 0, "flags": 1}, + {"x": 27, "y": 0, "flags": 1}, + {"x": 36, "y": 0, "flags": 1}, + {"x": 45, "y": 0, "flags": 1}, + {"x": 54, "y": 0, "flags": 1}, + {"x": 63, "y": 0, "flags": 1}, + {"x": 72, "y": 0, "flags": 1}, + {"x": 81, "y": 0, "flags": 1}, + {"x": 90, "y": 0, "flags": 1}, + {"x": 99, "y": 0, "flags": 1}, + {"x": 108, "y": 0, "flags": 1}, + {"x": 117, "y": 0, "flags": 1}, + {"x": 126, "y": 0, "flags": 1}, + {"x": 135, "y": 0, "flags": 1}, + {"matrix": [6, 1], "x": 144, "y": 0, "flags": 1}, + {"matrix": [6, 2], "x": 153, "y": 0, "flags": 1}, + {"x": 162, "y": 0, "flags": 1}, + {"matrix": [6, 3], "x": 171, "y": 0, "flags": 1}, + {"x": 180, "y": 0, "flags": 1}, + {"matrix": [0, 15], "x": 180, "y": 11, "flags": 1}, + {"matrix": [0, 14], "x": 169, "y": 11, "flags": 1}, + {"matrix": [0, 13], "x": 159, "y": 11, "flags": 1}, + {"matrix": [6, 0], "x": 144, "y": 11, "flags": 1}, + {"matrix": [0, 12], "x": 133, "y": 11, "flags": 4}, + {"matrix": [0, 11], "x": 123, "y": 11, "flags": 4}, + {"matrix": [0, 10], "x": 112, "y": 11, "flags": 4}, + {"matrix": [0, 9], "x": 102, "y": 11, "flags": 4}, + {"matrix": [0, 8], "x": 89, "y": 11, "flags": 1}, + {"matrix": [0, 7], "x": 78, "y": 11, "flags": 1}, + {"matrix": [0, 6], "x": 68, "y": 11, "flags": 1}, + {"matrix": [0, 5], "x": 57, "y": 11, "flags": 1}, + {"matrix": [0, 4], "x": 45, "y": 11, "flags": 4}, + {"matrix": [0, 3], "x": 34, "y": 11, "flags": 4}, + {"matrix": [0, 2], "x": 24, "y": 11, "flags": 4}, + {"matrix": [0, 1], "x": 13, "y": 11, "flags": 4}, + {"matrix": [0, 0], "x": 0, "y": 11, "flags": 1}, + {"matrix": [1, 0], "x": 0, "y": 21, "flags": 4}, + {"matrix": [1, 1], "x": 10, "y": 21, "flags": 4}, + {"matrix": [1, 2], "x": 21, "y": 21, "flags": 4}, + {"matrix": [1, 3], "x": 31, "y": 21, "flags": 4}, + {"matrix": [1, 4], "x": 42, "y": 21, "flags": 4}, + {"matrix": [1, 5], "x": 52, "y": 21, "flags": 4}, + {"matrix": [1, 6], "x": 63, "y": 21, "flags": 4}, + {"matrix": [1, 7], "x": 73, "y": 21, "flags": 4}, + {"matrix": [1, 8], "x": 83, "y": 21, "flags": 4}, + {"matrix": [1, 9], "x": 94, "y": 21, "flags": 4}, + {"matrix": [1, 10], "x": 104, "y": 21, "flags": 4}, + {"matrix": [1, 11], "x": 115, "y": 21, "flags": 4}, + {"matrix": [1, 12], "x": 125, "y": 21, "flags": 4}, + {"matrix": [1, 14], "x": 139, "y": 21, "flags": 1}, + {"matrix": [2, 14], "x": 159, "y": 21, "flags": 1}, + {"matrix": [2, 15], "x": 169, "y": 21, "flags": 1}, + {"matrix": [1, 15], "x": 180, "y": 21, "flags": 1}, + {"matrix": [3, 15], "x": 180, "y": 32, "flags": 1}, + {"matrix": [3, 14], "x": 169, "y": 32, "flags": 1}, + {"matrix": [3, 13], "x": 159, "y": 32, "flags": 1}, + {"matrix": [2, 13], "x": 143, "y": 32, "flags": 4}, + {"matrix": [2, 12], "x": 130, "y": 32, "flags": 4}, + {"matrix": [2, 11], "x": 120, "y": 32, "flags": 4}, + {"matrix": [2, 10], "x": 109, "y": 32, "flags": 4}, + {"matrix": [2, 9], "x": 99, "y": 32, "flags": 4}, + {"matrix": [2, 8], "x": 89, "y": 32, "flags": 4}, + {"matrix": [2, 7], "x": 78, "y": 32, "flags": 4}, + {"matrix": [2, 6], "x": 68, "y": 32, "flags": 4}, + {"matrix": [2, 5], "x": 57, "y": 32, "flags": 4}, + {"matrix": [2, 4], "x": 47, "y": 32, "flags": 4}, + {"matrix": [2, 3], "x": 36, "y": 32, "flags": 4}, + {"matrix": [2, 2], "x": 26, "y": 32, "flags": 4}, + {"matrix": [2, 1], "x": 16, "y": 32, "flags": 4}, + {"matrix": [2, 0], "x": 3, "y": 32, "flags": 1}, + {"matrix": [3, 0], "x": 4, "y": 43, "flags": 1}, + {"matrix": [3, 1], "x": 18, "y": 43, "flags": 4}, + {"matrix": [3, 2], "x": 29, "y": 43, "flags": 4}, + {"matrix": [3, 3], "x": 39, "y": 43, "flags": 4}, + {"matrix": [3, 4], "x": 50, "y": 43, "flags": 4}, + {"matrix": [3, 5], "x": 60, "y": 43, "flags": 4}, + {"matrix": [3, 6], "x": 70, "y": 43, "flags": 4}, + {"matrix": [3, 7], "x": 81, "y": 43, "flags": 4}, + {"matrix": [3, 8], "x": 91, "y": 43, "flags": 4}, + {"matrix": [3, 9], "x": 102, "y": 43, "flags": 4}, + {"matrix": [3, 10], "x": 112, "y": 43, "flags": 4}, + {"matrix": [3, 11], "x": 123, "y": 43, "flags": 4}, + {"matrix": [4, 14], "x": 138, "y": 43, "flags": 1}, + {"matrix": [4, 15], "x": 169, "y": 53, "flags": 1}, + {"matrix": [4, 13], "x": 135, "y": 53, "flags": 1}, + {"matrix": [4, 11], "x": 117, "y": 53, "flags": 4}, + {"matrix": [4, 10], "x": 107, "y": 53, "flags": 4}, + {"matrix": [4, 9], "x": 96, "y": 53, "flags": 4}, + {"matrix": [4, 8], "x": 86, "y": 53, "flags": 4}, + {"matrix": [4, 7], "x": 76, "y": 53, "flags": 4}, + {"matrix": [4, 6], "x": 65, "y": 53, "flags": 4}, + {"matrix": [4, 5], "x": 55, "y": 53, "flags": 4}, + {"matrix": [4, 4], "x": 44, "y": 53, "flags": 4}, + {"matrix": [4, 3], "x": 34, "y": 53, "flags": 4}, + {"matrix": [4, 2], "x": 23, "y": 53, "flags": 4}, + {"matrix": [4, 0], "x": 10, "y": 53, "flags": 1}, + {"matrix": [5, 0], "x": 1, "y": 64, "flags": 1}, + {"matrix": [5, 1], "x": 14, "y": 64, "flags": 1}, + {"matrix": [5, 2], "x": 27, "y": 64, "flags": 1}, + {"x": 50, "y": 64, "flags": 4}, + {"matrix": [5, 6], "x": 66, "y": 64, "flags": 4}, + {"x": 80, "y": 64, "flags": 4}, + {"matrix": [5, 10], "x": 105, "y": 64, "flags": 1}, + {"matrix": [5, 11], "x": 118, "y": 64, "flags": 1}, + {"matrix": [5, 12], "x": 131, "y": 64, "flags": 1}, + {"matrix": [5, 13], "x": 145, "y": 64, "flags": 1}, + {"matrix": [5, 14], "x": 159, "y": 64, "flags": 1}, + {"matrix": [5, 15], "x": 169, "y": 64, "flags": 1}, + {"matrix": [6, 15], "x": 180, "y": 64, "flags": 1} + ] +}, + + "ws2812": { + "pin": "B15", + "driver": "spi" + }, + + "layouts": { + "LAYOUT": { + "layout": [ + { "matrix":[6,1],"label": "PC1", "x": 14.05, "y": 0 }, + { "matrix":[6,2],"label": "PC2", "x": 15.3, "y": 0 }, + { "matrix":[6,3],"label": "Audio", "x": 17, "y": 0 }, + + { "matrix":[0,0], "label": "Esc", "x": 0, "y": 1.3 }, + { "matrix":[0,1], "label": "F1", "x": 1.3, "y": 1.3 }, + { "matrix":[0,2], "label": "F2", "x": 2.3, "y": 1.3 }, + { "matrix":[0,3], "label": "F3", "x": 3.3, "y": 1.3 }, + { "matrix":[0,4], "label": "F4", "x": 4.3, "y": 1.3 }, + { "matrix":[0,5], "label": "F5", "x": 5.55, "y": 1.3 }, + { "matrix":[0,6], "label": "F6", "x": 6.55, "y": 1.3 }, + { "matrix":[0,7], "label": "F7", "x": 7.55, "y": 1.3 }, + { "matrix":[0,8], "label": "F8", "x": 8.55, "y": 1.3 }, + { "matrix":[0,9], "label": "F9", "x": 9.8, "y": 1.3 }, + { "matrix":[0,10], "label": "F10", "x": 10.8, "y": 1.3 }, + { "matrix":[0,11], "label": "F11", "x": 11.8, "y": 1.3 }, + { "matrix":[0,12], "label": "F12", "x": 12.8, "y": 1.3 }, + + { "matrix":[6,0], "label": "QUICK", "x": 14.05, "y": 1.3 }, + + { "matrix":[0,13], "label": "PrtSc", "x": 15.3, "y": 1.3 }, + { "matrix":[0,14], "label": "Scroll Lock", "x": 16.3, "y": 1.3 }, + { "matrix":[0,15], "label": "Pause", "x": 17.3, "y": 1.3 }, + + { "matrix":[1,0], "label": "~", "x": 0, "y": 2.5 }, + { "matrix":[1,1], "label": "!", "x": 1, "y": 2.5 }, + { "matrix":[1,2], "label": "@", "x": 2, "y": 2.5 }, + { "matrix":[1,3], "label": "#", "x": 3, "y": 2.5 }, + { "matrix":[1,4], "label": "$", "x": 4, "y": 2.5 }, + { "matrix":[1,5], "label": "%", "x": 5, "y": 2.5 }, + { "matrix":[1,6], "label": "^", "x": 6, "y": 2.5 }, + { "matrix":[1,7], "label": "&", "x": 7, "y": 2.5 }, + { "matrix":[1,8], "label": "*", "x": 8, "y": 2.5 }, + { "matrix":[1,9], "label": "(", "x": 9, "y": 2.5 }, + { "matrix":[1,10], "label": ")", "x": 10, "y": 2.5 }, + { "matrix":[1,11], "label": "_", "x": 11, "y": 2.5 }, + { "matrix":[1,12], "label": "+", "x": 12, "y": 2.5 }, + { "matrix":[1,14], "label": "Backspace", "x": 13, "y": 2.5, "w": 2 }, + { "matrix":[2,14], "label": "Insert", "x": 15.25, "y": 2.5 }, + { "matrix":[2,15], "label": "Home", "x": 16.25, "y": 2.5 }, + { "matrix":[1,15], "label": "PgUp", "x": 17.25, "y": 2.5 }, + + { "matrix":[2,0], "label": "Tab", "x": 0, "y": 3.5, "w": 1.5 }, + { "matrix":[2,1], "label": "Q", "x": 1.5, "y": 3.5 }, + { "matrix":[2,2], "label": "W", "x": 2.5, "y": 3.5 }, + { "matrix":[2,3], "label": "E", "x": 3.5, "y": 3.5 }, + { "matrix":[2,4], "label": "R", "x": 4.5, "y": 3.5 }, + { "matrix":[2,5], "label": "T", "x": 5.5, "y": 3.5 }, + { "matrix":[2,6], "label": "Y", "x": 6.5, "y": 3.5 }, + { "matrix":[2,7], "label": "U", "x": 7.5, "y": 3.5 }, + { "matrix":[2,8], "label": "I", "x": 8.5, "y": 3.5 }, + { "matrix":[2,9], "label": "O", "x": 9.5, "y": 3.5 }, + { "matrix":[2,10], "label": "P", "x": 10.5, "y": 3.5 }, + { "matrix":[2,11], "label": "{", "x": 11.5, "y": 3.5 }, + { "matrix":[2,12], "label": "}", "x": 12.5, "y": 3.5 }, + { "matrix":[2,13], "label": "|", "x": 13.5, "y": 3.5, "w": 1.5 }, + { "matrix":[3,13], "label": "Delete", "x": 15.25, "y": 3.5 }, + { "matrix":[3,14], "label": "End", "x": 16.25, "y": 3.5 }, + { "matrix":[3,15], "label": "PgDn", "x": 17.25, "y": 3.5 }, + + { "matrix":[3,0], "label": "Caps Lock", "x": 0, "y": 4.5, "w": 1.75 }, + { "matrix":[3,1], "label": "A", "x": 1.75, "y": 4.5 }, + { "matrix":[3,2], "label": "S", "x": 2.75, "y": 4.5 }, + { "matrix":[3,3], "label": "D", "x": 3.75, "y": 4.5 }, + { "matrix":[3,4], "label": "F", "x": 4.75, "y": 4.5 }, + { "matrix":[3,5], "label": "G", "x": 5.75, "y": 4.5 }, + { "matrix":[3,6], "label": "H", "x": 6.75, "y": 4.5 }, + { "matrix":[3,7], "label": "J", "x": 7.75, "y": 4.5 }, + { "matrix":[3,8], "label": "K", "x": 8.75, "y": 4.5 }, + { "matrix":[3,9], "label": "L", "x": 9.75, "y": 4.5 }, + { "matrix":[3,10], "label": ":", "x": 10.75, "y": 4.5 }, + { "matrix":[3,11], "label": "\"", "x": 11.75, "y": 4.5 }, + { "matrix":[4,14], "label": "Enter", "x": 12.75, "y": 4.5, "w": 2.25 }, + + { "matrix":[4,0], "label": "Shift", "x": 0, "y": 5.5, "w": 2.25 }, + { "matrix":[4,2], "label": "Z", "x": 2.25, "y": 5.5 }, + { "matrix":[4,3], "label": "X", "x": 3.25, "y": 5.5 }, + { "matrix":[4,4], "label": "C", "x": 4.25, "y": 5.5 }, + { "matrix":[4,5], "label": "V", "x": 5.25, "y": 5.5 }, + { "matrix":[4,6], "label": "B", "x": 6.25, "y": 5.5 }, + { "matrix":[4,7], "label": "N", "x": 7.25, "y": 5.5 }, + { "matrix":[4,8], "label": "M", "x": 8.25, "y": 5.5 }, + { "matrix":[4,9], "label": "<", "x": 9.25, "y": 5.5 }, + { "matrix":[4,10], "label": ">", "x": 10.25, "y": 5.5 }, + { "matrix":[4,11], "label": "?", "x": 11.25, "y": 5.5 }, + { "matrix":[4,13], "label": "Shift", "x": 12.25, "y": 5.5, "w": 2.75 }, + { "matrix":[4,15], "label": "Up", "x": 16.25, "y": 5.5 }, + + { "matrix":[5,0], "label": "Ctrl", "x": 0, "y": 6.5, "w": 1.25 }, + { "matrix":[5,1], "label": "Win", "x": 1.25, "y": 6.5, "w": 1.25 }, + { "matrix":[5,2], "label": "Alt", "x": 2.5, "y": 6.5, "w": 1.25 }, + { "matrix":[5,6], "label": "Space","x": 3.75, "y": 6.5, "w": 6.25 }, + { "matrix":[5,10], "label": "Alt", "x": 10, "y": 6.5, "w": 1.25 }, + { "matrix":[5,11], "label": "Fn", "x": 11.25, "y": 6.5, "w": 1.25 }, + { "matrix":[5,12], "label": "Menu", "x": 12.5, "y": 6.5, "w": 1.25 }, + { "matrix":[5,13], "label": "Ctrl", "x": 13.75, "y": 6.5, "w": 1.25 }, + { "matrix":[5,14], "label": "Left", "x": 15.25, "y": 6.5 }, + { "matrix":[5,15], "label": "Down", "x": 16.25, "y": 6.5 }, + { "matrix":[6,15], "label": "Right", "x": 17.25, "y": 6.5 } + ] + } + } +} diff --git a/keyboards/aplusx_pulsar/xboard_qs/keymaps/default/keymap.c b/keyboards/aplusx_pulsar/xboard_qs/keymaps/default/keymap.c new file mode 100644 index 00000000000..5cebf8b4e5f --- /dev/null +++ b/keyboards/aplusx_pulsar/xboard_qs/keymaps/default/keymap.c @@ -0,0 +1,96 @@ +/* Copyright 2024 Aplusx Inc. + * + * 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 + +enum _layer { WIN_BASE = 0, WIN_FN, MAC_BASE, MAC_FN }; + +enum pulsar_keycodes { +KC_TGUI = SAFE_RANGE, // Toggle between GUI Lock or Unlock +}; + +#define KC_TASK LGUI(KC_TAB) +#define KC_DIC LGUI(KC_H) // WIN ; 받아쓰기 +#define KC_LOCK2 LGUI(KC_L) // WIN ; pc잠금 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [WIN_BASE] = LAYOUT( /* Layer 0 ; WIN Base Layer */ + KC_VOLD, KC_VOLU, KC_MUTE, + 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, KC_F13, KC_PSCR, KC_SCRL,KC_PAUS, + 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_INS, KC_HOME, KC_PGUP, + 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_DEL, KC_END, KC_PGDN, + 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_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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [WIN_FN] = LAYOUT( /* Layer 1 ; WIN Function Layer */ + _______, _______, _______, + _______, KC_BRID, KC_BRIU, KC_TASK, KC_WSCH, KC_DIC, KC_MSEL, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, KC_CALC, KC_WHOM,KC_LOCK2, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, NK_OFF, NK_ON, RGB_TOG, RGB_SAI, RGB_HUI, RGB_MOD, + _______, KC_BTN1, KC_MS_U, KC_BTN2, KC_WH_U, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_HUD, RGB_RMOD, + _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, _______, _______, _______, _______, _______, _______, QK_BOOT, _______, + _______, KC_BTN4, KC_BTN3, KC_BTN5, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, + _______, GU_TOGG, _______, _______, _______,_______, _______, _______, RGB_SPD, RGB_VAD, RGB_SPI), + + [MAC_BASE] = LAYOUT( /* Layer 2 ; MAC Base Layer */ + KC_VOLD, KC_VOLU, KC_MUTE, + KC_ESC, KC_BRID, KC_BRIU, KC_TASK, KC_WSCH, KC_DIC, KC_MSEL, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE,KC_VOLD,KC_VOLU, _______, _______,_______,_______, + 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_INS, KC_HOME, KC_PGUP, + 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_DEL, KC_END, KC_PGDN, + 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_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_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(MAC_FN), KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [MAC_FN] = LAYOUT(/* Layer 3 ; MAC Function Layer */ + _______, _______, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_F13, KC_F14, KC_F15, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, NK_OFF, NK_ON, RGB_TOG, RGB_SAI, RGB_HUI, RGB_MOD, + _______, KC_BTN1, KC_MS_U, KC_BTN2, KC_WH_U, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_HUD, RGB_RMOD, + _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_BTN4, KC_BTN3, KC_BTN5, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, + _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_VAD, RGB_SPI) + }; +//----------------------------------------------------------------- +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + [WIN_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [WIN_FN] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI) }, + [MAC_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [MAC_FN] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI) } +}; +#endif // ENCODER_MAP_ENABLE + +//----------------------------------------------------------------------------- + +#ifdef RGB_MATRIX_ENABLE +bool rgb_matrix_indicators_user(void) { + + led_t host_leds = host_keyboard_led_state(); + + if (host_leds.caps_lock) { + rgb_matrix_set_color(72, 50, 50, 50); + } + if (host_leds.scroll_lock) { + rgb_matrix_set_color(22, 50, 50, 50); + } + + if (keymap_config.no_gui){ + rgb_matrix_set_color(99, 50, 50, 50); + } + return TRUE; +} +#endif diff --git a/keyboards/aplusx_pulsar/xboard_qs/keymaps/default/rules.mk b/keyboards/aplusx_pulsar/xboard_qs/keymaps/default/rules.mk new file mode 100644 index 00000000000..ee325681483 --- /dev/null +++ b/keyboards/aplusx_pulsar/xboard_qs/keymaps/default/rules.mk @@ -0,0 +1 @@ +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/aplusx_pulsar/xboard_qs/keymaps/via/keymap.c b/keyboards/aplusx_pulsar/xboard_qs/keymaps/via/keymap.c new file mode 100644 index 00000000000..68976713b93 --- /dev/null +++ b/keyboards/aplusx_pulsar/xboard_qs/keymaps/via/keymap.c @@ -0,0 +1,371 @@ +/* Copyright 2024 Aplusx Inc. + * + * 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 + +static bool INIT3S_on = false; +static bool INIT3S_led_on = false; +static uint16_t INIT3S_timer; // for custom key, INIT_3S + +static bool kvm_pc_sel = false; +static uint16_t kvm_timer; +static bool kvm_sel_on = false; + +static bool isMacMode = false; + +static uint8_t Status_LED_Bright; // maybe caps, scroll, PC1/2, win/mac, dynamic macro, win lock + // 0 = 초기값, 1~5 = 50~250의 5단계 밝기 +#define kvm_deadtime 100 +//------------------------------ +typedef union { + uint32_t raw; + struct { + bool eeprom_kvm_pc_sel :1; + uint8_t eeprom_Status_LED_Bright; // + }; +} user_config_t; + +user_config_t user_config; + +//-=------------------------------------------- + enum _layer { WIN_BASE = 0, WIN_FN, MAC_BASE, MAC_FN }; + + enum pulsar_keycodes { + KC_TGUI = QK_KB_0, // Ver 0.21.6에서 변경 (USER00,) // Toggle between GUI Lock or Unlock + KC_WIN_MODE, // WINDOWS Keyboard로 변경 + KC_MAC_MODE, // Machintosh Keyboard로 변경 + KC_TMODE, // WINDOWS <--> Machintosh + KC_SPOTLIGHT, // MAC_key + KC_DICTATION, // MAC_key + KC_DO_NOT_DISTURB, // MAC_key + KC_LOCK_SCREEN, // MAC_key + KC_LOPTN, // MAC_key - left option (win위치) + KC_ROPTN, // MAC_key - right option + KC_LCMMD, // MAC_key - left command (ALT위치) + KC_RCMMD, // MAC_key - right command + KC_TASK_VIEW, // for win (gui + tap) + KC_FILE_EXPLORER, // for win (gui + e) + KC_PC1, // KM Switch PC1 + KC_PC2, // KM Switch PC2 + KC_TPC, // KM Switch PC1<-->PC2 Toggle + INIT_3S, // EE_CLR(EEPROM CLear)(공장초기화)를 3초이상 눌러야 동작 + KC_S_LED, // Change Status LED Brightness + }; + +#define KC_WINM KC_WIN_MODE +#define KC_MACM KC_MAC_MODE + +#define KC_SPLT KC_SPOTLIGHT +#define KC_SIRI KC_DICTATION +#define KC_DOND KC_DO_NOT_DISTURB +#define KC_LOCK_ KC_LOCK_SCREEN + +#define KC_TASK LGUI(KC_TAB) +#define KC_FLXP LGUI(KC_E) +#define KC_DIC LGUI(KC_H) // WIN ; 받아쓰기 +#define KC_LOCK2 LGUI(KC_L) // WIN ; pc잠금 +#define KC_SNAP SCMD(KC_5) // MAC Capure ; commnd + shift + 5 + +void kvm_switch(bool pc_num){ + writePinHigh(GPIO_KM_OE); + writePinLow(GPIO_KM_PWEN); + if (!pc_num) writePinLow(GPIO_KM_SEL); + else writePinHigh(GPIO_KM_SEL); + writePinLow(GPIO_KM_OE); + + kvm_timer = timer_read(); + kvm_sel_on = true; +}; + +void keyboard_pre_init_user(void) { + setPinOutput(GPIO_KM_OE); // H/W power on default = 0 + setPinOutput(GPIO_KM_SEL); // H/W power on default = 0 + setPinOutput(GPIO_KM_PWEN); // H/W power on default = 1 +} + +void keyboard_post_init_user(void) { + user_config.raw = eeconfig_read_user(); // Read the user config from EEPROM + kvm_pc_sel = user_config.eeprom_kvm_pc_sel; + kvm_switch(kvm_pc_sel); + + Status_LED_Bright = user_config.eeprom_Status_LED_Bright; // 0 = 초기값, 1~5 = 50~250의 5단계 밝기 + if (Status_LED_Bright == 0) Status_LED_Bright = 5; +} + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [WIN_BASE] = LAYOUT( /* Layer 0 ; WIN Base Layer */ + KC_PC1, KC_PC2, KC_MUTE, + 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, KC_TMODE, KC_PSCR, KC_SCRL,KC_PAUS, + 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_INS, KC_HOME, KC_PGUP, + 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_DEL, KC_END, KC_PGDN, + 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_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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [WIN_FN] = LAYOUT( /* Layer 1 ; WIN Function Layer */ + KC_PC1, KC_PC2, RGB_MOD, + INIT_3S, KC_BRID, KC_BRIU, KC_TASK, KC_WSCH, KC_DIC, KC_MSEL, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TMODE, KC_CALC, KC_WHOM,KC_LOCK2, + DM_RSTP, DM_REC1, DM_REC2, DM_PLY1, DM_PLY2, _______, _______, _______, _______, _______, _______, NK_OFF, NK_ON, RGB_TOG, RGB_SAI, RGB_HUI, RGB_MOD, + _______, KC_BTN1, KC_MS_U, KC_BTN2, KC_WH_U, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_HUD, RGB_RMOD, + _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, _______, _______, _______, _______, _______, _______, QK_BOOT, _______, + _______, KC_BTN4, KC_BTN3, KC_BTN5, _______, KC_S_LED, _______, _______, _______, _______, _______, _______, RGB_VAI, + _______, GU_TOGG, _______, _______, _______,_______, _______, KC_TPC, RGB_SPD, RGB_VAD, RGB_SPI), + + [MAC_BASE] = LAYOUT( /* Layer 2 ; MAC Base Layer */ + KC_PC1, KC_PC2, KC_MUTE, + KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_SPLT, KC_SIRI, KC_DOND, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE,KC_VOLD,KC_VOLU, KC_TMODE, KC_SNAP,KC_LPAD,KC_LOCK_, + 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_INS, KC_HOME, KC_PGUP, + 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_DEL, KC_END, KC_PGDN, + 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_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_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(MAC_FN), KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [MAC_FN] = LAYOUT(/* Layer 3 ; MAC Function Layer */ + KC_PC1, KC_PC2, RGB_MOD, + INIT_3S, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TMODE, KC_F13, KC_F14, KC_F15, + DM_RSTP, DM_REC1, DM_REC2, DM_PLY1, DM_PLY2, _______, _______, _______, _______, _______, _______, NK_OFF, NK_ON, RGB_TOG, RGB_SAI, RGB_HUI, RGB_MOD, + _______, KC_BTN1, KC_MS_U, KC_BTN2, KC_WH_U, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_HUD, RGB_RMOD, + _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_BTN4, KC_BTN3, KC_BTN5, _______, KC_S_LED, _______, _______, _______, _______, _______, _______, RGB_VAI, + _______, _______, _______, _______, _______, _______, _______, KC_TPC, RGB_SPD, RGB_VAD, RGB_SPI) + }; +//----------------------------------------------------------------- +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + [WIN_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [WIN_FN] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI) }, + [MAC_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [MAC_FN] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI) } +}; +#endif // ENCODER_MAP_ENABLE +//----------------------------------------------------------------- +#define HCS(report) host_consumer_send(record->event.pressed ? report : 0); return false +#define HSS(report) host_system_send(record->event.pressed ? report : 0); return false + +static uint8_t mac_keycode[4] = {KC_LOPT, KC_ROPT, KC_LCMD, KC_RCMD}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + switch (keycode) { + case INIT_3S: + if (record->event.pressed){ + INIT3S_timer = timer_read(); + INIT3S_on = true; + return false; + } + else{ + INIT3S_on = false; + return false; + } + break; + + case KC_SPOTLIGHT: + HCS(0x221); + case KC_DICTATION: + HCS(0xCF); + case KC_DO_NOT_DISTURB: + HSS(0x9B); + case KC_LOCK_SCREEN: + HCS(0x19E); + + case KC_LOPTN: + case KC_ROPTN: + case KC_LCMMD: + case KC_RCMMD: + if (record->event.pressed) { + register_code(mac_keycode[keycode - KC_LOPTN]); + } else { + unregister_code(mac_keycode[keycode - KC_LOPTN]); + } + return false; + + case KC_WIN_MODE: + set_single_persistent_default_layer(0); + isMacMode = false; + return false; + + case KC_MAC_MODE: + set_single_persistent_default_layer(2); + isMacMode = true; + return false; + + case KC_TMODE: + if (record->event.pressed) { + switch (get_highest_layer(layer_state|default_layer_state)) { + case 0: + case 1: + set_single_persistent_default_layer(2); + isMacMode = true; + + break; + case 2: + case 3: + default: + set_single_persistent_default_layer(0); + isMacMode = false; + } + } + return false; + + case KC_PC1: + if (record->event.pressed) { + if (kvm_pc_sel) { + kvm_pc_sel = 0; + kvm_switch(0); + + user_config.eeprom_kvm_pc_sel = kvm_pc_sel; + eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM + } + } + return false; + + case KC_PC2: + if (record->event.pressed) { + if (!kvm_pc_sel){ + kvm_pc_sel = 1; + kvm_switch(1); + + user_config.eeprom_kvm_pc_sel = kvm_pc_sel; + eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM + } + } + return false; + + case KC_TPC: + if (record->event.pressed) { + kvm_pc_sel = !kvm_pc_sel; + if (kvm_pc_sel) kvm_switch(1); + else kvm_switch(0); + user_config.eeprom_kvm_pc_sel = kvm_pc_sel; // + eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM + } + return false; + + case KC_S_LED: // Change Status LED Brightness + if (record->event.pressed) { + if (++Status_LED_Bright > 5) { + Status_LED_Bright = 1; + }; + user_config.eeprom_Status_LED_Bright = Status_LED_Bright; // + eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM + } + return false; + + default: + return true; // Process all other keycodes normally + } + return true; +} + +bool isRecording = false; // dynamic macro REC. LED +bool isRecordingLedOn = false; +static uint16_t recording_timer; + +void matrix_scan_user(void) { + + if (kvm_sel_on == true){ + if (timer_elapsed(kvm_timer) > kvm_deadtime ) { + writePinHigh(GPIO_KM_PWEN); + kvm_sel_on = false; //// 키보드 리셋이 필요? + } + } + + if (INIT3S_on == true){ + if (timer_elapsed(INIT3S_timer) > 3000){ + INIT3S_on = false; + INIT3S_led_on = true; + INIT3S_timer = timer_read(); + } + } + if (INIT3S_led_on == true){ + if(timer_elapsed(INIT3S_timer) > 2000){ + eeconfig_init(); + soft_reset_keyboard(); + } + } + + if (isRecording){ + if(timer_elapsed(recording_timer) > 500) + { + isRecordingLedOn = !isRecordingLedOn; + recording_timer = timer_read(); + } + } +} + +#ifdef DYNAMIC_MACRO_ENABLE +void dynamic_macro_record_start_user(int8_t direction) { + isRecording = true; + isRecordingLedOn = true; + recording_timer = timer_read(); +} +void dynamic_macro_record_end_user(int8_t direction){ + isRecording = false; + isRecordingLedOn = false; +} +#endif + +#ifdef RGB_MATRIX_ENABLE +bool rgb_matrix_indicators_user(void) { + + uint8_t Status_LED_Bright_value = Status_LED_Bright * 50; + + uint8_t layer = get_highest_layer(layer_state|default_layer_state); + + led_t host_leds = host_keyboard_led_state(); + + if (host_leds.caps_lock) { + rgb_matrix_set_color(72, Status_LED_Bright_value, Status_LED_Bright_value, Status_LED_Bright_value); + } + if (host_leds.scroll_lock) { + rgb_matrix_set_color(22, Status_LED_Bright_value, Status_LED_Bright_value, Status_LED_Bright_value); + } + + if (INIT3S_led_on == true){ // Factory Reset ; all LED is RED + rgb_matrix_set_color_all(0xff, 0, 0); + } + + if (keymap_config.no_gui){ // WIN key Lock + rgb_matrix_set_color(99, Status_LED_Bright_value, Status_LED_Bright_value, Status_LED_Bright_value); + } + + if (isRecordingLedOn) { // Dynamic Macro Recording LED Blink + rgb_matrix_set_color(38, Status_LED_Bright_value, Status_LED_Bright_value, Status_LED_Bright_value); + } + + switch (layer) { // LED for WIN(layer 0, 1) or MAC(layer 2, 3) + case 0: + case 1: + rgb_matrix_set_color(24,0,0,Status_LED_Bright_value); // WIN-MAC key + isMacMode = false; + + if (kvm_pc_sel) rgb_matrix_set_color(103,0,0,Status_LED_Bright_value); // Windows Mode & PC2 + else rgb_matrix_set_color(101,0,0,Status_LED_Bright_value); // Windows Mode & PC1 + break; + + case 2: + case 3: + rgb_matrix_set_color(24,Status_LED_Bright_value,0,0); // WIN-MAC key + isMacMode = true; + + if (kvm_pc_sel) rgb_matrix_set_color(103,Status_LED_Bright_value,0,0); // MAC Mode & PC2 + else rgb_matrix_set_color(101,Status_LED_Bright_value,0,0); // MAC Mode & PC1 + break; + } + return TRUE; +} +#endif diff --git a/keyboards/aplusx_pulsar/xboard_qs/keymaps/via/rules.mk b/keyboards/aplusx_pulsar/xboard_qs/keymaps/via/rules.mk new file mode 100644 index 00000000000..f1adcab005e --- /dev/null +++ b/keyboards/aplusx_pulsar/xboard_qs/keymaps/via/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/aplusx_pulsar/xboard_qs/mcuconf.h b/keyboards/aplusx_pulsar/xboard_qs/mcuconf.h new file mode 100644 index 00000000000..62cddd050d8 --- /dev/null +++ b/keyboards/aplusx_pulsar/xboard_qs/mcuconf.h @@ -0,0 +1,38 @@ +/* Copyright 2020 QMK + * + * 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_next + +#undef STM32_GPT_USE_TIM3 +#define STM32_GPT_USE_TIM3 TRUE + +#undef STM32_SPI_USE_SPI2 +#define STM32_SPI_USE_SPI2 TRUE + +#undef STM32_HSE_ENABLED +#define STM32_HSE_ENABLED TRUE +#undef STM32_PLLSRC +#define STM32_PLLSRC STM32_PLLSRC_HSE +#undef STM32_PREDIV_VALUE +#define STM32_PREDIV_VALUE 1 +#undef STM32_PLLMUL_VALUE +#define STM32_PLLMUL_VALUE 4 +#undef STM32_USBSW +#define STM32_USBSW STM32_USBSW_PCLK +#undef STM32_ST_USE_TIMER +#define STM32_ST_USE_TIMER 2 diff --git a/keyboards/aplusx_pulsar/xboard_qs/readme.md b/keyboards/aplusx_pulsar/xboard_qs/readme.md new file mode 100644 index 00000000000..3f49699f734 --- /dev/null +++ b/keyboards/aplusx_pulsar/xboard_qs/readme.md @@ -0,0 +1,35 @@ +# Aplusx Pulsar XBOARD QS + +![Pulsar XBOARD QS](https://i.imgur.com/wpTinU4.jpeg) + +A 80% keyboard (/w 3 Special key, Encoder, USB Hub, switching 2 host function) + +* Keyboard Maintainer: [skylupin03](https://github.com/skylupin03) +* Hardware Supported: Pulsar XBOARD QS +* Hardware Availability: [Pulsar] (https://pulsargg.kr/product/list.html?cate_no=24) + +Make example for this keyboard (after setting up your build environment): + + make aplusx_pulsar/xboard_qs:default + make aplusx_pulsar/xboard_qs:via + +Flashing example for this keyboard: + + make aplusx_pulsar/xboard_qs: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 +Enter the bootloader in 3 ways: + +* **Bootmagic reset**: + 1. Unplug USB Cable. + 2. Hold the "u" key. + 3. Plug in the USB Cable, the Keyboard should be in ST-Bootloader state. + +* **Physical reset button**: Briefly press the button on the back of the PCB + 1. Unplug USB Cable. + 2. Hold the Physical reset button. + 3. Plug in the USB Cable, the Keyboard should be in ST-Bootloader state. + +* **Keycode in layout**: Press the key mapped to the `QK_BOOT` if set by the user diff --git a/keyboards/aplusx_pulsar/xboard_qs/rules.mk b/keyboards/aplusx_pulsar/xboard_qs/rules.mk new file mode 100644 index 00000000000..6e7633bfe01 --- /dev/null +++ b/keyboards/aplusx_pulsar/xboard_qs/rules.mk @@ -0,0 +1 @@ +# This file intentionally left blank From 5de432a2b790677dce41c6c65057e4c1aa26de6e Mon Sep 17 00:00:00 2001 From: James yun Date: Tue, 2 Jul 2024 15:41:59 +0900 Subject: [PATCH 2/9] Modified by the teachings of "drashna" --- keyboards/aplusx_pulsar/xboard_qs/info.json | 327 ------------------ .../xboard_qs/keymaps/default/keymap.c | 24 -- .../xboard_qs/keymaps/via/keymap.c | 306 +--------------- keyboards/aplusx_pulsar/xboard_qs/rules.mk | 1 - 4 files changed, 2 insertions(+), 656 deletions(-) delete mode 100644 keyboards/aplusx_pulsar/xboard_qs/info.json delete mode 100644 keyboards/aplusx_pulsar/xboard_qs/rules.mk diff --git a/keyboards/aplusx_pulsar/xboard_qs/info.json b/keyboards/aplusx_pulsar/xboard_qs/info.json deleted file mode 100644 index 3e6f0eee73b..00000000000 --- a/keyboards/aplusx_pulsar/xboard_qs/info.json +++ /dev/null @@ -1,327 +0,0 @@ -{ - "keyboard_name": "Pulsar XBOARD QS", - "manufacturer": "Pulsar", - "url": "https://pulsargg.kr/", - "maintainer": "James Yun", - - "processor": "STM32F072", - "bootloader": "stm32-dfu", - - "usb": { - "vid": "0x3710", - "pid": "0x2400", - "device_version": "0.0.5" - }, - - "matrix_pins": { - "rows": ["A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7"], - "cols": ["C4", "C5", "B0", "B1", "B2", "B10", "B11", "B12", "B13", "B14", "A15", "C6", "C7", "C10", "C11", "C12"] - }, - "diode_direction": "ROW2COL", - "build": { - "lto": true - }, - "features": { - "bootmagic": true, - "extrakey": true, - "mousekey": true, - "nkro": true, - "encoder": true, - "rgb_matrix": true - }, - "bootmagic": { - "matrix": [2, 7] - }, - "eeprom": { - "wear_leveling": { - "backing_size": 4096 - } - }, - "encoder": { - "rotary": [ - {"pin_a": "C13", "pin_b": "C14"} - ] - }, - "rgb_matrix": { - "driver": "ws2812", - "default":{ - "val": 60 - }, - "sleep": true, - "max_brightness": 220, - "center_point": [80, 30], - "sat_steps": 8, - "speed_steps": 10, - "val_steps": 8, - "animations": { - "alphas_mods": true, - "gradient_up_down": true, - "gradient_left_right": true, - "breathing": true, - "band_sat": true, - "band_val": true, - "band_pinwheel_sat": true, - "band_pinwheel_val": true, - "band_spiral_sat": true, - "band_spiral_val": true, - "cycle_all": true, - "cycle_left_right": true, - "cycle_up_down": true, - "cycle_out_in": true, - "cycle_out_in_dual": true, - "rainbow_moving_chevron": true, - "cycle_pinwheel": true, - "cycle_spiral": true, - "dual_beacon": true, - "rainbow_beacon": true, - "rainbow_pinwheels": true, - "raindrops": true, - "jellybean_raindrops": true, - "hue_breathing": true, - "hue_pendulum": true, - "hue_wave": true, - "pixel_fractal": true, - "pixel_flow": true, - "pixel_rain": true, - "typing_heatmap": true, - "digital_rain": true, - "solid_reactive_simple": true, - "solid_reactive": true, - "solid_reactive_wide": true, - "solid_reactive_multiwide": true, - "solid_reactive_cross": true, - "solid_reactive_multicross": true, - "solid_reactive_nexus": true, - "solid_reactive_multinexus": true, - "splash": true, - "multisplash": true, - "solid_splash": true, - "solid_multisplash": true - }, - - "layout": [ - {"x": 0, "y": 0, "flags": 1}, - {"x": 9, "y": 0, "flags": 1}, - {"x": 18, "y": 0, "flags": 1}, - {"x": 27, "y": 0, "flags": 1}, - {"x": 36, "y": 0, "flags": 1}, - {"x": 45, "y": 0, "flags": 1}, - {"x": 54, "y": 0, "flags": 1}, - {"x": 63, "y": 0, "flags": 1}, - {"x": 72, "y": 0, "flags": 1}, - {"x": 81, "y": 0, "flags": 1}, - {"x": 90, "y": 0, "flags": 1}, - {"x": 99, "y": 0, "flags": 1}, - {"x": 108, "y": 0, "flags": 1}, - {"x": 117, "y": 0, "flags": 1}, - {"x": 126, "y": 0, "flags": 1}, - {"x": 135, "y": 0, "flags": 1}, - {"matrix": [6, 1], "x": 144, "y": 0, "flags": 1}, - {"matrix": [6, 2], "x": 153, "y": 0, "flags": 1}, - {"x": 162, "y": 0, "flags": 1}, - {"matrix": [6, 3], "x": 171, "y": 0, "flags": 1}, - {"x": 180, "y": 0, "flags": 1}, - {"matrix": [0, 15], "x": 180, "y": 11, "flags": 1}, - {"matrix": [0, 14], "x": 169, "y": 11, "flags": 1}, - {"matrix": [0, 13], "x": 159, "y": 11, "flags": 1}, - {"matrix": [6, 0], "x": 144, "y": 11, "flags": 1}, - {"matrix": [0, 12], "x": 133, "y": 11, "flags": 4}, - {"matrix": [0, 11], "x": 123, "y": 11, "flags": 4}, - {"matrix": [0, 10], "x": 112, "y": 11, "flags": 4}, - {"matrix": [0, 9], "x": 102, "y": 11, "flags": 4}, - {"matrix": [0, 8], "x": 89, "y": 11, "flags": 1}, - {"matrix": [0, 7], "x": 78, "y": 11, "flags": 1}, - {"matrix": [0, 6], "x": 68, "y": 11, "flags": 1}, - {"matrix": [0, 5], "x": 57, "y": 11, "flags": 1}, - {"matrix": [0, 4], "x": 45, "y": 11, "flags": 4}, - {"matrix": [0, 3], "x": 34, "y": 11, "flags": 4}, - {"matrix": [0, 2], "x": 24, "y": 11, "flags": 4}, - {"matrix": [0, 1], "x": 13, "y": 11, "flags": 4}, - {"matrix": [0, 0], "x": 0, "y": 11, "flags": 1}, - {"matrix": [1, 0], "x": 0, "y": 21, "flags": 4}, - {"matrix": [1, 1], "x": 10, "y": 21, "flags": 4}, - {"matrix": [1, 2], "x": 21, "y": 21, "flags": 4}, - {"matrix": [1, 3], "x": 31, "y": 21, "flags": 4}, - {"matrix": [1, 4], "x": 42, "y": 21, "flags": 4}, - {"matrix": [1, 5], "x": 52, "y": 21, "flags": 4}, - {"matrix": [1, 6], "x": 63, "y": 21, "flags": 4}, - {"matrix": [1, 7], "x": 73, "y": 21, "flags": 4}, - {"matrix": [1, 8], "x": 83, "y": 21, "flags": 4}, - {"matrix": [1, 9], "x": 94, "y": 21, "flags": 4}, - {"matrix": [1, 10], "x": 104, "y": 21, "flags": 4}, - {"matrix": [1, 11], "x": 115, "y": 21, "flags": 4}, - {"matrix": [1, 12], "x": 125, "y": 21, "flags": 4}, - {"matrix": [1, 14], "x": 139, "y": 21, "flags": 1}, - {"matrix": [2, 14], "x": 159, "y": 21, "flags": 1}, - {"matrix": [2, 15], "x": 169, "y": 21, "flags": 1}, - {"matrix": [1, 15], "x": 180, "y": 21, "flags": 1}, - {"matrix": [3, 15], "x": 180, "y": 32, "flags": 1}, - {"matrix": [3, 14], "x": 169, "y": 32, "flags": 1}, - {"matrix": [3, 13], "x": 159, "y": 32, "flags": 1}, - {"matrix": [2, 13], "x": 143, "y": 32, "flags": 4}, - {"matrix": [2, 12], "x": 130, "y": 32, "flags": 4}, - {"matrix": [2, 11], "x": 120, "y": 32, "flags": 4}, - {"matrix": [2, 10], "x": 109, "y": 32, "flags": 4}, - {"matrix": [2, 9], "x": 99, "y": 32, "flags": 4}, - {"matrix": [2, 8], "x": 89, "y": 32, "flags": 4}, - {"matrix": [2, 7], "x": 78, "y": 32, "flags": 4}, - {"matrix": [2, 6], "x": 68, "y": 32, "flags": 4}, - {"matrix": [2, 5], "x": 57, "y": 32, "flags": 4}, - {"matrix": [2, 4], "x": 47, "y": 32, "flags": 4}, - {"matrix": [2, 3], "x": 36, "y": 32, "flags": 4}, - {"matrix": [2, 2], "x": 26, "y": 32, "flags": 4}, - {"matrix": [2, 1], "x": 16, "y": 32, "flags": 4}, - {"matrix": [2, 0], "x": 3, "y": 32, "flags": 1}, - {"matrix": [3, 0], "x": 4, "y": 43, "flags": 1}, - {"matrix": [3, 1], "x": 18, "y": 43, "flags": 4}, - {"matrix": [3, 2], "x": 29, "y": 43, "flags": 4}, - {"matrix": [3, 3], "x": 39, "y": 43, "flags": 4}, - {"matrix": [3, 4], "x": 50, "y": 43, "flags": 4}, - {"matrix": [3, 5], "x": 60, "y": 43, "flags": 4}, - {"matrix": [3, 6], "x": 70, "y": 43, "flags": 4}, - {"matrix": [3, 7], "x": 81, "y": 43, "flags": 4}, - {"matrix": [3, 8], "x": 91, "y": 43, "flags": 4}, - {"matrix": [3, 9], "x": 102, "y": 43, "flags": 4}, - {"matrix": [3, 10], "x": 112, "y": 43, "flags": 4}, - {"matrix": [3, 11], "x": 123, "y": 43, "flags": 4}, - {"matrix": [4, 14], "x": 138, "y": 43, "flags": 1}, - {"matrix": [4, 15], "x": 169, "y": 53, "flags": 1}, - {"matrix": [4, 13], "x": 135, "y": 53, "flags": 1}, - {"matrix": [4, 11], "x": 117, "y": 53, "flags": 4}, - {"matrix": [4, 10], "x": 107, "y": 53, "flags": 4}, - {"matrix": [4, 9], "x": 96, "y": 53, "flags": 4}, - {"matrix": [4, 8], "x": 86, "y": 53, "flags": 4}, - {"matrix": [4, 7], "x": 76, "y": 53, "flags": 4}, - {"matrix": [4, 6], "x": 65, "y": 53, "flags": 4}, - {"matrix": [4, 5], "x": 55, "y": 53, "flags": 4}, - {"matrix": [4, 4], "x": 44, "y": 53, "flags": 4}, - {"matrix": [4, 3], "x": 34, "y": 53, "flags": 4}, - {"matrix": [4, 2], "x": 23, "y": 53, "flags": 4}, - {"matrix": [4, 0], "x": 10, "y": 53, "flags": 1}, - {"matrix": [5, 0], "x": 1, "y": 64, "flags": 1}, - {"matrix": [5, 1], "x": 14, "y": 64, "flags": 1}, - {"matrix": [5, 2], "x": 27, "y": 64, "flags": 1}, - {"x": 50, "y": 64, "flags": 4}, - {"matrix": [5, 6], "x": 66, "y": 64, "flags": 4}, - {"x": 80, "y": 64, "flags": 4}, - {"matrix": [5, 10], "x": 105, "y": 64, "flags": 1}, - {"matrix": [5, 11], "x": 118, "y": 64, "flags": 1}, - {"matrix": [5, 12], "x": 131, "y": 64, "flags": 1}, - {"matrix": [5, 13], "x": 145, "y": 64, "flags": 1}, - {"matrix": [5, 14], "x": 159, "y": 64, "flags": 1}, - {"matrix": [5, 15], "x": 169, "y": 64, "flags": 1}, - {"matrix": [6, 15], "x": 180, "y": 64, "flags": 1} - ] -}, - - "ws2812": { - "pin": "B15", - "driver": "spi" - }, - - "layouts": { - "LAYOUT": { - "layout": [ - { "matrix":[6,1],"label": "PC1", "x": 14.05, "y": 0 }, - { "matrix":[6,2],"label": "PC2", "x": 15.3, "y": 0 }, - { "matrix":[6,3],"label": "Audio", "x": 17, "y": 0 }, - - { "matrix":[0,0], "label": "Esc", "x": 0, "y": 1.3 }, - { "matrix":[0,1], "label": "F1", "x": 1.3, "y": 1.3 }, - { "matrix":[0,2], "label": "F2", "x": 2.3, "y": 1.3 }, - { "matrix":[0,3], "label": "F3", "x": 3.3, "y": 1.3 }, - { "matrix":[0,4], "label": "F4", "x": 4.3, "y": 1.3 }, - { "matrix":[0,5], "label": "F5", "x": 5.55, "y": 1.3 }, - { "matrix":[0,6], "label": "F6", "x": 6.55, "y": 1.3 }, - { "matrix":[0,7], "label": "F7", "x": 7.55, "y": 1.3 }, - { "matrix":[0,8], "label": "F8", "x": 8.55, "y": 1.3 }, - { "matrix":[0,9], "label": "F9", "x": 9.8, "y": 1.3 }, - { "matrix":[0,10], "label": "F10", "x": 10.8, "y": 1.3 }, - { "matrix":[0,11], "label": "F11", "x": 11.8, "y": 1.3 }, - { "matrix":[0,12], "label": "F12", "x": 12.8, "y": 1.3 }, - - { "matrix":[6,0], "label": "QUICK", "x": 14.05, "y": 1.3 }, - - { "matrix":[0,13], "label": "PrtSc", "x": 15.3, "y": 1.3 }, - { "matrix":[0,14], "label": "Scroll Lock", "x": 16.3, "y": 1.3 }, - { "matrix":[0,15], "label": "Pause", "x": 17.3, "y": 1.3 }, - - { "matrix":[1,0], "label": "~", "x": 0, "y": 2.5 }, - { "matrix":[1,1], "label": "!", "x": 1, "y": 2.5 }, - { "matrix":[1,2], "label": "@", "x": 2, "y": 2.5 }, - { "matrix":[1,3], "label": "#", "x": 3, "y": 2.5 }, - { "matrix":[1,4], "label": "$", "x": 4, "y": 2.5 }, - { "matrix":[1,5], "label": "%", "x": 5, "y": 2.5 }, - { "matrix":[1,6], "label": "^", "x": 6, "y": 2.5 }, - { "matrix":[1,7], "label": "&", "x": 7, "y": 2.5 }, - { "matrix":[1,8], "label": "*", "x": 8, "y": 2.5 }, - { "matrix":[1,9], "label": "(", "x": 9, "y": 2.5 }, - { "matrix":[1,10], "label": ")", "x": 10, "y": 2.5 }, - { "matrix":[1,11], "label": "_", "x": 11, "y": 2.5 }, - { "matrix":[1,12], "label": "+", "x": 12, "y": 2.5 }, - { "matrix":[1,14], "label": "Backspace", "x": 13, "y": 2.5, "w": 2 }, - { "matrix":[2,14], "label": "Insert", "x": 15.25, "y": 2.5 }, - { "matrix":[2,15], "label": "Home", "x": 16.25, "y": 2.5 }, - { "matrix":[1,15], "label": "PgUp", "x": 17.25, "y": 2.5 }, - - { "matrix":[2,0], "label": "Tab", "x": 0, "y": 3.5, "w": 1.5 }, - { "matrix":[2,1], "label": "Q", "x": 1.5, "y": 3.5 }, - { "matrix":[2,2], "label": "W", "x": 2.5, "y": 3.5 }, - { "matrix":[2,3], "label": "E", "x": 3.5, "y": 3.5 }, - { "matrix":[2,4], "label": "R", "x": 4.5, "y": 3.5 }, - { "matrix":[2,5], "label": "T", "x": 5.5, "y": 3.5 }, - { "matrix":[2,6], "label": "Y", "x": 6.5, "y": 3.5 }, - { "matrix":[2,7], "label": "U", "x": 7.5, "y": 3.5 }, - { "matrix":[2,8], "label": "I", "x": 8.5, "y": 3.5 }, - { "matrix":[2,9], "label": "O", "x": 9.5, "y": 3.5 }, - { "matrix":[2,10], "label": "P", "x": 10.5, "y": 3.5 }, - { "matrix":[2,11], "label": "{", "x": 11.5, "y": 3.5 }, - { "matrix":[2,12], "label": "}", "x": 12.5, "y": 3.5 }, - { "matrix":[2,13], "label": "|", "x": 13.5, "y": 3.5, "w": 1.5 }, - { "matrix":[3,13], "label": "Delete", "x": 15.25, "y": 3.5 }, - { "matrix":[3,14], "label": "End", "x": 16.25, "y": 3.5 }, - { "matrix":[3,15], "label": "PgDn", "x": 17.25, "y": 3.5 }, - - { "matrix":[3,0], "label": "Caps Lock", "x": 0, "y": 4.5, "w": 1.75 }, - { "matrix":[3,1], "label": "A", "x": 1.75, "y": 4.5 }, - { "matrix":[3,2], "label": "S", "x": 2.75, "y": 4.5 }, - { "matrix":[3,3], "label": "D", "x": 3.75, "y": 4.5 }, - { "matrix":[3,4], "label": "F", "x": 4.75, "y": 4.5 }, - { "matrix":[3,5], "label": "G", "x": 5.75, "y": 4.5 }, - { "matrix":[3,6], "label": "H", "x": 6.75, "y": 4.5 }, - { "matrix":[3,7], "label": "J", "x": 7.75, "y": 4.5 }, - { "matrix":[3,8], "label": "K", "x": 8.75, "y": 4.5 }, - { "matrix":[3,9], "label": "L", "x": 9.75, "y": 4.5 }, - { "matrix":[3,10], "label": ":", "x": 10.75, "y": 4.5 }, - { "matrix":[3,11], "label": "\"", "x": 11.75, "y": 4.5 }, - { "matrix":[4,14], "label": "Enter", "x": 12.75, "y": 4.5, "w": 2.25 }, - - { "matrix":[4,0], "label": "Shift", "x": 0, "y": 5.5, "w": 2.25 }, - { "matrix":[4,2], "label": "Z", "x": 2.25, "y": 5.5 }, - { "matrix":[4,3], "label": "X", "x": 3.25, "y": 5.5 }, - { "matrix":[4,4], "label": "C", "x": 4.25, "y": 5.5 }, - { "matrix":[4,5], "label": "V", "x": 5.25, "y": 5.5 }, - { "matrix":[4,6], "label": "B", "x": 6.25, "y": 5.5 }, - { "matrix":[4,7], "label": "N", "x": 7.25, "y": 5.5 }, - { "matrix":[4,8], "label": "M", "x": 8.25, "y": 5.5 }, - { "matrix":[4,9], "label": "<", "x": 9.25, "y": 5.5 }, - { "matrix":[4,10], "label": ">", "x": 10.25, "y": 5.5 }, - { "matrix":[4,11], "label": "?", "x": 11.25, "y": 5.5 }, - { "matrix":[4,13], "label": "Shift", "x": 12.25, "y": 5.5, "w": 2.75 }, - { "matrix":[4,15], "label": "Up", "x": 16.25, "y": 5.5 }, - - { "matrix":[5,0], "label": "Ctrl", "x": 0, "y": 6.5, "w": 1.25 }, - { "matrix":[5,1], "label": "Win", "x": 1.25, "y": 6.5, "w": 1.25 }, - { "matrix":[5,2], "label": "Alt", "x": 2.5, "y": 6.5, "w": 1.25 }, - { "matrix":[5,6], "label": "Space","x": 3.75, "y": 6.5, "w": 6.25 }, - { "matrix":[5,10], "label": "Alt", "x": 10, "y": 6.5, "w": 1.25 }, - { "matrix":[5,11], "label": "Fn", "x": 11.25, "y": 6.5, "w": 1.25 }, - { "matrix":[5,12], "label": "Menu", "x": 12.5, "y": 6.5, "w": 1.25 }, - { "matrix":[5,13], "label": "Ctrl", "x": 13.75, "y": 6.5, "w": 1.25 }, - { "matrix":[5,14], "label": "Left", "x": 15.25, "y": 6.5 }, - { "matrix":[5,15], "label": "Down", "x": 16.25, "y": 6.5 }, - { "matrix":[6,15], "label": "Right", "x": 17.25, "y": 6.5 } - ] - } - } -} diff --git a/keyboards/aplusx_pulsar/xboard_qs/keymaps/default/keymap.c b/keyboards/aplusx_pulsar/xboard_qs/keymaps/default/keymap.c index 5cebf8b4e5f..7c737d6a26b 100644 --- a/keyboards/aplusx_pulsar/xboard_qs/keymaps/default/keymap.c +++ b/keyboards/aplusx_pulsar/xboard_qs/keymaps/default/keymap.c @@ -18,10 +18,6 @@ enum _layer { WIN_BASE = 0, WIN_FN, MAC_BASE, MAC_FN }; -enum pulsar_keycodes { -KC_TGUI = SAFE_RANGE, // Toggle between GUI Lock or Unlock -}; - #define KC_TASK LGUI(KC_TAB) #define KC_DIC LGUI(KC_H) // WIN ; 받아쓰기 #define KC_LOCK2 LGUI(KC_L) // WIN ; pc잠금 @@ -74,23 +70,3 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { }; #endif // ENCODER_MAP_ENABLE -//----------------------------------------------------------------------------- - -#ifdef RGB_MATRIX_ENABLE -bool rgb_matrix_indicators_user(void) { - - led_t host_leds = host_keyboard_led_state(); - - if (host_leds.caps_lock) { - rgb_matrix_set_color(72, 50, 50, 50); - } - if (host_leds.scroll_lock) { - rgb_matrix_set_color(22, 50, 50, 50); - } - - if (keymap_config.no_gui){ - rgb_matrix_set_color(99, 50, 50, 50); - } - return TRUE; -} -#endif diff --git a/keyboards/aplusx_pulsar/xboard_qs/keymaps/via/keymap.c b/keyboards/aplusx_pulsar/xboard_qs/keymaps/via/keymap.c index 68976713b93..fe347916d79 100644 --- a/keyboards/aplusx_pulsar/xboard_qs/keymaps/via/keymap.c +++ b/keyboards/aplusx_pulsar/xboard_qs/keymaps/via/keymap.c @@ -16,94 +16,9 @@ #include QMK_KEYBOARD_H -static bool INIT3S_on = false; -static bool INIT3S_led_on = false; -static uint16_t INIT3S_timer; // for custom key, INIT_3S +#include "xboard_qs.h" -static bool kvm_pc_sel = false; -static uint16_t kvm_timer; -static bool kvm_sel_on = false; - -static bool isMacMode = false; - -static uint8_t Status_LED_Bright; // maybe caps, scroll, PC1/2, win/mac, dynamic macro, win lock - // 0 = 초기값, 1~5 = 50~250의 5단계 밝기 -#define kvm_deadtime 100 -//------------------------------ -typedef union { - uint32_t raw; - struct { - bool eeprom_kvm_pc_sel :1; - uint8_t eeprom_Status_LED_Bright; // - }; -} user_config_t; - -user_config_t user_config; - -//-=------------------------------------------- - enum _layer { WIN_BASE = 0, WIN_FN, MAC_BASE, MAC_FN }; - - enum pulsar_keycodes { - KC_TGUI = QK_KB_0, // Ver 0.21.6에서 변경 (USER00,) // Toggle between GUI Lock or Unlock - KC_WIN_MODE, // WINDOWS Keyboard로 변경 - KC_MAC_MODE, // Machintosh Keyboard로 변경 - KC_TMODE, // WINDOWS <--> Machintosh - KC_SPOTLIGHT, // MAC_key - KC_DICTATION, // MAC_key - KC_DO_NOT_DISTURB, // MAC_key - KC_LOCK_SCREEN, // MAC_key - KC_LOPTN, // MAC_key - left option (win위치) - KC_ROPTN, // MAC_key - right option - KC_LCMMD, // MAC_key - left command (ALT위치) - KC_RCMMD, // MAC_key - right command - KC_TASK_VIEW, // for win (gui + tap) - KC_FILE_EXPLORER, // for win (gui + e) - KC_PC1, // KM Switch PC1 - KC_PC2, // KM Switch PC2 - KC_TPC, // KM Switch PC1<-->PC2 Toggle - INIT_3S, // EE_CLR(EEPROM CLear)(공장초기화)를 3초이상 눌러야 동작 - KC_S_LED, // Change Status LED Brightness - }; - -#define KC_WINM KC_WIN_MODE -#define KC_MACM KC_MAC_MODE - -#define KC_SPLT KC_SPOTLIGHT -#define KC_SIRI KC_DICTATION -#define KC_DOND KC_DO_NOT_DISTURB -#define KC_LOCK_ KC_LOCK_SCREEN - -#define KC_TASK LGUI(KC_TAB) -#define KC_FLXP LGUI(KC_E) -#define KC_DIC LGUI(KC_H) // WIN ; 받아쓰기 -#define KC_LOCK2 LGUI(KC_L) // WIN ; pc잠금 -#define KC_SNAP SCMD(KC_5) // MAC Capure ; commnd + shift + 5 - -void kvm_switch(bool pc_num){ - writePinHigh(GPIO_KM_OE); - writePinLow(GPIO_KM_PWEN); - if (!pc_num) writePinLow(GPIO_KM_SEL); - else writePinHigh(GPIO_KM_SEL); - writePinLow(GPIO_KM_OE); - - kvm_timer = timer_read(); - kvm_sel_on = true; -}; - -void keyboard_pre_init_user(void) { - setPinOutput(GPIO_KM_OE); // H/W power on default = 0 - setPinOutput(GPIO_KM_SEL); // H/W power on default = 0 - setPinOutput(GPIO_KM_PWEN); // H/W power on default = 1 -} - -void keyboard_post_init_user(void) { - user_config.raw = eeconfig_read_user(); // Read the user config from EEPROM - kvm_pc_sel = user_config.eeprom_kvm_pc_sel; - kvm_switch(kvm_pc_sel); - - Status_LED_Bright = user_config.eeprom_Status_LED_Bright; // 0 = 초기값, 1~5 = 50~250의 5단계 밝기 - if (Status_LED_Bright == 0) Status_LED_Bright = 5; -} +enum _layer { WIN_BASE = 0, WIN_FN, MAC_BASE, MAC_FN }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -152,220 +67,3 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { [MAC_FN] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI) } }; #endif // ENCODER_MAP_ENABLE -//----------------------------------------------------------------- -#define HCS(report) host_consumer_send(record->event.pressed ? report : 0); return false -#define HSS(report) host_system_send(record->event.pressed ? report : 0); return false - -static uint8_t mac_keycode[4] = {KC_LOPT, KC_ROPT, KC_LCMD, KC_RCMD}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - - switch (keycode) { - case INIT_3S: - if (record->event.pressed){ - INIT3S_timer = timer_read(); - INIT3S_on = true; - return false; - } - else{ - INIT3S_on = false; - return false; - } - break; - - case KC_SPOTLIGHT: - HCS(0x221); - case KC_DICTATION: - HCS(0xCF); - case KC_DO_NOT_DISTURB: - HSS(0x9B); - case KC_LOCK_SCREEN: - HCS(0x19E); - - case KC_LOPTN: - case KC_ROPTN: - case KC_LCMMD: - case KC_RCMMD: - if (record->event.pressed) { - register_code(mac_keycode[keycode - KC_LOPTN]); - } else { - unregister_code(mac_keycode[keycode - KC_LOPTN]); - } - return false; - - case KC_WIN_MODE: - set_single_persistent_default_layer(0); - isMacMode = false; - return false; - - case KC_MAC_MODE: - set_single_persistent_default_layer(2); - isMacMode = true; - return false; - - case KC_TMODE: - if (record->event.pressed) { - switch (get_highest_layer(layer_state|default_layer_state)) { - case 0: - case 1: - set_single_persistent_default_layer(2); - isMacMode = true; - - break; - case 2: - case 3: - default: - set_single_persistent_default_layer(0); - isMacMode = false; - } - } - return false; - - case KC_PC1: - if (record->event.pressed) { - if (kvm_pc_sel) { - kvm_pc_sel = 0; - kvm_switch(0); - - user_config.eeprom_kvm_pc_sel = kvm_pc_sel; - eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM - } - } - return false; - - case KC_PC2: - if (record->event.pressed) { - if (!kvm_pc_sel){ - kvm_pc_sel = 1; - kvm_switch(1); - - user_config.eeprom_kvm_pc_sel = kvm_pc_sel; - eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM - } - } - return false; - - case KC_TPC: - if (record->event.pressed) { - kvm_pc_sel = !kvm_pc_sel; - if (kvm_pc_sel) kvm_switch(1); - else kvm_switch(0); - user_config.eeprom_kvm_pc_sel = kvm_pc_sel; // - eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM - } - return false; - - case KC_S_LED: // Change Status LED Brightness - if (record->event.pressed) { - if (++Status_LED_Bright > 5) { - Status_LED_Bright = 1; - }; - user_config.eeprom_Status_LED_Bright = Status_LED_Bright; // - eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM - } - return false; - - default: - return true; // Process all other keycodes normally - } - return true; -} - -bool isRecording = false; // dynamic macro REC. LED -bool isRecordingLedOn = false; -static uint16_t recording_timer; - -void matrix_scan_user(void) { - - if (kvm_sel_on == true){ - if (timer_elapsed(kvm_timer) > kvm_deadtime ) { - writePinHigh(GPIO_KM_PWEN); - kvm_sel_on = false; //// 키보드 리셋이 필요? - } - } - - if (INIT3S_on == true){ - if (timer_elapsed(INIT3S_timer) > 3000){ - INIT3S_on = false; - INIT3S_led_on = true; - INIT3S_timer = timer_read(); - } - } - if (INIT3S_led_on == true){ - if(timer_elapsed(INIT3S_timer) > 2000){ - eeconfig_init(); - soft_reset_keyboard(); - } - } - - if (isRecording){ - if(timer_elapsed(recording_timer) > 500) - { - isRecordingLedOn = !isRecordingLedOn; - recording_timer = timer_read(); - } - } -} - -#ifdef DYNAMIC_MACRO_ENABLE -void dynamic_macro_record_start_user(int8_t direction) { - isRecording = true; - isRecordingLedOn = true; - recording_timer = timer_read(); -} -void dynamic_macro_record_end_user(int8_t direction){ - isRecording = false; - isRecordingLedOn = false; -} -#endif - -#ifdef RGB_MATRIX_ENABLE -bool rgb_matrix_indicators_user(void) { - - uint8_t Status_LED_Bright_value = Status_LED_Bright * 50; - - uint8_t layer = get_highest_layer(layer_state|default_layer_state); - - led_t host_leds = host_keyboard_led_state(); - - if (host_leds.caps_lock) { - rgb_matrix_set_color(72, Status_LED_Bright_value, Status_LED_Bright_value, Status_LED_Bright_value); - } - if (host_leds.scroll_lock) { - rgb_matrix_set_color(22, Status_LED_Bright_value, Status_LED_Bright_value, Status_LED_Bright_value); - } - - if (INIT3S_led_on == true){ // Factory Reset ; all LED is RED - rgb_matrix_set_color_all(0xff, 0, 0); - } - - if (keymap_config.no_gui){ // WIN key Lock - rgb_matrix_set_color(99, Status_LED_Bright_value, Status_LED_Bright_value, Status_LED_Bright_value); - } - - if (isRecordingLedOn) { // Dynamic Macro Recording LED Blink - rgb_matrix_set_color(38, Status_LED_Bright_value, Status_LED_Bright_value, Status_LED_Bright_value); - } - - switch (layer) { // LED for WIN(layer 0, 1) or MAC(layer 2, 3) - case 0: - case 1: - rgb_matrix_set_color(24,0,0,Status_LED_Bright_value); // WIN-MAC key - isMacMode = false; - - if (kvm_pc_sel) rgb_matrix_set_color(103,0,0,Status_LED_Bright_value); // Windows Mode & PC2 - else rgb_matrix_set_color(101,0,0,Status_LED_Bright_value); // Windows Mode & PC1 - break; - - case 2: - case 3: - rgb_matrix_set_color(24,Status_LED_Bright_value,0,0); // WIN-MAC key - isMacMode = true; - - if (kvm_pc_sel) rgb_matrix_set_color(103,Status_LED_Bright_value,0,0); // MAC Mode & PC2 - else rgb_matrix_set_color(101,Status_LED_Bright_value,0,0); // MAC Mode & PC1 - break; - } - return TRUE; -} -#endif diff --git a/keyboards/aplusx_pulsar/xboard_qs/rules.mk b/keyboards/aplusx_pulsar/xboard_qs/rules.mk deleted file mode 100644 index 6e7633bfe01..00000000000 --- a/keyboards/aplusx_pulsar/xboard_qs/rules.mk +++ /dev/null @@ -1 +0,0 @@ -# This file intentionally left blank From 71ac6a6b51a80a4fd46affbff09bcdfe8e0e8082 Mon Sep 17 00:00:00 2001 From: James yun Date: Tue, 2 Jul 2024 15:46:34 +0900 Subject: [PATCH 3/9] Modified by the teachings of "drashna" -2nd --- .../aplusx_pulsar/xboard_qs/keyboard.json | 327 ++++++++++++++++++ keyboards/aplusx_pulsar/xboard_qs/xboard_qs.c | 239 +++++++++++++ keyboards/aplusx_pulsar/xboard_qs/xboard_qs.h | 35 ++ 3 files changed, 601 insertions(+) create mode 100644 keyboards/aplusx_pulsar/xboard_qs/keyboard.json create mode 100644 keyboards/aplusx_pulsar/xboard_qs/xboard_qs.c create mode 100644 keyboards/aplusx_pulsar/xboard_qs/xboard_qs.h diff --git a/keyboards/aplusx_pulsar/xboard_qs/keyboard.json b/keyboards/aplusx_pulsar/xboard_qs/keyboard.json new file mode 100644 index 00000000000..3e6f0eee73b --- /dev/null +++ b/keyboards/aplusx_pulsar/xboard_qs/keyboard.json @@ -0,0 +1,327 @@ +{ + "keyboard_name": "Pulsar XBOARD QS", + "manufacturer": "Pulsar", + "url": "https://pulsargg.kr/", + "maintainer": "James Yun", + + "processor": "STM32F072", + "bootloader": "stm32-dfu", + + "usb": { + "vid": "0x3710", + "pid": "0x2400", + "device_version": "0.0.5" + }, + + "matrix_pins": { + "rows": ["A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7"], + "cols": ["C4", "C5", "B0", "B1", "B2", "B10", "B11", "B12", "B13", "B14", "A15", "C6", "C7", "C10", "C11", "C12"] + }, + "diode_direction": "ROW2COL", + "build": { + "lto": true + }, + "features": { + "bootmagic": true, + "extrakey": true, + "mousekey": true, + "nkro": true, + "encoder": true, + "rgb_matrix": true + }, + "bootmagic": { + "matrix": [2, 7] + }, + "eeprom": { + "wear_leveling": { + "backing_size": 4096 + } + }, + "encoder": { + "rotary": [ + {"pin_a": "C13", "pin_b": "C14"} + ] + }, + "rgb_matrix": { + "driver": "ws2812", + "default":{ + "val": 60 + }, + "sleep": true, + "max_brightness": 220, + "center_point": [80, 30], + "sat_steps": 8, + "speed_steps": 10, + "val_steps": 8, + "animations": { + "alphas_mods": true, + "gradient_up_down": true, + "gradient_left_right": true, + "breathing": true, + "band_sat": true, + "band_val": true, + "band_pinwheel_sat": true, + "band_pinwheel_val": true, + "band_spiral_sat": true, + "band_spiral_val": true, + "cycle_all": true, + "cycle_left_right": true, + "cycle_up_down": true, + "cycle_out_in": true, + "cycle_out_in_dual": true, + "rainbow_moving_chevron": true, + "cycle_pinwheel": true, + "cycle_spiral": true, + "dual_beacon": true, + "rainbow_beacon": true, + "rainbow_pinwheels": true, + "raindrops": true, + "jellybean_raindrops": true, + "hue_breathing": true, + "hue_pendulum": true, + "hue_wave": true, + "pixel_fractal": true, + "pixel_flow": true, + "pixel_rain": true, + "typing_heatmap": true, + "digital_rain": true, + "solid_reactive_simple": true, + "solid_reactive": true, + "solid_reactive_wide": true, + "solid_reactive_multiwide": true, + "solid_reactive_cross": true, + "solid_reactive_multicross": true, + "solid_reactive_nexus": true, + "solid_reactive_multinexus": true, + "splash": true, + "multisplash": true, + "solid_splash": true, + "solid_multisplash": true + }, + + "layout": [ + {"x": 0, "y": 0, "flags": 1}, + {"x": 9, "y": 0, "flags": 1}, + {"x": 18, "y": 0, "flags": 1}, + {"x": 27, "y": 0, "flags": 1}, + {"x": 36, "y": 0, "flags": 1}, + {"x": 45, "y": 0, "flags": 1}, + {"x": 54, "y": 0, "flags": 1}, + {"x": 63, "y": 0, "flags": 1}, + {"x": 72, "y": 0, "flags": 1}, + {"x": 81, "y": 0, "flags": 1}, + {"x": 90, "y": 0, "flags": 1}, + {"x": 99, "y": 0, "flags": 1}, + {"x": 108, "y": 0, "flags": 1}, + {"x": 117, "y": 0, "flags": 1}, + {"x": 126, "y": 0, "flags": 1}, + {"x": 135, "y": 0, "flags": 1}, + {"matrix": [6, 1], "x": 144, "y": 0, "flags": 1}, + {"matrix": [6, 2], "x": 153, "y": 0, "flags": 1}, + {"x": 162, "y": 0, "flags": 1}, + {"matrix": [6, 3], "x": 171, "y": 0, "flags": 1}, + {"x": 180, "y": 0, "flags": 1}, + {"matrix": [0, 15], "x": 180, "y": 11, "flags": 1}, + {"matrix": [0, 14], "x": 169, "y": 11, "flags": 1}, + {"matrix": [0, 13], "x": 159, "y": 11, "flags": 1}, + {"matrix": [6, 0], "x": 144, "y": 11, "flags": 1}, + {"matrix": [0, 12], "x": 133, "y": 11, "flags": 4}, + {"matrix": [0, 11], "x": 123, "y": 11, "flags": 4}, + {"matrix": [0, 10], "x": 112, "y": 11, "flags": 4}, + {"matrix": [0, 9], "x": 102, "y": 11, "flags": 4}, + {"matrix": [0, 8], "x": 89, "y": 11, "flags": 1}, + {"matrix": [0, 7], "x": 78, "y": 11, "flags": 1}, + {"matrix": [0, 6], "x": 68, "y": 11, "flags": 1}, + {"matrix": [0, 5], "x": 57, "y": 11, "flags": 1}, + {"matrix": [0, 4], "x": 45, "y": 11, "flags": 4}, + {"matrix": [0, 3], "x": 34, "y": 11, "flags": 4}, + {"matrix": [0, 2], "x": 24, "y": 11, "flags": 4}, + {"matrix": [0, 1], "x": 13, "y": 11, "flags": 4}, + {"matrix": [0, 0], "x": 0, "y": 11, "flags": 1}, + {"matrix": [1, 0], "x": 0, "y": 21, "flags": 4}, + {"matrix": [1, 1], "x": 10, "y": 21, "flags": 4}, + {"matrix": [1, 2], "x": 21, "y": 21, "flags": 4}, + {"matrix": [1, 3], "x": 31, "y": 21, "flags": 4}, + {"matrix": [1, 4], "x": 42, "y": 21, "flags": 4}, + {"matrix": [1, 5], "x": 52, "y": 21, "flags": 4}, + {"matrix": [1, 6], "x": 63, "y": 21, "flags": 4}, + {"matrix": [1, 7], "x": 73, "y": 21, "flags": 4}, + {"matrix": [1, 8], "x": 83, "y": 21, "flags": 4}, + {"matrix": [1, 9], "x": 94, "y": 21, "flags": 4}, + {"matrix": [1, 10], "x": 104, "y": 21, "flags": 4}, + {"matrix": [1, 11], "x": 115, "y": 21, "flags": 4}, + {"matrix": [1, 12], "x": 125, "y": 21, "flags": 4}, + {"matrix": [1, 14], "x": 139, "y": 21, "flags": 1}, + {"matrix": [2, 14], "x": 159, "y": 21, "flags": 1}, + {"matrix": [2, 15], "x": 169, "y": 21, "flags": 1}, + {"matrix": [1, 15], "x": 180, "y": 21, "flags": 1}, + {"matrix": [3, 15], "x": 180, "y": 32, "flags": 1}, + {"matrix": [3, 14], "x": 169, "y": 32, "flags": 1}, + {"matrix": [3, 13], "x": 159, "y": 32, "flags": 1}, + {"matrix": [2, 13], "x": 143, "y": 32, "flags": 4}, + {"matrix": [2, 12], "x": 130, "y": 32, "flags": 4}, + {"matrix": [2, 11], "x": 120, "y": 32, "flags": 4}, + {"matrix": [2, 10], "x": 109, "y": 32, "flags": 4}, + {"matrix": [2, 9], "x": 99, "y": 32, "flags": 4}, + {"matrix": [2, 8], "x": 89, "y": 32, "flags": 4}, + {"matrix": [2, 7], "x": 78, "y": 32, "flags": 4}, + {"matrix": [2, 6], "x": 68, "y": 32, "flags": 4}, + {"matrix": [2, 5], "x": 57, "y": 32, "flags": 4}, + {"matrix": [2, 4], "x": 47, "y": 32, "flags": 4}, + {"matrix": [2, 3], "x": 36, "y": 32, "flags": 4}, + {"matrix": [2, 2], "x": 26, "y": 32, "flags": 4}, + {"matrix": [2, 1], "x": 16, "y": 32, "flags": 4}, + {"matrix": [2, 0], "x": 3, "y": 32, "flags": 1}, + {"matrix": [3, 0], "x": 4, "y": 43, "flags": 1}, + {"matrix": [3, 1], "x": 18, "y": 43, "flags": 4}, + {"matrix": [3, 2], "x": 29, "y": 43, "flags": 4}, + {"matrix": [3, 3], "x": 39, "y": 43, "flags": 4}, + {"matrix": [3, 4], "x": 50, "y": 43, "flags": 4}, + {"matrix": [3, 5], "x": 60, "y": 43, "flags": 4}, + {"matrix": [3, 6], "x": 70, "y": 43, "flags": 4}, + {"matrix": [3, 7], "x": 81, "y": 43, "flags": 4}, + {"matrix": [3, 8], "x": 91, "y": 43, "flags": 4}, + {"matrix": [3, 9], "x": 102, "y": 43, "flags": 4}, + {"matrix": [3, 10], "x": 112, "y": 43, "flags": 4}, + {"matrix": [3, 11], "x": 123, "y": 43, "flags": 4}, + {"matrix": [4, 14], "x": 138, "y": 43, "flags": 1}, + {"matrix": [4, 15], "x": 169, "y": 53, "flags": 1}, + {"matrix": [4, 13], "x": 135, "y": 53, "flags": 1}, + {"matrix": [4, 11], "x": 117, "y": 53, "flags": 4}, + {"matrix": [4, 10], "x": 107, "y": 53, "flags": 4}, + {"matrix": [4, 9], "x": 96, "y": 53, "flags": 4}, + {"matrix": [4, 8], "x": 86, "y": 53, "flags": 4}, + {"matrix": [4, 7], "x": 76, "y": 53, "flags": 4}, + {"matrix": [4, 6], "x": 65, "y": 53, "flags": 4}, + {"matrix": [4, 5], "x": 55, "y": 53, "flags": 4}, + {"matrix": [4, 4], "x": 44, "y": 53, "flags": 4}, + {"matrix": [4, 3], "x": 34, "y": 53, "flags": 4}, + {"matrix": [4, 2], "x": 23, "y": 53, "flags": 4}, + {"matrix": [4, 0], "x": 10, "y": 53, "flags": 1}, + {"matrix": [5, 0], "x": 1, "y": 64, "flags": 1}, + {"matrix": [5, 1], "x": 14, "y": 64, "flags": 1}, + {"matrix": [5, 2], "x": 27, "y": 64, "flags": 1}, + {"x": 50, "y": 64, "flags": 4}, + {"matrix": [5, 6], "x": 66, "y": 64, "flags": 4}, + {"x": 80, "y": 64, "flags": 4}, + {"matrix": [5, 10], "x": 105, "y": 64, "flags": 1}, + {"matrix": [5, 11], "x": 118, "y": 64, "flags": 1}, + {"matrix": [5, 12], "x": 131, "y": 64, "flags": 1}, + {"matrix": [5, 13], "x": 145, "y": 64, "flags": 1}, + {"matrix": [5, 14], "x": 159, "y": 64, "flags": 1}, + {"matrix": [5, 15], "x": 169, "y": 64, "flags": 1}, + {"matrix": [6, 15], "x": 180, "y": 64, "flags": 1} + ] +}, + + "ws2812": { + "pin": "B15", + "driver": "spi" + }, + + "layouts": { + "LAYOUT": { + "layout": [ + { "matrix":[6,1],"label": "PC1", "x": 14.05, "y": 0 }, + { "matrix":[6,2],"label": "PC2", "x": 15.3, "y": 0 }, + { "matrix":[6,3],"label": "Audio", "x": 17, "y": 0 }, + + { "matrix":[0,0], "label": "Esc", "x": 0, "y": 1.3 }, + { "matrix":[0,1], "label": "F1", "x": 1.3, "y": 1.3 }, + { "matrix":[0,2], "label": "F2", "x": 2.3, "y": 1.3 }, + { "matrix":[0,3], "label": "F3", "x": 3.3, "y": 1.3 }, + { "matrix":[0,4], "label": "F4", "x": 4.3, "y": 1.3 }, + { "matrix":[0,5], "label": "F5", "x": 5.55, "y": 1.3 }, + { "matrix":[0,6], "label": "F6", "x": 6.55, "y": 1.3 }, + { "matrix":[0,7], "label": "F7", "x": 7.55, "y": 1.3 }, + { "matrix":[0,8], "label": "F8", "x": 8.55, "y": 1.3 }, + { "matrix":[0,9], "label": "F9", "x": 9.8, "y": 1.3 }, + { "matrix":[0,10], "label": "F10", "x": 10.8, "y": 1.3 }, + { "matrix":[0,11], "label": "F11", "x": 11.8, "y": 1.3 }, + { "matrix":[0,12], "label": "F12", "x": 12.8, "y": 1.3 }, + + { "matrix":[6,0], "label": "QUICK", "x": 14.05, "y": 1.3 }, + + { "matrix":[0,13], "label": "PrtSc", "x": 15.3, "y": 1.3 }, + { "matrix":[0,14], "label": "Scroll Lock", "x": 16.3, "y": 1.3 }, + { "matrix":[0,15], "label": "Pause", "x": 17.3, "y": 1.3 }, + + { "matrix":[1,0], "label": "~", "x": 0, "y": 2.5 }, + { "matrix":[1,1], "label": "!", "x": 1, "y": 2.5 }, + { "matrix":[1,2], "label": "@", "x": 2, "y": 2.5 }, + { "matrix":[1,3], "label": "#", "x": 3, "y": 2.5 }, + { "matrix":[1,4], "label": "$", "x": 4, "y": 2.5 }, + { "matrix":[1,5], "label": "%", "x": 5, "y": 2.5 }, + { "matrix":[1,6], "label": "^", "x": 6, "y": 2.5 }, + { "matrix":[1,7], "label": "&", "x": 7, "y": 2.5 }, + { "matrix":[1,8], "label": "*", "x": 8, "y": 2.5 }, + { "matrix":[1,9], "label": "(", "x": 9, "y": 2.5 }, + { "matrix":[1,10], "label": ")", "x": 10, "y": 2.5 }, + { "matrix":[1,11], "label": "_", "x": 11, "y": 2.5 }, + { "matrix":[1,12], "label": "+", "x": 12, "y": 2.5 }, + { "matrix":[1,14], "label": "Backspace", "x": 13, "y": 2.5, "w": 2 }, + { "matrix":[2,14], "label": "Insert", "x": 15.25, "y": 2.5 }, + { "matrix":[2,15], "label": "Home", "x": 16.25, "y": 2.5 }, + { "matrix":[1,15], "label": "PgUp", "x": 17.25, "y": 2.5 }, + + { "matrix":[2,0], "label": "Tab", "x": 0, "y": 3.5, "w": 1.5 }, + { "matrix":[2,1], "label": "Q", "x": 1.5, "y": 3.5 }, + { "matrix":[2,2], "label": "W", "x": 2.5, "y": 3.5 }, + { "matrix":[2,3], "label": "E", "x": 3.5, "y": 3.5 }, + { "matrix":[2,4], "label": "R", "x": 4.5, "y": 3.5 }, + { "matrix":[2,5], "label": "T", "x": 5.5, "y": 3.5 }, + { "matrix":[2,6], "label": "Y", "x": 6.5, "y": 3.5 }, + { "matrix":[2,7], "label": "U", "x": 7.5, "y": 3.5 }, + { "matrix":[2,8], "label": "I", "x": 8.5, "y": 3.5 }, + { "matrix":[2,9], "label": "O", "x": 9.5, "y": 3.5 }, + { "matrix":[2,10], "label": "P", "x": 10.5, "y": 3.5 }, + { "matrix":[2,11], "label": "{", "x": 11.5, "y": 3.5 }, + { "matrix":[2,12], "label": "}", "x": 12.5, "y": 3.5 }, + { "matrix":[2,13], "label": "|", "x": 13.5, "y": 3.5, "w": 1.5 }, + { "matrix":[3,13], "label": "Delete", "x": 15.25, "y": 3.5 }, + { "matrix":[3,14], "label": "End", "x": 16.25, "y": 3.5 }, + { "matrix":[3,15], "label": "PgDn", "x": 17.25, "y": 3.5 }, + + { "matrix":[3,0], "label": "Caps Lock", "x": 0, "y": 4.5, "w": 1.75 }, + { "matrix":[3,1], "label": "A", "x": 1.75, "y": 4.5 }, + { "matrix":[3,2], "label": "S", "x": 2.75, "y": 4.5 }, + { "matrix":[3,3], "label": "D", "x": 3.75, "y": 4.5 }, + { "matrix":[3,4], "label": "F", "x": 4.75, "y": 4.5 }, + { "matrix":[3,5], "label": "G", "x": 5.75, "y": 4.5 }, + { "matrix":[3,6], "label": "H", "x": 6.75, "y": 4.5 }, + { "matrix":[3,7], "label": "J", "x": 7.75, "y": 4.5 }, + { "matrix":[3,8], "label": "K", "x": 8.75, "y": 4.5 }, + { "matrix":[3,9], "label": "L", "x": 9.75, "y": 4.5 }, + { "matrix":[3,10], "label": ":", "x": 10.75, "y": 4.5 }, + { "matrix":[3,11], "label": "\"", "x": 11.75, "y": 4.5 }, + { "matrix":[4,14], "label": "Enter", "x": 12.75, "y": 4.5, "w": 2.25 }, + + { "matrix":[4,0], "label": "Shift", "x": 0, "y": 5.5, "w": 2.25 }, + { "matrix":[4,2], "label": "Z", "x": 2.25, "y": 5.5 }, + { "matrix":[4,3], "label": "X", "x": 3.25, "y": 5.5 }, + { "matrix":[4,4], "label": "C", "x": 4.25, "y": 5.5 }, + { "matrix":[4,5], "label": "V", "x": 5.25, "y": 5.5 }, + { "matrix":[4,6], "label": "B", "x": 6.25, "y": 5.5 }, + { "matrix":[4,7], "label": "N", "x": 7.25, "y": 5.5 }, + { "matrix":[4,8], "label": "M", "x": 8.25, "y": 5.5 }, + { "matrix":[4,9], "label": "<", "x": 9.25, "y": 5.5 }, + { "matrix":[4,10], "label": ">", "x": 10.25, "y": 5.5 }, + { "matrix":[4,11], "label": "?", "x": 11.25, "y": 5.5 }, + { "matrix":[4,13], "label": "Shift", "x": 12.25, "y": 5.5, "w": 2.75 }, + { "matrix":[4,15], "label": "Up", "x": 16.25, "y": 5.5 }, + + { "matrix":[5,0], "label": "Ctrl", "x": 0, "y": 6.5, "w": 1.25 }, + { "matrix":[5,1], "label": "Win", "x": 1.25, "y": 6.5, "w": 1.25 }, + { "matrix":[5,2], "label": "Alt", "x": 2.5, "y": 6.5, "w": 1.25 }, + { "matrix":[5,6], "label": "Space","x": 3.75, "y": 6.5, "w": 6.25 }, + { "matrix":[5,10], "label": "Alt", "x": 10, "y": 6.5, "w": 1.25 }, + { "matrix":[5,11], "label": "Fn", "x": 11.25, "y": 6.5, "w": 1.25 }, + { "matrix":[5,12], "label": "Menu", "x": 12.5, "y": 6.5, "w": 1.25 }, + { "matrix":[5,13], "label": "Ctrl", "x": 13.75, "y": 6.5, "w": 1.25 }, + { "matrix":[5,14], "label": "Left", "x": 15.25, "y": 6.5 }, + { "matrix":[5,15], "label": "Down", "x": 16.25, "y": 6.5 }, + { "matrix":[6,15], "label": "Right", "x": 17.25, "y": 6.5 } + ] + } + } +} diff --git a/keyboards/aplusx_pulsar/xboard_qs/xboard_qs.c b/keyboards/aplusx_pulsar/xboard_qs/xboard_qs.c new file mode 100644 index 00000000000..a85052d76a9 --- /dev/null +++ b/keyboards/aplusx_pulsar/xboard_qs/xboard_qs.c @@ -0,0 +1,239 @@ +#include QMK_KEYBOARD_H + +#include "xboard_qs.h" + +static bool INIT3S_on = false; +static bool INIT3S_led_on = false; +static uint16_t INIT3S_timer; // for custom key, INIT_3S + +static bool kvm_pc_sel = false; +static uint16_t kvm_timer; +static bool kvm_sel_on = false; + +static bool isMacMode = false; +static uint8_t Status_LED_Bright; +#define kvm_deadtime 100 + +typedef union { + uint32_t raw; + struct { + bool eeprom_kvm_pc_sel :1; + uint8_t eeprom_Status_LED_Bright; // + }; +} user_config_t; + +user_config_t user_config; + +void kvm_switch(bool pc_num){ + writePinHigh(GPIO_KM_OE); + writePinLow(GPIO_KM_PWEN); + if (!pc_num) writePinLow(GPIO_KM_SEL); + else writePinHigh(GPIO_KM_SEL); + writePinLow(GPIO_KM_OE); + + kvm_timer = timer_read(); + kvm_sel_on = true; +}; + +void keyboard_pre_init_kb(void) { + setPinOutput(GPIO_KM_OE); // H/W power on default = 0 + setPinOutput(GPIO_KM_SEL); // H/W power on default = 0 + setPinOutput(GPIO_KM_PWEN); // H/W power on default = 1 +} + +void keyboard_post_init_kb(void) { + user_config.raw = eeconfig_read_user(); // Read the user config from EEPROM + kvm_pc_sel = user_config.eeprom_kvm_pc_sel; + kvm_switch(kvm_pc_sel); + + Status_LED_Bright = user_config.eeprom_Status_LED_Bright; // 0 = 초기값, 1~5 = 50~250의 5단계 밝기 + if (Status_LED_Bright == 0) Status_LED_Bright = 5; +} + +#define HCS(report) host_consumer_send(record->event.pressed ? report : 0); return false +#define HSS(report) host_system_send(record->event.pressed ? report : 0); return false + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + if (!process_record_user(keycode, record)) { return false; } + switch (keycode) { + case INIT_3S: + if (record->event.pressed){ + INIT3S_timer = timer_read(); + INIT3S_on = true; + } + else{ + INIT3S_on = false; + } + break; + + case KC_SPOTLIGHT: + HCS(0x221); + case KC_DICTATION: + HCS(0xCF); + case KC_DO_NOT_DISTURB: + HSS(0x9B); + case KC_LOCK_SCREEN: + HCS(0x19E); + + case KC_WIN_MODE: + set_single_persistent_default_layer(0); + isMacMode = false; + return false; + + case KC_MAC_MODE: + set_single_persistent_default_layer(2); + isMacMode = true; + return false; + + case KC_TMODE: + if (record->event.pressed) { + if (get_highest_layer(layer_state|default_layer_state) >= 2) { + set_single_persistent_default_layer(2); + isMacMode = true; + } else { + set_single_persistent_default_layer(0); + isMacMode = false; + } + } + return false; + + case KC_PC1: + if (record->event.pressed) { + if (kvm_pc_sel) { + kvm_pc_sel = 0; + kvm_switch(0); + + user_config.eeprom_kvm_pc_sel = kvm_pc_sel; + eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM + } + } + return false; + + case KC_PC2: + if (record->event.pressed) { + if (!kvm_pc_sel){ + kvm_pc_sel = 1; + kvm_switch(1); + + user_config.eeprom_kvm_pc_sel = kvm_pc_sel; + eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM + } + } + return false; + + case KC_TPC: + if (record->event.pressed) { + kvm_pc_sel = !kvm_pc_sel; + if (kvm_pc_sel) kvm_switch(1); + else kvm_switch(0); + user_config.eeprom_kvm_pc_sel = kvm_pc_sel; // + eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM + } + return false; + + case KC_S_LED: // Change Status LED Brightness + if (record->event.pressed) { + if (++Status_LED_Bright > 5) { + Status_LED_Bright = 1; + }; + user_config.eeprom_Status_LED_Bright = Status_LED_Bright; // + eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM + } + return false; + + default: + return true; // Process all other keycodes normally + } + return true; +} + +bool isRecording = false; // dynamic macro REC. LED +bool isRecordingLedOn = false; +static uint16_t recording_timer; + +void matrix_scan_kb(void) { + + if (kvm_sel_on == true){ + if (timer_elapsed(kvm_timer) > kvm_deadtime ) { + writePinHigh(GPIO_KM_PWEN); + kvm_sel_on = false; //// 키보드 리셋이 필요? + } + } + + if (INIT3S_on == true){ + if (timer_elapsed(INIT3S_timer) > 3000){ + INIT3S_on = false; + INIT3S_led_on = true; + INIT3S_timer = timer_read(); + } + } + if (INIT3S_led_on == true){ + if(timer_elapsed(INIT3S_timer) > 2000){ + eeconfig_init(); + soft_reset_keyboard(); + } + } + + if (isRecording){ + if(timer_elapsed(recording_timer) > 500) + { + isRecordingLedOn = !isRecordingLedOn; + recording_timer = timer_read(); + } + } +} + +#ifdef DYNAMIC_MACRO_ENABLE +void dynamic_macro_record_start_kb(int8_t direction) { + isRecording = true; + isRecordingLedOn = true; + recording_timer = timer_read(); +} +void dynamic_macro_record_end_kb(int8_t direction){ + isRecording = false; + isRecordingLedOn = false; +} +#endif + +bool rgb_matrix_indicators_kb(void) { + + uint8_t Status_LED_Bright_value = Status_LED_Bright * 50; + + led_t host_leds = host_keyboard_led_state(); + + if (host_leds.caps_lock) { + rgb_matrix_set_color(72, Status_LED_Bright_value, Status_LED_Bright_value, Status_LED_Bright_value); + } + if (host_leds.scroll_lock) { + rgb_matrix_set_color(22, Status_LED_Bright_value, Status_LED_Bright_value, Status_LED_Bright_value); + } + + if (INIT3S_led_on == true){ // Factory Reset ; all LED is RED + rgb_matrix_set_color_all(0xff, 0, 0); + } + + if (keymap_config.no_gui){ // WIN key Lock + rgb_matrix_set_color(99, Status_LED_Bright_value, Status_LED_Bright_value, Status_LED_Bright_value); + } + + if (isRecordingLedOn) { // Dynamic Macro Recording LED Blink + rgb_matrix_set_color(38, Status_LED_Bright_value, Status_LED_Bright_value, Status_LED_Bright_value); + } + + if (get_highest_layer(layer_state|default_layer_state) >= 2) { + rgb_matrix_set_color(24,Status_LED_Bright_value,0,0); // WIN-MAC key + isMacMode = true; + + if (kvm_pc_sel) rgb_matrix_set_color(103,Status_LED_Bright_value,0,0); // MAC Mode & PC2 + else rgb_matrix_set_color(101,Status_LED_Bright_value,0,0); // MAC Mode & PC1 + + } else { + rgb_matrix_set_color(24,0,0,Status_LED_Bright_value); // WIN-MAC key + isMacMode = false; + + if (kvm_pc_sel) rgb_matrix_set_color(103,0,0,Status_LED_Bright_value); // Windows Mode & PC2 + else rgb_matrix_set_color(101,0,0,Status_LED_Bright_value); // Windows Mode & PC1 + } + + return false; // return TRUE; +} diff --git a/keyboards/aplusx_pulsar/xboard_qs/xboard_qs.h b/keyboards/aplusx_pulsar/xboard_qs/xboard_qs.h new file mode 100644 index 00000000000..e9783a7ac14 --- /dev/null +++ b/keyboards/aplusx_pulsar/xboard_qs/xboard_qs.h @@ -0,0 +1,35 @@ +#pragma once + +#include "quantum.h" + +enum pulsar_keycodes { + KC_TGUI = QK_KB_0, // Ver 0.21.6에서 변경 (USER00,) // Toggle between GUI Lock or Unlock + KC_WIN_MODE, // WINDOWS Keyboard로 변경 + KC_MAC_MODE, // Machintosh Keyboard로 변경 + KC_TMODE, // WINDOWS <--> Machintosh + KC_SPOTLIGHT, // MAC_key + KC_DICTATION, // MAC_key + KC_DO_NOT_DISTURB, // MAC_key + KC_LOCK_SCREEN, // MAC_key + KC_TASK_VIEW, // for win (gui + tap) + KC_FILE_EXPLORER, // for win (gui + e) + KC_PC1, // KM Switch PC1 + KC_PC2, // KM Switch PC2 + KC_TPC, // KM Switch PC1<-->PC2 Toggle + INIT_3S, // EE_CLR(EEPROM CLear)(공장초기화)를 3초이상 눌러야 동작 + KC_S_LED, // Change Status LED Brightness +}; + +#define KC_WINM KC_WIN_MODE +#define KC_MACM KC_MAC_MODE + +#define KC_SPLT KC_SPOTLIGHT +#define KC_SIRI KC_DICTATION +#define KC_DOND KC_DO_NOT_DISTURB +#define KC_LOCK_ KC_LOCK_SCREEN + +#define KC_TASK LGUI(KC_TAB) +#define KC_FLXP LGUI(KC_E) +#define KC_DIC LGUI(KC_H) // WIN ; 받아쓰기 +#define KC_LOCK2 LGUI(KC_L) // WIN ; pc잠금 +#define KC_SNAP SCMD(KC_5) // MAC Capure ; commnd + shift + 5 From 970fa98245e3187d50b84405e2223f7682cc7b32 Mon Sep 17 00:00:00 2001 From: James yun Date: Tue, 2 Jul 2024 16:50:02 +0900 Subject: [PATCH 4/9] add the missing license header --- keyboards/aplusx_pulsar/xboard_qs/xboard_qs.c | 16 ++++++++++++++++ keyboards/aplusx_pulsar/xboard_qs/xboard_qs.h | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/keyboards/aplusx_pulsar/xboard_qs/xboard_qs.c b/keyboards/aplusx_pulsar/xboard_qs/xboard_qs.c index a85052d76a9..62d1f3e16ed 100644 --- a/keyboards/aplusx_pulsar/xboard_qs/xboard_qs.c +++ b/keyboards/aplusx_pulsar/xboard_qs/xboard_qs.c @@ -1,3 +1,19 @@ +/* Copyright 2024 Aplusx Inc. + * + * 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 "xboard_qs.h" diff --git a/keyboards/aplusx_pulsar/xboard_qs/xboard_qs.h b/keyboards/aplusx_pulsar/xboard_qs/xboard_qs.h index e9783a7ac14..7314039b201 100644 --- a/keyboards/aplusx_pulsar/xboard_qs/xboard_qs.h +++ b/keyboards/aplusx_pulsar/xboard_qs/xboard_qs.h @@ -1,3 +1,19 @@ +/* Copyright 2024 Aplusx Inc. + * + * 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" From 4cde4faed31f9356fdb382819ab02cfa47251604 Mon Sep 17 00:00:00 2001 From: James yun <111858513+skylupin03@users.noreply.github.com> Date: Fri, 12 Jul 2024 14:34:29 +0900 Subject: [PATCH 5/9] Update keyboards/aplusx_pulsar/xboard_qs/keymaps/via/keymap.c Co-authored-by: Drashna Jaelre --- keyboards/aplusx_pulsar/xboard_qs/keymaps/via/keymap.c | 1 - 1 file changed, 1 deletion(-) diff --git a/keyboards/aplusx_pulsar/xboard_qs/keymaps/via/keymap.c b/keyboards/aplusx_pulsar/xboard_qs/keymaps/via/keymap.c index fe347916d79..022f95544c0 100644 --- a/keyboards/aplusx_pulsar/xboard_qs/keymaps/via/keymap.c +++ b/keyboards/aplusx_pulsar/xboard_qs/keymaps/via/keymap.c @@ -16,7 +16,6 @@ #include QMK_KEYBOARD_H -#include "xboard_qs.h" enum _layer { WIN_BASE = 0, WIN_FN, MAC_BASE, MAC_FN }; From 760b2579e3d3111b81df1f0878aafdc089cf5b1f Mon Sep 17 00:00:00 2001 From: skylupin03 Date: Mon, 15 Jul 2024 12:55:46 +0900 Subject: [PATCH 6/9] Modified by the teachings of "drashna" - 24.07.15 --- .../xboard_qs/keymaps/default/keymap.c | 7 ++- .../xboard_qs/keymaps/via/keymap.c | 8 ++- keyboards/aplusx_pulsar/xboard_qs/mcuconf.h | 2 - keyboards/aplusx_pulsar/xboard_qs/xboard_qs.c | 51 ++++++++++--------- 4 files changed, 38 insertions(+), 30 deletions(-) diff --git a/keyboards/aplusx_pulsar/xboard_qs/keymaps/default/keymap.c b/keyboards/aplusx_pulsar/xboard_qs/keymaps/default/keymap.c index 7c737d6a26b..852120e18ce 100644 --- a/keyboards/aplusx_pulsar/xboard_qs/keymaps/default/keymap.c +++ b/keyboards/aplusx_pulsar/xboard_qs/keymaps/default/keymap.c @@ -16,7 +16,12 @@ #include QMK_KEYBOARD_H -enum _layer { WIN_BASE = 0, WIN_FN, MAC_BASE, MAC_FN }; +enum _layer { + WIN_BASE, + WIN_FN, + MAC_BASE, + MAC_FN, +}; #define KC_TASK LGUI(KC_TAB) #define KC_DIC LGUI(KC_H) // WIN ; 받아쓰기 diff --git a/keyboards/aplusx_pulsar/xboard_qs/keymaps/via/keymap.c b/keyboards/aplusx_pulsar/xboard_qs/keymaps/via/keymap.c index 022f95544c0..685bcaa6cc0 100644 --- a/keyboards/aplusx_pulsar/xboard_qs/keymaps/via/keymap.c +++ b/keyboards/aplusx_pulsar/xboard_qs/keymaps/via/keymap.c @@ -16,8 +16,12 @@ #include QMK_KEYBOARD_H - -enum _layer { WIN_BASE = 0, WIN_FN, MAC_BASE, MAC_FN }; +enum _layer { + WIN_BASE, + WIN_FN, + MAC_BASE, + MAC_FN, +}; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/aplusx_pulsar/xboard_qs/mcuconf.h b/keyboards/aplusx_pulsar/xboard_qs/mcuconf.h index 62cddd050d8..285823109f1 100644 --- a/keyboards/aplusx_pulsar/xboard_qs/mcuconf.h +++ b/keyboards/aplusx_pulsar/xboard_qs/mcuconf.h @@ -34,5 +34,3 @@ #define STM32_PLLMUL_VALUE 4 #undef STM32_USBSW #define STM32_USBSW STM32_USBSW_PCLK -#undef STM32_ST_USE_TIMER -#define STM32_ST_USE_TIMER 2 diff --git a/keyboards/aplusx_pulsar/xboard_qs/xboard_qs.c b/keyboards/aplusx_pulsar/xboard_qs/xboard_qs.c index 62d1f3e16ed..f4b6c47450e 100644 --- a/keyboards/aplusx_pulsar/xboard_qs/xboard_qs.c +++ b/keyboards/aplusx_pulsar/xboard_qs/xboard_qs.c @@ -14,8 +14,6 @@ * along with this program. If not, see . */ -#include QMK_KEYBOARD_H - #include "xboard_qs.h" static bool INIT3S_on = false; @@ -36,33 +34,33 @@ typedef union { bool eeprom_kvm_pc_sel :1; uint8_t eeprom_Status_LED_Bright; // }; -} user_config_t; +} keyboard_config_t; -user_config_t user_config; +keyboard_config_t keyboard_config; void kvm_switch(bool pc_num){ - writePinHigh(GPIO_KM_OE); - writePinLow(GPIO_KM_PWEN); - if (!pc_num) writePinLow(GPIO_KM_SEL); - else writePinHigh(GPIO_KM_SEL); - writePinLow(GPIO_KM_OE); + gpio_write_pin_high(GPIO_KM_OE); + gpio_write_pin_low(GPIO_KM_PWEN); + if (!pc_num) gpio_write_pin_low(GPIO_KM_SEL); + else gpio_write_pin_high(GPIO_KM_SEL); + gpio_write_pin_low(GPIO_KM_OE); kvm_timer = timer_read(); kvm_sel_on = true; }; void keyboard_pre_init_kb(void) { - setPinOutput(GPIO_KM_OE); // H/W power on default = 0 - setPinOutput(GPIO_KM_SEL); // H/W power on default = 0 - setPinOutput(GPIO_KM_PWEN); // H/W power on default = 1 + gpio_set_pin_output(GPIO_KM_OE); // H/W power on default = 0 + gpio_set_pin_output(GPIO_KM_SEL); // H/W power on default = 0 + gpio_set_pin_output(GPIO_KM_PWEN); // H/W power on default = 1 } void keyboard_post_init_kb(void) { - user_config.raw = eeconfig_read_user(); // Read the user config from EEPROM - kvm_pc_sel = user_config.eeprom_kvm_pc_sel; + keyboard_config.raw = eeconfig_read_kb(); // Read the config from EEPROM + kvm_pc_sel = keyboard_config.eeprom_kvm_pc_sel; kvm_switch(kvm_pc_sel); - Status_LED_Bright = user_config.eeprom_Status_LED_Bright; // 0 = 초기값, 1~5 = 50~250의 5단계 밝기 + Status_LED_Bright = keyboard_config.eeprom_Status_LED_Bright; // 0 = 초기값, 1~5 = 50~250의 5단계 밝기 if (Status_LED_Bright == 0) Status_LED_Bright = 5; } @@ -119,8 +117,8 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { kvm_pc_sel = 0; kvm_switch(0); - user_config.eeprom_kvm_pc_sel = kvm_pc_sel; - eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM + keyboard_config.eeprom_kvm_pc_sel = kvm_pc_sel; + eeconfig_update_kb(keyboard_config.raw); // Writes the new status to EEPROM } } return false; @@ -131,8 +129,8 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { kvm_pc_sel = 1; kvm_switch(1); - user_config.eeprom_kvm_pc_sel = kvm_pc_sel; - eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM + keyboard_config.eeprom_kvm_pc_sel = kvm_pc_sel; + eeconfig_update_kb(keyboard_config.raw); // Writes the new status to EEPROM } } return false; @@ -142,8 +140,8 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { kvm_pc_sel = !kvm_pc_sel; if (kvm_pc_sel) kvm_switch(1); else kvm_switch(0); - user_config.eeprom_kvm_pc_sel = kvm_pc_sel; // - eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM + keyboard_config.eeprom_kvm_pc_sel = kvm_pc_sel; // + eeconfig_update_kb(keyboard_config.raw); // Writes the new status to EEPROM } return false; @@ -152,8 +150,8 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { if (++Status_LED_Bright > 5) { Status_LED_Bright = 1; }; - user_config.eeprom_Status_LED_Bright = Status_LED_Bright; // - eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM + keyboard_config.eeprom_Status_LED_Bright = Status_LED_Bright; // + eeconfig_update_kb(keyboard_config.raw); // Writes the new status to EEPROM } return false; @@ -167,11 +165,11 @@ bool isRecording = false; // dynamic macro REC. LED bool isRecordingLedOn = false; static uint16_t recording_timer; -void matrix_scan_kb(void) { +void housekeeping_task_kb(void) { if (kvm_sel_on == true){ if (timer_elapsed(kvm_timer) > kvm_deadtime ) { - writePinHigh(GPIO_KM_PWEN); + gpio_write_pin_high(GPIO_KM_PWEN); kvm_sel_on = false; //// 키보드 리셋이 필요? } } @@ -212,6 +210,9 @@ void dynamic_macro_record_end_kb(int8_t direction){ #endif bool rgb_matrix_indicators_kb(void) { + if (!rgb_matrix_indicators_user()) { + return false; + } uint8_t Status_LED_Bright_value = Status_LED_Bright * 50; From 9f8943313f1d6069364aa52b3358fe3c533e8120 Mon Sep 17 00:00:00 2001 From: skylupin03 Date: Mon, 15 Jul 2024 16:50:33 +0900 Subject: [PATCH 7/9] Modified by the teachings of "drashna" - 24.07.15(2nd) --- .../aplusx_pulsar/xboard_qs/keymaps/via/keymap.c | 2 +- keyboards/aplusx_pulsar/xboard_qs/xboard_qs.c | 12 +++++++----- keyboards/aplusx_pulsar/xboard_qs/xboard_qs.h | 6 ++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/keyboards/aplusx_pulsar/xboard_qs/keymaps/via/keymap.c b/keyboards/aplusx_pulsar/xboard_qs/keymaps/via/keymap.c index 685bcaa6cc0..2b914e44348 100644 --- a/keyboards/aplusx_pulsar/xboard_qs/keymaps/via/keymap.c +++ b/keyboards/aplusx_pulsar/xboard_qs/keymaps/via/keymap.c @@ -45,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [MAC_BASE] = LAYOUT( /* Layer 2 ; MAC Base Layer */ KC_PC1, KC_PC2, KC_MUTE, - KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_SPLT, KC_SIRI, KC_DOND, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE,KC_VOLD,KC_VOLU, KC_TMODE, KC_SNAP,KC_LPAD,KC_LOCK_, + KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_WSCH, KC_SIRI, KC_DOND, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE,KC_VOLD,KC_VOLU, KC_TMODE, KC_SNAP,KC_LPAD,KC_LOCK_, 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_INS, KC_HOME, KC_PGUP, 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_DEL, KC_END, KC_PGDN, 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, diff --git a/keyboards/aplusx_pulsar/xboard_qs/xboard_qs.c b/keyboards/aplusx_pulsar/xboard_qs/xboard_qs.c index f4b6c47450e..797b28fd496 100644 --- a/keyboards/aplusx_pulsar/xboard_qs/xboard_qs.c +++ b/keyboards/aplusx_pulsar/xboard_qs/xboard_qs.c @@ -47,12 +47,14 @@ void kvm_switch(bool pc_num){ kvm_timer = timer_read(); kvm_sel_on = true; -}; +} void keyboard_pre_init_kb(void) { gpio_set_pin_output(GPIO_KM_OE); // H/W power on default = 0 gpio_set_pin_output(GPIO_KM_SEL); // H/W power on default = 0 gpio_set_pin_output(GPIO_KM_PWEN); // H/W power on default = 1 + + keyboard_pre_init_user(); } void keyboard_post_init_kb(void) { @@ -62,6 +64,8 @@ void keyboard_post_init_kb(void) { Status_LED_Bright = keyboard_config.eeprom_Status_LED_Bright; // 0 = 초기값, 1~5 = 50~250의 5단계 밝기 if (Status_LED_Bright == 0) Status_LED_Bright = 5; + + keyboard_post_init_user(); } #define HCS(report) host_consumer_send(record->event.pressed ? report : 0); return false @@ -80,8 +84,6 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { } break; - case KC_SPOTLIGHT: - HCS(0x221); case KC_DICTATION: HCS(0xCF); case KC_DO_NOT_DISTURB: @@ -198,12 +200,12 @@ void housekeeping_task_kb(void) { } #ifdef DYNAMIC_MACRO_ENABLE -void dynamic_macro_record_start_kb(int8_t direction) { +__attribute__((weak)) void dynamic_macro_record_start_user(int8_t direction) { isRecording = true; isRecordingLedOn = true; recording_timer = timer_read(); } -void dynamic_macro_record_end_kb(int8_t direction){ +__attribute__((weak)) void dynamic_macro_record_end_user(int8_t direction) { isRecording = false; isRecordingLedOn = false; } diff --git a/keyboards/aplusx_pulsar/xboard_qs/xboard_qs.h b/keyboards/aplusx_pulsar/xboard_qs/xboard_qs.h index 7314039b201..f205b786e9d 100644 --- a/keyboards/aplusx_pulsar/xboard_qs/xboard_qs.h +++ b/keyboards/aplusx_pulsar/xboard_qs/xboard_qs.h @@ -23,7 +23,6 @@ enum pulsar_keycodes { KC_WIN_MODE, // WINDOWS Keyboard로 변경 KC_MAC_MODE, // Machintosh Keyboard로 변경 KC_TMODE, // WINDOWS <--> Machintosh - KC_SPOTLIGHT, // MAC_key KC_DICTATION, // MAC_key KC_DO_NOT_DISTURB, // MAC_key KC_LOCK_SCREEN, // MAC_key @@ -33,13 +32,12 @@ enum pulsar_keycodes { KC_PC2, // KM Switch PC2 KC_TPC, // KM Switch PC1<-->PC2 Toggle INIT_3S, // EE_CLR(EEPROM CLear)(공장초기화)를 3초이상 눌러야 동작 - KC_S_LED, // Change Status LED Brightness -}; + KC_S_LED // Change Status LED Brightness +} #define KC_WINM KC_WIN_MODE #define KC_MACM KC_MAC_MODE -#define KC_SPLT KC_SPOTLIGHT #define KC_SIRI KC_DICTATION #define KC_DOND KC_DO_NOT_DISTURB #define KC_LOCK_ KC_LOCK_SCREEN From d6be041f6e31146e185cc1c6943dadffe3d028aa Mon Sep 17 00:00:00 2001 From: skylupin03 Date: Mon, 15 Jul 2024 17:03:26 +0900 Subject: [PATCH 8/9] Modified by the teachings of "drashna" - 24.07.15 (3rd) err fix --- keyboards/aplusx_pulsar/xboard_qs/xboard_qs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/aplusx_pulsar/xboard_qs/xboard_qs.h b/keyboards/aplusx_pulsar/xboard_qs/xboard_qs.h index f205b786e9d..1997c35712a 100644 --- a/keyboards/aplusx_pulsar/xboard_qs/xboard_qs.h +++ b/keyboards/aplusx_pulsar/xboard_qs/xboard_qs.h @@ -33,7 +33,7 @@ enum pulsar_keycodes { KC_TPC, // KM Switch PC1<-->PC2 Toggle INIT_3S, // EE_CLR(EEPROM CLear)(공장초기화)를 3초이상 눌러야 동작 KC_S_LED // Change Status LED Brightness -} +}; #define KC_WINM KC_WIN_MODE #define KC_MACM KC_MAC_MODE From 6951b7318918c50e69e547b5f1970349c867f0be Mon Sep 17 00:00:00 2001 From: James yun <111858513+skylupin03@users.noreply.github.com> Date: Tue, 23 Jul 2024 21:54:34 +0900 Subject: [PATCH 9/9] Update keyboards/aplusx_pulsar/xboard_qs/config.h Co-authored-by: Drashna Jaelre --- keyboards/aplusx_pulsar/xboard_qs/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/aplusx_pulsar/xboard_qs/config.h b/keyboards/aplusx_pulsar/xboard_qs/config.h index 6c5beed891a..6004654b629 100644 --- a/keyboards/aplusx_pulsar/xboard_qs/config.h +++ b/keyboards/aplusx_pulsar/xboard_qs/config.h @@ -16,7 +16,7 @@ #pragma once -#define WAIT_US_TIMER GPTD3 // Encoder 및 RGB ANI가 부드러워짐 +#define WAIT_US_TIMER GPTD3 /* USB Hub Control pins */ #define GPIO_KM_PWEN C1 // Hub Device Power on/off