From 6921c8a7ddbf5596d629f6272b4043bb3cbcf661 Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Tue, 28 May 2024 14:41:15 +1000 Subject: [PATCH 001/204] Branch point for 2024q3 Breaking Change. --- readme.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/readme.md b/readme.md index f0e49a08e95..c277ca0aade 100644 --- a/readme.md +++ b/readme.md @@ -1,3 +1,7 @@ +# THIS IS THE DEVELOP BRANCH + +Warning- This is the `develop` branch of QMK Firmware. You may encounter broken code here. Please see [Breaking Changes](https://docs.qmk.fm/#/breaking_changes) for more information. + # Quantum Mechanical Keyboard Firmware [![Current Version](https://img.shields.io/github/tag/qmk/qmk_firmware.svg)](https://github.com/qmk/qmk_firmware/tags) From 267dffda154d119ed5f155665e90fc5e03d138a5 Mon Sep 17 00:00:00 2001 From: Purdea Andrei Date: Tue, 28 May 2024 14:49:55 +0300 Subject: [PATCH 002/204] EEPROM: Don't erase if we don't have to. Adding eeprom_driver_format abstraction. (#18332) --- drivers/eeprom/eeprom_custom.c-template | 11 +++++++++++ drivers/eeprom/eeprom_driver.c | 6 ++++++ drivers/eeprom/eeprom_driver.h | 2 ++ drivers/eeprom/eeprom_i2c.c | 8 ++++++++ drivers/eeprom/eeprom_spi.c | 8 ++++++++ drivers/eeprom/eeprom_transient.c | 9 +++++++-- drivers/eeprom/eeprom_wear_leveling.c | 6 ++++++ .../drivers/eeprom/eeprom_legacy_emulated_flash.c | 7 +++++++ platforms/chibios/drivers/eeprom/eeprom_stm32_L0_L1.c | 6 ++++++ quantum/eeconfig.c | 4 ++-- 10 files changed, 63 insertions(+), 4 deletions(-) diff --git a/drivers/eeprom/eeprom_custom.c-template b/drivers/eeprom/eeprom_custom.c-template index 5f915f7fab5..fb1f0a3a974 100644 --- a/drivers/eeprom/eeprom_custom.c-template +++ b/drivers/eeprom/eeprom_custom.c-template @@ -23,6 +23,17 @@ void eeprom_driver_init(void) { /* Any initialisation code */ } +void eeprom_driver_format(bool erase) { + /* If erase=false, then only do the absolute minimum initialisation necessary + to make sure that the eeprom driver is usable. It doesn't need to guarantee + that the content of the eeprom is reset to any particular value. For many + eeprom drivers this may be a no-op. + + If erase=true, then in addition to making sure the eeprom driver is in a + usable state, also make sure that it is erased. + */ +} + void eeprom_driver_erase(void) { /* Wipe out the EEPROM, setting values to zero */ } diff --git a/drivers/eeprom/eeprom_driver.c b/drivers/eeprom/eeprom_driver.c index 885cf219811..1f3f96f0068 100644 --- a/drivers/eeprom/eeprom_driver.c +++ b/drivers/eeprom/eeprom_driver.c @@ -77,3 +77,9 @@ void eeprom_update_dword(uint32_t *addr, uint32_t value) { eeprom_write_dword(addr, value); } } + +void eeprom_driver_format(bool erase) __attribute__((weak)); +void eeprom_driver_format(bool erase) { + (void)erase; /* The default implementation assumes that the eeprom must be erased in order to be usable. */ + eeprom_driver_erase(); +} diff --git a/drivers/eeprom/eeprom_driver.h b/drivers/eeprom/eeprom_driver.h index 74592bc8f05..0c55c497d46 100644 --- a/drivers/eeprom/eeprom_driver.h +++ b/drivers/eeprom/eeprom_driver.h @@ -16,7 +16,9 @@ #pragma once +#include #include "eeprom.h" void eeprom_driver_init(void); +void eeprom_driver_format(bool erase); void eeprom_driver_erase(void); diff --git a/drivers/eeprom/eeprom_i2c.c b/drivers/eeprom/eeprom_i2c.c index 0d3d5ccbe50..d29aff5f85f 100644 --- a/drivers/eeprom/eeprom_i2c.c +++ b/drivers/eeprom/eeprom_i2c.c @@ -36,6 +36,7 @@ #include "wait.h" #include "i2c_master.h" #include "eeprom.h" +#include "eeprom_driver.h" #include "eeprom_i2c.h" // #define DEBUG_EEPROM_OUTPUT @@ -62,6 +63,13 @@ void eeprom_driver_init(void) { #endif } +void eeprom_driver_format(bool erase) { + /* i2c eeproms do not need to be formatted before use */ + if (erase) { + eeprom_driver_erase(); + } +} + void eeprom_driver_erase(void) { #if defined(CONSOLE_ENABLE) && defined(DEBUG_EEPROM_OUTPUT) uint32_t start = timer_read32(); diff --git a/drivers/eeprom/eeprom_spi.c b/drivers/eeprom/eeprom_spi.c index 51ba25deced..14f0afa68be 100644 --- a/drivers/eeprom/eeprom_spi.c +++ b/drivers/eeprom/eeprom_spi.c @@ -35,6 +35,7 @@ #include "timer.h" #include "spi_master.h" #include "eeprom.h" +#include "eeprom_driver.h" #include "eeprom_spi.h" #define CMD_WREN 6 @@ -92,6 +93,13 @@ void eeprom_driver_init(void) { spi_init(); } +void eeprom_driver_format(bool erase) { + /* spi eeproms do not need to be formatted before use */ + if (erase) { + eeprom_driver_erase(); + } +} + void eeprom_driver_erase(void) { #if defined(CONSOLE_ENABLE) && defined(DEBUG_EEPROM_OUTPUT) uint32_t start = timer_read32(); diff --git a/drivers/eeprom/eeprom_transient.c b/drivers/eeprom/eeprom_transient.c index 9dc4289c271..d9f5db98532 100644 --- a/drivers/eeprom/eeprom_transient.c +++ b/drivers/eeprom/eeprom_transient.c @@ -30,8 +30,13 @@ size_t clamp_length(intptr_t offset, size_t len) { return len; } -void eeprom_driver_init(void) { - eeprom_driver_erase(); +void eeprom_driver_init(void) {} + +void eeprom_driver_format(bool erase) { + /* The transient eeprom driver doesn't necessarily need to be formatted before use, and it always starts up filled with zeros, due to placement in the .bss section */ + if (erase) { + eeprom_driver_erase(); + } } void eeprom_driver_erase(void) { diff --git a/drivers/eeprom/eeprom_wear_leveling.c b/drivers/eeprom/eeprom_wear_leveling.c index bd77eef35cc..24ca6c3c6b3 100644 --- a/drivers/eeprom/eeprom_wear_leveling.c +++ b/drivers/eeprom/eeprom_wear_leveling.c @@ -10,6 +10,12 @@ void eeprom_driver_init(void) { wear_leveling_init(); } +void eeprom_driver_format(bool erase) { + /* wear leveling requires the write log data structures to be erased before use. */ + (void)erase; + eeprom_driver_erase(); +} + void eeprom_driver_erase(void) { wear_leveling_erase(); } diff --git a/platforms/chibios/drivers/eeprom/eeprom_legacy_emulated_flash.c b/platforms/chibios/drivers/eeprom/eeprom_legacy_emulated_flash.c index a81fe3353c6..9857ac046bd 100644 --- a/platforms/chibios/drivers/eeprom/eeprom_legacy_emulated_flash.c +++ b/platforms/chibios/drivers/eeprom/eeprom_legacy_emulated_flash.c @@ -24,6 +24,7 @@ #include "debug.h" #include "eeprom_legacy_emulated_flash.h" #include "legacy_flash_ops.h" +#include "eeprom_driver.h" /* * We emulate eeprom by writing a snapshot compacted view of eeprom contents, @@ -564,6 +565,12 @@ void eeprom_driver_init(void) { EEPROM_Init(); } +void eeprom_driver_format(bool erase) { + /* emulated eepron requires the write log data structures to be erased before use. */ + (void)erase; + eeprom_driver_erase(); +} + void eeprom_driver_erase(void) { EEPROM_Erase(); } diff --git a/platforms/chibios/drivers/eeprom/eeprom_stm32_L0_L1.c b/platforms/chibios/drivers/eeprom/eeprom_stm32_L0_L1.c index ed26cc71457..628137a0b35 100644 --- a/platforms/chibios/drivers/eeprom/eeprom_stm32_L0_L1.c +++ b/platforms/chibios/drivers/eeprom/eeprom_stm32_L0_L1.c @@ -52,6 +52,12 @@ static inline void STM32_L0_L1_EEPROM_Lock(void) { void eeprom_driver_init(void) {} +void eeprom_driver_format(bool erase) { + if (erase) { + eeprom_driver_erase(); + } +} + void eeprom_driver_erase(void) { STM32_L0_L1_EEPROM_Unlock(); diff --git a/quantum/eeconfig.c b/quantum/eeconfig.c index 40690d6a97a..ffbbf43a95c 100644 --- a/quantum/eeconfig.c +++ b/quantum/eeconfig.c @@ -46,7 +46,7 @@ __attribute__((weak)) void eeconfig_init_kb(void) { */ void eeconfig_init_quantum(void) { #if defined(EEPROM_DRIVER) - eeprom_driver_erase(); + eeprom_driver_format(false); #endif eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER); @@ -108,7 +108,7 @@ void eeconfig_enable(void) { */ void eeconfig_disable(void) { #if defined(EEPROM_DRIVER) - eeprom_driver_erase(); + eeprom_driver_format(false); #endif eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER_OFF); } From 4d320736815152abc9b9bd0318edd02d2a045b74 Mon Sep 17 00:00:00 2001 From: burkfers Date: Wed, 29 May 2024 06:53:48 +0200 Subject: [PATCH 003/204] BastardKB: remove legacy board `tbk` (#23818) remove legacy board `tbk` --- keyboards/bastardkb/tbk/config.h | 20 ---- keyboards/bastardkb/tbk/keyboard.json | 111 ------------------ .../bastardkb/tbk/keymaps/default/keymap.c | 60 ---------- keyboards/bastardkb/tbk/readme.md | 22 ---- 4 files changed, 213 deletions(-) delete mode 100644 keyboards/bastardkb/tbk/config.h delete mode 100644 keyboards/bastardkb/tbk/keyboard.json delete mode 100644 keyboards/bastardkb/tbk/keymaps/default/keymap.c delete mode 100644 keyboards/bastardkb/tbk/readme.md diff --git a/keyboards/bastardkb/tbk/config.h b/keyboards/bastardkb/tbk/config.h deleted file mode 100644 index 8515cac5ef0..00000000000 --- a/keyboards/bastardkb/tbk/config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2021 Quentin LEBASTARD - * - * 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 MASTER_RIGHT diff --git a/keyboards/bastardkb/tbk/keyboard.json b/keyboards/bastardkb/tbk/keyboard.json deleted file mode 100644 index 90e37478a1e..00000000000 --- a/keyboards/bastardkb/tbk/keyboard.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "keyboard_name": "The Bastard Keyboard", - "url": "https://bastardkb.com/", - "usb": { - "device_version": "0.0.1", - "pid": "0x1828" - }, - "rgblight": { - "led_count": 38, - "split_count": [19, 19], - "animations": { - "breathing": true, - "rainbow_mood": true, - "rainbow_swirl": true, - "snake": true, - "knight": true, - "christmas": true, - "static_gradient": true, - "rgb_test": true, - "alternating": true, - "twinkle": true - } - }, - "ws2812": { - "pin": "D2" - }, - "features": { - "bootmagic": true, - "command": false, - "console": false, - "extrakey": true, - "mousekey": true, - "nkro": false, - "rgblight": true - }, - "matrix_pins": { - "cols": ["B4", "E6", "C6", "B1", "B3", "B2"], - "rows": ["D7", "B5", "F7", "F6", "B6"] - }, - "diode_direction": "ROW2COL", - "split": { - "enabled": true, - "soft_serial_pin": "D0" - }, - "processor": "atmega32u4", - "bootloader": "atmel-dfu", - "layouts": { - "LAYOUT_split_4x6_5": { - "layout": [ - {"matrix": [0, 0], "x": 0, "y": 0}, - {"matrix": [0, 1], "x": 1, "y": 0}, - {"matrix": [0, 2], "x": 2, "y": 0}, - {"matrix": [0, 3], "x": 3, "y": 0}, - {"matrix": [0, 4], "x": 4, "y": 0}, - {"matrix": [0, 5], "x": 5, "y": 0}, - {"matrix": [5, 5], "x": 11, "y": 0}, - {"matrix": [5, 4], "x": 12, "y": 0}, - {"matrix": [5, 3], "x": 13, "y": 0}, - {"matrix": [5, 2], "x": 14, "y": 0}, - {"matrix": [5, 1], "x": 15, "y": 0}, - {"matrix": [5, 0], "x": 16, "y": 0}, - {"matrix": [1, 0], "x": 0, "y": 1}, - {"matrix": [1, 1], "x": 1, "y": 1}, - {"matrix": [1, 2], "x": 2, "y": 1}, - {"matrix": [1, 3], "x": 3, "y": 1}, - {"matrix": [1, 4], "x": 4, "y": 1}, - {"matrix": [1, 5], "x": 5, "y": 1}, - {"matrix": [6, 5], "x": 11, "y": 1}, - {"matrix": [6, 4], "x": 12, "y": 1}, - {"matrix": [6, 3], "x": 13, "y": 1}, - {"matrix": [6, 2], "x": 14, "y": 1}, - {"matrix": [6, 1], "x": 15, "y": 1}, - {"matrix": [6, 0], "x": 16, "y": 1}, - {"matrix": [2, 0], "x": 0, "y": 2}, - {"matrix": [2, 1], "x": 1, "y": 2}, - {"matrix": [2, 2], "x": 2, "y": 2}, - {"matrix": [2, 3], "x": 3, "y": 2}, - {"matrix": [2, 4], "x": 4, "y": 2}, - {"matrix": [2, 5], "x": 5, "y": 2}, - {"matrix": [7, 5], "x": 11, "y": 2}, - {"matrix": [7, 4], "x": 12, "y": 2}, - {"matrix": [7, 3], "x": 13, "y": 2}, - {"matrix": [7, 2], "x": 14, "y": 2}, - {"matrix": [7, 1], "x": 15, "y": 2}, - {"matrix": [7, 0], "x": 16, "y": 2}, - {"matrix": [3, 0], "x": 0, "y": 3}, - {"matrix": [3, 1], "x": 1, "y": 3}, - {"matrix": [3, 2], "x": 2, "y": 3}, - {"matrix": [3, 3], "x": 3, "y": 3}, - {"matrix": [3, 4], "x": 4, "y": 3}, - {"matrix": [3, 5], "x": 5, "y": 3}, - {"matrix": [8, 5], "x": 11, "y": 3}, - {"matrix": [8, 4], "x": 12, "y": 3}, - {"matrix": [8, 3], "x": 13, "y": 3}, - {"matrix": [8, 2], "x": 14, "y": 3}, - {"matrix": [8, 1], "x": 15, "y": 3}, - {"matrix": [8, 0], "x": 16, "y": 3}, - {"matrix": [4, 3], "x": 5, "y": 4}, - {"matrix": [4, 4], "x": 6, "y": 4}, - {"matrix": [4, 1], "x": 7, "y": 4}, - {"matrix": [9, 1], "x": 9, "y": 4}, - {"matrix": [9, 4], "x": 10, "y": 4}, - {"matrix": [9, 3], "x": 11, "y": 4}, - {"matrix": [4, 5], "x": 6, "y": 5}, - {"matrix": [4, 2], "x": 7, "y": 5}, - {"matrix": [9, 2], "x": 9, "y": 5}, - {"matrix": [9, 5], "x": 10, "y": 5} - ] - } - } -} diff --git a/keyboards/bastardkb/tbk/keymaps/default/keymap.c b/keyboards/bastardkb/tbk/keymaps/default/keymap.c deleted file mode 100644 index 3227076c076..00000000000 --- a/keyboards/bastardkb/tbk/keymaps/default/keymap.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2021 Quentin LEBASTARD - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [0] = LAYOUT_split_4x6_5( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, -//-------------------------------------------------//-----------------------------------------------------------// - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, -//-------------------------------------------------//-----------------------------------------------------------// - KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, -//-------------------------------------------------//-----------------------------------------------------------// - KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS, -//-------------------------------------------------//-----------------------------------------------------------// - KC_LCTL, KC_SPC, MO(1), MO(2), KC_ENT, KC_RGUI, - KC_HOME, KC_BSPC, KC_DEL, KC_RALT - ), - - [1] = LAYOUT_split_4x6_5( - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, -//---------------------------------------------------------//-----------------------------------------------------------// - QK_BOOT, _______, _______, _______, _______, KC_LBRC, KC_RBRC, KC_P7, KC_P8, KC_P9, _______, KC_PLUS, -//---------------------------------------------------------//-----------------------------------------------------------// - _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END, KC_LPRN, KC_RPRN, KC_P4, KC_P5, KC_P6, KC_MINS, KC_PIPE, -//---------------------------------------------------------//-----------------------------------------------------------// - _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_EQL, KC_UNDS, -//---------------------------------------------------------//-----------------------------------------------------------// - KC_LCTL, KC_HOME, KC_TRNS, KC_TRNS, KC_RALT, KC_RGUI, - KC_SPC, KC_BSPC, KC_RCTL, KC_ENT - ), - - [2] = LAYOUT_split_4x6_5( - KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, -//---------------------------------------------------------//--------------------------------------------------------------// - _______, _______, RGB_RMOD, RGB_TOG, RGB_MOD, KC_LBRC, KC_RBRC, _______, KC_NUM, KC_INS, KC_SCRL, KC_MUTE, -//---------------------------------------------------------//--------------------------------------------------------------// - _______, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT, KC_LPRN, KC_RPRN, KC_MPRV, KC_MPLY, KC_MNXT, _______, KC_VOLU, -//---------------------------------------------------------//--------------------------------------------------------------// - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, -//---------------------------------------------------------//--------------------------------------------------------------// - KC_LCTL, KC_HOME, KC_TRNS, KC_TRNS, KC_RALT, QK_BOOT, - KC_SPC, KC_BSPC, KC_RCTL, KC_ENT - ), -}; diff --git a/keyboards/bastardkb/tbk/readme.md b/keyboards/bastardkb/tbk/readme.md deleted file mode 100644 index 0d552e5caf8..00000000000 --- a/keyboards/bastardkb/tbk/readme.md +++ /dev/null @@ -1,22 +0,0 @@ -# The Bastard Keyboard - -A split ergonomic keyboard. - -* Keyboard Maintainer: [Bastard Keyboards](https://github.com/Bastardkb/) -* Hardware Supported: elite-C V4 -* Hardware Availability: [Bastard Keyboards](https://bastardkb.com/) - -Make example for this keyboard (after setting up your build environment): - - make bastardkb/tbk:default - -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). - -See the [keyboard build instructions](https://docs.bastardkb.com) - - -## Important information regarding the reset - -If you modify this firmware, make sure to always have a QK_BOOT key that can be triggered using only the master side ! This way you ensure that you can always flash the keyboard, even if you mess up. - -Otherwise if you're stuck, open the case and reset manually by shorting Gnd and Rst, or pressing the RST button. From 75d11e04215edc43eeef71756a23d7f46e66c459 Mon Sep 17 00:00:00 2001 From: dexter93 Date: Tue, 4 Jun 2024 13:16:45 +0300 Subject: [PATCH 004/204] [wear_leveling] efl updates (#22489) Co-authored-by: Nick Brassel --- docs/drivers/eeprom.md | 15 +++++---- .../drivers/wear_leveling/wear_leveling_efl.c | 33 ++++++++++++++----- 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/docs/drivers/eeprom.md b/docs/drivers/eeprom.md index 82630c501d1..0ae258424f8 100644 --- a/docs/drivers/eeprom.md +++ b/docs/drivers/eeprom.md @@ -119,13 +119,14 @@ This driver performs writes to the embedded flash storage embedded in the MCU. I Configurable options in your keyboard's `config.h`: -`config.h` override | Default | Description ------------------------------------------|-------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -`#define WEAR_LEVELING_EFL_FIRST_SECTOR` | _unset_ | The first sector on the MCU to use. By default this is not defined and calculated at runtime based on the MCU. However, different flash sizes on MCUs may require custom configuration. -`#define WEAR_LEVELING_EFL_FLASH_SIZE` | _unset_ | Allows overriding the flash size available for use for wear-leveling. Under normal circumstances this is automatically calculated and should not need to be overridden. Specifying a size larger than the amount actually available in flash will usually prevent the MCU from booting. -`#define WEAR_LEVELING_LOGICAL_SIZE` | `(backing_size/2)` | Number of bytes "exposed" to the rest of QMK and denotes the size of the usable EEPROM. -`#define WEAR_LEVELING_BACKING_SIZE` | `2048` | Number of bytes used by the wear-leveling algorithm for its underlying storage, and needs to be a multiple of the logical size. -`#define BACKING_STORE_WRITE_SIZE` | _automatic_ | The byte width of the underlying write used on the MCU, and is usually automatically determined from the selected MCU family. If an error occurs in the auto-detection, you'll need to consult the MCU's datasheet and determine this value, specifying it directly. +`config.h` override | Default | Description +---------------------------------------------------|--------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +`#define WEAR_LEVELING_EFL_FIRST_SECTOR` | _unset_ | The first sector on the MCU to use. By default this is not defined and calculated at runtime based on the MCU. However, different flash sizes on MCUs may require custom configuration. +`#define WEAR_LEVELING_EFL_FLASH_SIZE` | _unset_ | Allows overriding the flash size available for use for wear-leveling. Under normal circumstances this is automatically calculated and should not need to be overridden. Specifying a size larger than the amount actually available in flash will usually prevent the MCU from booting. +`#define WEAR_LEVELING_EFL_OMIT_LAST_SECTOR_COUNT` | `0` | Number of sectors to omit at the end of the flash. These sectors will not be allocated to the driver and the usable flash block will be offset, but keeping the set flash size. Useful on devices with bootloaders requiring a check flag at the end of flash to be present in order to confirm a valid, bootable firmware. +`#define WEAR_LEVELING_LOGICAL_SIZE` | `(backing_size/2)` | Number of bytes "exposed" to the rest of QMK and denotes the size of the usable EEPROM. +`#define WEAR_LEVELING_BACKING_SIZE` | `2048` | Number of bytes used by the wear-leveling algorithm for its underlying storage, and needs to be a multiple of the logical size. +`#define BACKING_STORE_WRITE_SIZE` | _automatic_ | The byte width of the underlying write used on the MCU, and is usually automatically determined from the selected MCU family. If an error occurs in the auto-detection, you'll need to consult the MCU's datasheet and determine this value, specifying it directly. ::: warning If your MCU does not boot after swapping to the EFL wear-leveling driver, it's likely that the flash size is incorrectly detected, usually as an MCU with larger flash and may require overriding. diff --git a/platforms/chibios/drivers/wear_leveling/wear_leveling_efl.c b/platforms/chibios/drivers/wear_leveling/wear_leveling_efl.c index 3d6ed52e5c0..f49c4a45b0b 100644 --- a/platforms/chibios/drivers/wear_leveling/wear_leveling_efl.c +++ b/platforms/chibios/drivers/wear_leveling/wear_leveling_efl.c @@ -14,11 +14,15 @@ static flash_sector_t first_sector = WEAR_LEVELING_EFL_FIRST_SECTOR; static flash_sector_t first_sector = UINT16_MAX; #endif // defined(WEAR_LEVELING_EFL_FIRST_SECTOR) +#if !defined(WEAR_LEVELING_EFL_OMIT_LAST_SECTOR_COUNT) +# define WEAR_LEVELING_EFL_OMIT_LAST_SECTOR_COUNT 0 +#endif // WEAR_LEVELING_EFL_OMIT_LAST_SECTOR_COUNT + static flash_sector_t sector_count = UINT16_MAX; static BaseFlash * flash; - -static volatile bool is_issuing_read = false; -static volatile bool ecc_error_occurred = false; +static bool flash_erased_is_one; +static volatile bool is_issuing_read = false; +static volatile bool ecc_error_occurred = false; // "Automatic" detection of the flash size -- ideally ChibiOS would have this already, but alas, it doesn't. static inline uint32_t detect_flash_size(void) { @@ -51,10 +55,19 @@ bool backing_store_init(void) { uint32_t counter = 0; uint32_t flash_size = detect_flash_size(); + // Check if the hardware erase is logic 1 + flash_erased_is_one = (desc->attributes & FLASH_ATTR_ERASED_IS_ONE) ? true : false; + + if (WEAR_LEVELING_EFL_OMIT_LAST_SECTOR_COUNT >= desc->sectors_count) { + // Last sector defined is greater than available number of sectors. Can't do anything here. Fault. + chSysHalt("Last sector intended to be used with wear_leveling is beyond available flash descriptor range"); + } + #if defined(WEAR_LEVELING_EFL_FIRST_SECTOR) // Work out how many sectors we want to use, working forwards from the first sector specified - for (flash_sector_t i = 0; i < desc->sectors_count - first_sector; ++i) { + flash_sector_t last_sector = desc->sectors_count - WEAR_LEVELING_EFL_OMIT_LAST_SECTOR_COUNT; + for (flash_sector_t i = 0; i < last_sector - first_sector; ++i) { counter += flashGetSectorSize(flash, first_sector + i); if (counter >= (WEAR_LEVELING_BACKING_SIZE)) { sector_count = i + 1; @@ -70,9 +83,9 @@ bool backing_store_init(void) { #else // defined(WEAR_LEVELING_EFL_FIRST_SECTOR) // Work out how many sectors we want to use, working backwards from the end of the flash - flash_sector_t last_sector = desc->sectors_count; - for (flash_sector_t i = 0; i < desc->sectors_count; ++i) { - first_sector = desc->sectors_count - i - 1; + flash_sector_t last_sector = desc->sectors_count - WEAR_LEVELING_EFL_OMIT_LAST_SECTOR_COUNT; + for (flash_sector_t i = 0; i < last_sector; ++i) { + first_sector = last_sector - i - 1; if (flashGetSectorOffset(flash, first_sector) >= flash_size) { last_sector = first_sector; continue; @@ -124,7 +137,9 @@ bool backing_store_write(uint32_t address, backing_store_int_t value) { uint32_t offset = (base_offset + address); bs_dprintf("Write "); wl_dump(offset, &value, sizeof(value)); - value = ~value; + if (flash_erased_is_one) { + value = ~value; + } return flashProgram(flash, offset, sizeof(value), (const uint8_t *)&value) == FLASH_NO_ERROR; } @@ -138,7 +153,7 @@ static backing_store_int_t backing_store_safe_read_from_location(backing_store_i backing_store_int_t value; is_issuing_read = true; ecc_error_occurred = false; - value = ~(*loc); + value = flash_erased_is_one ? ~(*loc) : (*loc); is_issuing_read = false; return value; } From a82b0628b399c35bcdf70f14cabfa0bb27f86af8 Mon Sep 17 00:00:00 2001 From: Fernando Birra Date: Tue, 4 Jun 2024 23:41:26 +0100 Subject: [PATCH 005/204] GC9xxx LCD family drivers (GC9107 and GC9A01) (#23091) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Nick Brassel Co-authored-by: jack <0x6A73@pm.me> Co-authored-by: Joel Challis Co-authored-by: フィルターペーパー <76888457+filterpaper@users.noreply.github.com> Co-authored-by: rookiebwoy <81021475+rookiebwoy@users.noreply.github.com> Fixup boardsource/equals (#23106) Fix make clean test:os_detection (#23112) Fix make clean test:os_detection (#23112)" Fixup boardsource/equals (#23106)" --- drivers/painter/gc9a01/qp_gc9a01_opcodes.h | 77 ---------- drivers/painter/gc9xxx/qp_gc9107.c | 114 +++++++++++++++ drivers/painter/gc9xxx/qp_gc9107.h | 37 +++++ drivers/painter/gc9xxx/qp_gc9107_opcodes.h | 135 ++++++++++++++++++ .../painter/{gc9a01 => gc9xxx}/qp_gc9a01.c | 78 ++++------ .../painter/{gc9a01 => gc9xxx}/qp_gc9a01.h | 0 drivers/painter/gc9xxx/qp_gc9a01_opcodes.h | 104 ++++++++++++++ drivers/painter/gc9xxx/qp_gc9xxx_opcodes.h | 55 +++++++ quantum/painter/qp.h | 6 + quantum/painter/qp_internal.c | 1 + quantum/painter/rules.mk | 16 ++- 11 files changed, 490 insertions(+), 133 deletions(-) delete mode 100644 drivers/painter/gc9a01/qp_gc9a01_opcodes.h create mode 100644 drivers/painter/gc9xxx/qp_gc9107.c create mode 100644 drivers/painter/gc9xxx/qp_gc9107.h create mode 100644 drivers/painter/gc9xxx/qp_gc9107_opcodes.h rename drivers/painter/{gc9a01 => gc9xxx}/qp_gc9a01.c (61%) rename drivers/painter/{gc9a01 => gc9xxx}/qp_gc9a01.h (100%) create mode 100644 drivers/painter/gc9xxx/qp_gc9a01_opcodes.h create mode 100644 drivers/painter/gc9xxx/qp_gc9xxx_opcodes.h diff --git a/drivers/painter/gc9a01/qp_gc9a01_opcodes.h b/drivers/painter/gc9a01/qp_gc9a01_opcodes.h deleted file mode 100644 index 828e42752b0..00000000000 --- a/drivers/painter/gc9a01/qp_gc9a01_opcodes.h +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2021 Paul Cotter (@gr1mr3aver) -// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Quantum Painter GC9A01 command opcodes -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Level 1 command opcodes - -#define GC9A01_GET_ID_INFO 0x04 // Get ID information -#define GC9A01_GET_STATUS 0x09 // Get status -#define GC9A01_CMD_SLEEP_ON 0x10 // Enter sleep mode -#define GC9A01_CMD_SLEEP_OFF 0x11 // Exit sleep mode -#define GC9A01_CMD_PARTIAL_ON 0x12 // Enter partial mode -#define GC9A01_CMD_PARTIAL_OFF 0x13 // Exit partial mode -#define GC9A01_CMD_INVERT_ON 0x20 // Enter inverted mode -#define GC9A01_CMD_INVERT_OFF 0x21 // Exit inverted mode -#define GC9A01_CMD_DISPLAY_OFF 0x28 // Disable display -#define GC9A01_CMD_DISPLAY_ON 0x29 // Enable display -#define GC9A01_SET_COL_ADDR 0x2A // Set column address -#define GC9A01_SET_PAGE_ADDR 0x2B // Set page address -#define GC9A01_SET_MEM 0x2C // Set memory -#define GC9A01_SET_PARTIAL_AREA 0x30 // Set partial area -#define GC9A01_SET_VSCROLL 0x33 // Set vertical scroll def -#define GC9A01_CMD_TEARING_ON 0x34 // Tearing line enabled -#define GC9A01_CMD_TEARING_OFF 0x35 // Tearing line disabled -#define GC9A01_SET_MEM_ACS_CTL 0x36 // Set mem access ctl -#define GC9A01_SET_VSCROLL_ADDR 0x37 // Set vscroll start addr -#define GC9A01_CMD_IDLE_OFF 0x38 // Exit idle mode -#define GC9A01_CMD_IDLE_ON 0x39 // Enter idle mode -#define GC9A01_SET_PIX_FMT 0x3A // Set pixel format -#define GC9A01_SET_MEM_CONT 0x3C // Set memory continue -#define GC9A01_SET_TEAR_SCANLINE 0x44 // Set tearing scanline -#define GC9A01_GET_TEAR_SCANLINE 0x45 // Get tearing scanline -#define GC9A01_SET_BRIGHTNESS 0x51 // Set brightness -#define GC9A01_SET_DISPLAY_CTL 0x53 // Set display ctl -#define GC9A01_GET_ID1 0xDA // Get ID1 -#define GC9A01_GET_ID2 0xDB // Get ID2 -#define GC9A01_GET_ID3 0xDC // Get ID3 - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Level 2 command opcodes - -#define GC9A01_SET_RGB_IF_SIG_CTL 0xB0 // RGB IF signal ctl -#define GC9A01_SET_BLANKING_PORCH_CTL 0xB5 // Set blanking porch ctl -#define GC9A01_SET_FUNCTION_CTL 0xB6 // Set function ctl -#define GC9A01_SET_TEARING_EFFECT 0xBA // Set backlight ctl 3 -#define GC9A01_SET_IF_CTL 0xF6 // Set interface control - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Level 3 command opcodes - -#define GC9A01_SET_FRAME_RATE 0xE8 // Set frame rate -#define GC9A01_SET_SPI_2DATA 0xE9 // Set frame rate -#define GC9A01_SET_POWER_CTL_1 0xC1 // Set power ctl 1 -#define GC9A01_SET_POWER_CTL_2 0xC3 // Set power ctl 2 -#define GC9A01_SET_POWER_CTL_3 0xC4 // Set power ctl 3 -#define GC9A01_SET_POWER_CTL_4 0xC9 // Set power ctl 4 -#define GC9A01_SET_POWER_CTL_7 0xA7 // Set power ctl 7 -#define GC9A01_SET_INTER_REG_ENABLE1 0xFE // Enable Inter Register 1 -#define GC9A01_SET_INTER_REG_ENABLE2 0xEF // Enable Inter Register 2 -#define GC9A01_SET_GAMMA1 0xF0 // -#define GC9A01_SET_GAMMA2 0xF1 -#define GC9A01_SET_GAMMA3 0xF2 -#define GC9A01_SET_GAMMA4 0xF3 - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// MADCTL Flags -#define GC9A01_MADCTL_MY 0b10000000 -#define GC9A01_MADCTL_MX 0b01000000 -#define GC9A01_MADCTL_MV 0b00100000 -#define GC9A01_MADCTL_ML 0b00010000 -#define GC9A01_MADCTL_RGB 0b00000000 -#define GC9A01_MADCTL_BGR 0b00001000 -#define GC9A01_MADCTL_MH 0b00000100 diff --git a/drivers/painter/gc9xxx/qp_gc9107.c b/drivers/painter/gc9xxx/qp_gc9107.c new file mode 100644 index 00000000000..108344da4f2 --- /dev/null +++ b/drivers/painter/gc9xxx/qp_gc9107.c @@ -0,0 +1,114 @@ +// Copyright 2024 Fernando Birra +// SPDX-License-Identifier: GPL-2.0-or-later +#include "qp_internal.h" +#include "qp_comms.h" +#include "qp_gc9107.h" +#include "qp_gc9xxx_opcodes.h" +#include "qp_gc9107_opcodes.h" +#include "qp_tft_panel.h" + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Driver storage +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +tft_panel_dc_reset_painter_device_t gc9107_drivers[GC9107_NUM_DEVICES] = {0}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Initialization +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +__attribute__((weak)) bool qp_gc9107_init(painter_device_t device, painter_rotation_t rotation) { + // A lot of these "unknown" opcodes are sourced from other OSS projects and are seemingly required for this display to function. + // clang-format off + const uint8_t gc9107_init_sequence[] = { + GC9XXX_SET_INTER_REG_ENABLE1, 5, 0, + GC9XXX_SET_INTER_REG_ENABLE2, 5, 0, + GC9107_SET_FUNCTION_CTL6, 0, 1, GC9107_ALLOW_SET_COMPLEMENT_RGB | 0x08 | GC9107_ALLOW_SET_FRAMERATE, + GC9107_SET_COMPLEMENT_RGB, 0, 1, GC9107_COMPLEMENT_WITH_LSB, + 0xAB, 0, 1, 0x0E, + GC9107_SET_FRAME_RATE, 0, 1, 0x19, + GC9XXX_SET_PIXEL_FORMAT, 0, 1, GC9107_PIXEL_FORMAT_16_BPP_IFPF, + GC9XXX_CMD_SLEEP_OFF, 120, 0, + GC9XXX_CMD_DISPLAY_ON, 20, 0 + }; + + // clang-format on + qp_comms_bulk_command_sequence(device, gc9107_init_sequence, sizeof(gc9107_init_sequence)); + + // Configure the rotation (i.e. the ordering and direction of memory writes in GRAM) + const uint8_t madctl[] = { + [QP_ROTATION_0] = GC9XXX_MADCTL_BGR, + [QP_ROTATION_90] = GC9XXX_MADCTL_BGR | GC9XXX_MADCTL_MX | GC9XXX_MADCTL_MV, + [QP_ROTATION_180] = GC9XXX_MADCTL_BGR | GC9XXX_MADCTL_MX | GC9XXX_MADCTL_MY, + [QP_ROTATION_270] = GC9XXX_MADCTL_BGR | GC9XXX_MADCTL_MV | GC9XXX_MADCTL_MY, + }; + qp_comms_command_databyte(device, GC9XXX_SET_MEM_ACS_CTL, madctl[rotation]); + + return true; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Driver vtable +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +const tft_panel_dc_reset_painter_driver_vtable_t gc9107_driver_vtable = { + .base = + { + .init = qp_gc9107_init, + .power = qp_tft_panel_power, + .clear = qp_tft_panel_clear, + .flush = qp_tft_panel_flush, + .pixdata = qp_tft_panel_pixdata, + .viewport = qp_tft_panel_viewport, + .palette_convert = qp_tft_panel_palette_convert_rgb565_swapped, + .append_pixels = qp_tft_panel_append_pixels_rgb565, + .append_pixdata = qp_tft_panel_append_pixdata, + }, + .num_window_bytes = 2, + .swap_window_coords = false, + .opcodes = + { + .display_on = GC9XXX_CMD_DISPLAY_ON, + .display_off = GC9XXX_CMD_DISPLAY_OFF, + .set_column_address = GC9XXX_SET_COL_ADDR, + .set_row_address = GC9XXX_SET_ROW_ADDR, + .enable_writes = GC9XXX_SET_MEM, + }, +}; + +#ifdef QUANTUM_PAINTER_GC9107_SPI_ENABLE +// Factory function for creating a handle to the GC9107 device +painter_device_t qp_gc9107_make_spi_device(uint16_t panel_width, uint16_t panel_height, pin_t chip_select_pin, pin_t dc_pin, pin_t reset_pin, uint16_t spi_divisor, int spi_mode) { + for (uint32_t i = 0; i < GC9107_NUM_DEVICES; ++i) { + tft_panel_dc_reset_painter_device_t *driver = &gc9107_drivers[i]; + if (!driver->base.driver_vtable) { + driver->base.driver_vtable = (const painter_driver_vtable_t *)&gc9107_driver_vtable; + driver->base.comms_vtable = (const painter_comms_vtable_t *)&spi_comms_with_dc_vtable; + driver->base.native_bits_per_pixel = 16; // RGB565 + driver->base.panel_width = panel_width; + driver->base.panel_height = panel_height; + driver->base.rotation = QP_ROTATION_0; + driver->base.offset_x = 2; + driver->base.offset_y = 1; + + // SPI and other pin configuration + driver->base.comms_config = &driver->spi_dc_reset_config; + driver->spi_dc_reset_config.spi_config.chip_select_pin = chip_select_pin; + driver->spi_dc_reset_config.spi_config.divisor = spi_divisor; + driver->spi_dc_reset_config.spi_config.lsb_first = false; + driver->spi_dc_reset_config.spi_config.mode = spi_mode; + driver->spi_dc_reset_config.dc_pin = dc_pin; + driver->spi_dc_reset_config.reset_pin = reset_pin; + driver->spi_dc_reset_config.command_params_uses_command_pin = false; + + if (!qp_internal_register_device((painter_device_t)driver)) { + memset(driver, 0, sizeof(tft_panel_dc_reset_painter_device_t)); + return NULL; + } + + return (painter_device_t)driver; + } + } + return NULL; +} + +#endif // QUANTUM_PAINTER_GC9107_SPI_ENABLE diff --git a/drivers/painter/gc9xxx/qp_gc9107.h b/drivers/painter/gc9xxx/qp_gc9107.h new file mode 100644 index 00000000000..b0b08f76654 --- /dev/null +++ b/drivers/painter/gc9xxx/qp_gc9107.h @@ -0,0 +1,37 @@ +// Copyright 2024 Fernando Birra (@gr1mr3aver) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#include "gpio.h" +#include "qp_internal.h" + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Quantum Painter GC9107 configurables (add to your keyboard's config.h) + +#ifndef GC9107_NUM_DEVICES +/** + * @def This controls the maximum number of GC9107 devices that Quantum Painter can communicate with at any one time. + * Increasing this number allows for multiple displays to be used. + */ +# define GC9107_NUM_DEVICES 1 +#endif + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Quantum Painter GC9107 device factories + +#ifdef QUANTUM_PAINTER_GC9107_SPI_ENABLE +/** + * Factory method for an GC9107 SPI LCD device. + * + * @param panel_width[in] the width of the display panel + * @param panel_height[in] the height of the display panel + * @param chip_select_pin[in] the GPIO pin used for SPI chip select + * @param dc_pin[in] the GPIO pin used for D/C control + * @param reset_pin[in] the GPIO pin used for RST + * @param spi_divisor[in] the SPI divisor to use when communicating with the display + * @param spi_mode[in] the SPI mode to use when communicating with the display + * @return the device handle used with all drawing routines in Quantum Painter + */ +painter_device_t qp_gc9107_make_spi_device(uint16_t panel_width, uint16_t panel_height, pin_t chip_select_pin, pin_t dc_pin, pin_t reset_pin, uint16_t spi_divisor, int spi_mode); + +#endif // QUANTUM_PAINTER_GC9107_SPI_ENABLE diff --git a/drivers/painter/gc9xxx/qp_gc9107_opcodes.h b/drivers/painter/gc9xxx/qp_gc9107_opcodes.h new file mode 100644 index 00000000000..e9b308eb49b --- /dev/null +++ b/drivers/painter/gc9xxx/qp_gc9107_opcodes.h @@ -0,0 +1,135 @@ +// Copyright 2024 Fernando Birra +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Quantum Painter GC9107 command opcodes +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +#define GC9107_GET_POWER_MODE 0x0A // Get power mode +#define GC9107_GET_MADCTL 0x0B // Get MADCTL +#define GC9107_GET_PIXEL_FMT 0x0C // Get pixel format +#define GC9107_GET_IMAGE_FMT 0x0D // Get image format +#define GC9107_GET_SIGNAL_MODE 0x0E // Get signal mode +#define GC9107_GET_DIAG_RESULT 0x0F // Get self-diagnostic results + +#define GC9107_SET_FRAME_RATE 0xA8 // Set frame rate +#define GC9107_SET_COMPLEMENT_RGB 0xAC // Set complement Principle RGB +#define GC9107_SET_BLANK_PORCH 0xAD // Set blank porch control, 0;front_porch[6:0],0;back_porch[6:0] +#define GC9107_SET_FUNCTION_CTL1 0xB1 // Set access to AVDD_VCL_CLK and VGH_VGL_CLK commands +#define GC9107_SET_FUNCTION_CTL2 0xB2 // Set access to VGH, VGH control commands +#define GC9107_SET_FUNCTION_CTL3 0xB3 // Set access to Gamma control commands +#define GC9107_SET_DISPLAY_INVERSION 0xB4 // Set Display Inversion control +#define GC9107_SET_FUNCTION_CTL6 0xB6 // Set access to commands SET_FRAME_RATE, SET_COMPLEMENT_RGB and SET_BLANK_PORCH +#define GC9107_SET_CUSTOM_ID_INFO 0xD3 // Set customized display id information +#define GC9107_AVDD_VCL_CLK 0xE3 // AVDD_CLK +#define GC9107_SET_VGH 0xE8 // Set VGH +#define GC9107_SET_VGL 0xE9 // Set VGL +#define GC9107_SET_VGH_VGL_CLK 0xEA // Set VGH and VGL clock divisors + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// GC9107 Parameter constants + +// Parameter values for +// GC9107_SET_PIXEL_FORMAT +#define GC9107_PIXEL_FORMAT_12_BPP_IFPF (0b001 << 0) // 12 bits per pixel +#define GC9107_PIXEL_FORMAT_16_BPP_IFPF (0b101 << 0) // 16 bits per pixel +#define GC9107_PIXEL_FORMAT_18_BPP_IFPB (0b110 << 0) // 18 bits per pixel + +// Parameter values for +// GC9107_SET_COMPLEMENT_RGB +#define GC9107_COMPLEMENT_WITH_0 0x00 // R0 <- B0 <- 0, except if data is FFh +#define GC9107_COMPLEMENT_WITH_1 0x40 // R0 <- B0 <- 1, except if data is 00h +#define GC9107_COMPLEMENT_WITH_MSB 0x80 // R0 <- R5, B0 <- B5 +#define GC9107_COMPLEMENT_WITH_LSB 0xC0 // R0 <- B0 <- G0 +// Parameter masks for +// GC9107_SET_FUNCTION_CTL1 +#define GC9107_ALLOW_AVDD_VCL_CLK 0b00001000 // Allow AVDD_VCL_CLK command +// Parameter masks for +// GC9107_SET_FUNCTION_CTL2 +#define GC9107_ALLOW_SET_VGH 0b00000001 // Allow GC9107_SET_VGH +#define GC9107_ALLOW_SET_VGL 0b00000010 // Allow GC9107_SET_VGL +#define GC9107_ALLOW_SET_VGH_VGL_CLK 0b00000100 // Allow GC9107_SET_VGH_VGL_CLK +// Parameter masks for +// GC9107_SET_FUNCTION_CTL3 +#define GC9107_ALLOW_SET_GAMMA1 0b00000001 // Allow GC9107_SET_GAMMA1 +#define GC9107_ALLOW_SET_GAMMA2 0b00000010 // Allow GC9107_SET_GAMMA2 +// Parameter mask for +// GC9107_SET_FUNCTION_CTL6 +#define GC9107_ALLOW_SET_FRAMERATE 0b000000001 // Allow GC9107_SET_FRAME_RATE +#define GC9107_ALLOW_SET_COMPLEMENT_RGB 0b000010000 // Allow GC9107_SET_COMPLEMENT_RGB +#define GC9107_ALLOW_SET_BLANK_PORCH 0b000100000 // Allow GFC9107_SET_BLANK_PORCH +// Parameter values for +// AVDD_CLK_AD part (Most significant nibble) +#define GC9107_AVDD_CLK_AD_2T 0x00 +#define GC9107_AVDD_CLK_AD_3T 0x10 +#define GC9107_AVDD_CLK_AD_4T 0x20 +#define GC9107_AVDD_CLK_AD_5T 0x30 +#define GC9107_AVDD_CLK_AD_6T 0x40 +#define GC9107_AVDD_CLK_AD_7T 0x50 +#define GC9107_AVDD_CLK_AD_8T 0x60 +#define GC9107_AVDD_CLK_AD_9T 0x70 +// Parameter values for +// VCL_CLK_AD part (Least significant nibble) +#define GC9107_VCL_CLK_AD_2T 0x00 +#define GC9107_VCL_CLK_AD_3T 0x01 +#define GC9107_VCL_CLK_AD_4T 0x02 +#define GC9107_VCL_CLK_AD_5T 0x03 +#define GC9107_VCL_CLK_AD_6T 0x04 +#define GC9107_VCL_CLK_AD_7T 0x05 +#define GC9107_VCL_CLK_AD_8T 0x06 +#define GC9107_VCL_CLK_AD_9T 0x07 +// Parameter values for +// GC9107_SET_VGH +#define GC9107_VGH_P100 0x20 // +10 V +#define GC9107_VGH_P110 0x21 // +11 V +#define GC9107_VGH_P120 0x22 // +12 V +#define GC9107_VGH_P130 0x23 // +13 V +#define GC9107_VGH_P140 0x24 // +14 V +#define GC9107_VGH_P150 0x25 // +15 V +// Parameter values for +// GC9107_SET_VGL +#define VGL_N_075 0x40 // -7.5 V +#define VGL_N_085 0x41 // -8.5 V +#define VGL_N_095 0x42 // -9.5 V +#define VGL_N_100 0x43 // -10.0 V +#define VGL_N_105 0x44 // -10.5 V +#define VGL_N_110 0x45 // -11.0 V +#define VGL_N_120 0x46 // -12.0 V +#define VGL_N_130 0x47 // -13.0 V +// Parameter masks for +// GC9107_SET_VGH_VGL_CLK (VGH Divisor) +#define GC9107_VGH_CLK_DIV_2 0x00 // Clock divisor = 2 -> 6.0 Mhz +#define GC9107_VGH_CLK_DIV_3 0x10 // Clock divisor = 3 -> 4.0 Mhz +#define GC9107_VGH_CLK_DIV_4 0x20 // Clock divisor = 4 -> 3.0 Mhz +#define GC9107_VGH_CLK_DIV_5 0x30 // Clock divisor = 5 -> 2.4 Mhz +#define GC9107_VGH_CLK_DIV_6 0x40 // Clock divisor = 6 -> 2.0 Mhz +#define GC9107_VGH_CLK_DIV_7 0x50 // Clock divisor = 7 -> 1.7 Mhz +#define GC9107_VGH_CLK_DIV_8 0x60 // Clock divisor = 8 -> 1.5 Mhz +#define GC9107_VGH_CLK_DIV_9 0x70 // Clock divisor = 9 -> 1.3 Mhz +#define GC9107_VGH_CLK_DIV_10 0x80 // Clock divisor = 10 -> 1.2 Mhz +#define GC9107_VGH_CLK_DIV_12 0x90 // Clock divisor = 12 -> 1.0 Mhz +#define GC9107_VGH_CLK_DIV_15 0xA0 // Clock divisor = 15 -> 0.8 Mhz +#define GC9107_VGH_CLK_DIV_20 0xB0 // Clock divisor = 20 -> 0.6 Mhz +#define GC9107_VGH_CLK_DIV_24 0xC0 // Clock divisor = 24 -> 0.5 Mhz +#define GC9107_VGH_CLK_DIV_30 0xD0 // Clock divisor = 30 -> 0.4 Mhz +#define GC9107_VGH_CLK_DIV_40 0xE0 // Clock divisor = 40 -> 0.3 Mhz +#define GC9107_VGH_CLK_DIV_60 0xE0 // Clock divisor = 40 -> 0.2 Mhz +// Parameter masks for +// GC9107_SET_VGH_VGL_CLK (VGL Divisor) +#define GC9107_VGL_CLK_DIV_2 0x00 // Clock divisor = 2 -> 6.0 Mhz +#define GC9107_VGL_CLK_DIV_3 0x01 // Clock divisor = 3 -> 4.0 Mhz +#define GC9107_VGL_CLK_DIV_4 0x02 // Clock divisor = 4 -> 3.0 Mhz +#define GC9107_VGL_CLK_DIV_5 0x03 // Clock divisor = 5 -> 2.4 Mhz +#define GC9107_VGL_CLK_DIV_6 0x04 // Clock divisor = 6 -> 2.0 Mhz +#define GC9107_VGL_CLK_DIV_7 0x05 // Clock divisor = 7 -> 1.7 Mhz +#define GC9107_VGL_CLK_DIV_8 0x06 // Clock divisor = 8 -> 1.5 Mhz +#define GC9107_VGL_CLK_DIV_9 0x07 // Clock divisor = 9 -> 1.3 Mhz +#define GC9107_VGL_CLK_DIV_10 0x08 // Clock divisor = 10 -> 1.2 Mhz +#define GC9107_VGL_CLK_DIV_12 0x09 // Clock divisor = 12 -> 1.0 Mhz +#define GC9107_VGL_CLK_DIV_15 0x0A // Clock divisor = 15 -> 0.8 Mhz +#define GC9107_VGL_CLK_DIV_20 0x0B // Clock divisor = 20 -> 0.6 Mhz +#define GC9107_VGL_CLK_DIV_24 0x0C // Clock divisor = 24 -> 0.5 Mhz +#define GC9107_VGL_CLK_DIV_30 0x0D // Clock divisor = 30 -> 0.4 Mhz +#define GC9107_VGL_CLK_DIV_40 0x0E // Clock divisor = 40 -> 0.3 Mhz +#define GC9107_VGL_CLK_DIV_60 0x0E // Clock divisor = 40 -> 0.2 Mhz diff --git a/drivers/painter/gc9a01/qp_gc9a01.c b/drivers/painter/gc9xxx/qp_gc9a01.c similarity index 61% rename from drivers/painter/gc9a01/qp_gc9a01.c rename to drivers/painter/gc9xxx/qp_gc9a01.c index fe6fa7a9d02..f037a4cc87b 100644 --- a/drivers/painter/gc9a01/qp_gc9a01.c +++ b/drivers/painter/gc9xxx/qp_gc9a01.c @@ -5,6 +5,7 @@ #include "qp_internal.h" #include "qp_comms.h" #include "qp_gc9a01.h" +#include "qp_gc9xxx_opcodes.h" #include "qp_gc9a01_opcodes.h" #include "qp_tft_panel.h" @@ -20,71 +21,40 @@ tft_panel_dc_reset_painter_device_t gc9a01_drivers[GC9A01_NUM_DEVICES] = {0}; __attribute__((weak)) bool qp_gc9a01_init(painter_device_t device, painter_rotation_t rotation) { // A lot of these "unknown" opcodes are sourced from other OSS projects and are seemingly required for this display to function. // clang-format off + const uint8_t gc9a01_init_sequence[] = { // Command, Delay, N, Data[N] - GC9A01_SET_INTER_REG_ENABLE2, 0, 0, - 0xEB, 0, 1, 0x14, - GC9A01_SET_INTER_REG_ENABLE1, 0, 0, - GC9A01_SET_INTER_REG_ENABLE2, 0, 0, - 0xEB, 0, 1, 0x14, + GC9XXX_SET_INTER_REG_ENABLE1, 0, 0, + GC9XXX_SET_INTER_REG_ENABLE2, 0, 0, 0x84, 0, 1, 0x40, - 0x85, 0, 1, 0xFF, - 0x86, 0, 1, 0xFF, - 0x87, 0, 1, 0xFF, - 0x88, 0, 1, 0x0A, - 0x89, 0, 1, 0x21, - 0x8a, 0, 1, 0x00, - 0x8b, 0, 1, 0x80, - 0x8c, 0, 1, 0x01, - 0x8d, 0, 1, 0x01, - 0x8e, 0, 1, 0xFF, - 0x8f, 0, 1, 0xFF, - GC9A01_SET_FUNCTION_CTL, 0, 2, 0x00, 0x20, - GC9A01_SET_PIX_FMT, 0, 1, 0x55, - 0x90, 0, 4, 0x08, 0x08, 0x08, 0x08, - 0xBD, 0, 1, 0x06, - 0xBC, 0, 1, 0x00, - 0xFF, 0, 3, 0x60, 0x01, 0x04, - GC9A01_SET_POWER_CTL_2, 0, 1, 0x13, - GC9A01_SET_POWER_CTL_3, 0, 1, 0x13, + GC9A01_SET_FUNCTION_CTL, 0, 3, 0x00, GC9A01_SOURCE_OUTPUT_SCAN_DIRECTION_S360_TO_S1 | GC9A01_GATE_OUTPUT_SCAN_DIRECTION_G1_TO_G32, GC9A01_LCD_DRIVE_LINE_240, // Only works if the previous command is present (undocumented) + GC9A01_SET_POWER_CTL_2, 0, 1, 0x20, + GC9A01_SET_POWER_CTL_3, 0, 1, 0x20, GC9A01_SET_POWER_CTL_4, 0, 1, 0x22, - 0xBE, 0, 1, 0x11, - 0xE1, 0, 2, 0x10, 0x0E, - 0xDF, 0, 3, 0x21, 0x0C, 0x02, - GC9A01_SET_GAMMA1, 0, 6, 0x45, 0x09, 0x08, 0x08, 0x26, 0x2A, - GC9A01_SET_GAMMA2, 0, 6, 0x43, 0x70, 0x72, 0x36, 0x37, 0x6F, + GC9XXX_SET_GAMMA1, 0, 6, 0x45, 0x09, 0x08, 0x08, 0x26, 0x2A, + GC9XXX_SET_GAMMA2, 0, 6, 0x43, 0x70, 0x72, 0x36, 0x37, 0x6F, GC9A01_SET_GAMMA3, 0, 6, 0x45, 0x09, 0x08, 0x08, 0x26, 0x2A, GC9A01_SET_GAMMA4, 0, 6, 0x43, 0x70, 0x72, 0x36, 0x37, 0x6F, - 0xED, 0, 2, 0x1B, 0x0B, - 0xAE, 0, 1, 0x77, - 0xCD, 0, 1, 0x63, - 0x70, 0, 9, 0x07, 0x07, 0x04, 0x0E, 0x0F, 0x09, 0x07, 0x08, 0x03, - GC9A01_SET_FRAME_RATE, 0, 1, 0x34, - 0x62, 0, 12, 0x18, 0x0D, 0x71, 0xED, 0x70, 0x70, 0x18, 0x0F, 0x71, 0xEF, 0x70, 0x70, - 0x63, 0, 12, 0x18, 0x11, 0x71, 0xF1, 0x70, 0x70, 0x18, 0x13, 0x71, 0xF3, 0x70, 0x70, - 0x64, 0, 7, 0x28, 0x29, 0xF1, 0x01, 0xF1, 0x00, 0x07, 0x66, 0, 10, 0x3C, 0x00, 0xCD, 0x67, 0x45, 0x45, 0x10, 0x00, 0x00, 0x00, 0x67, 0, 10, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x01, 0x54, 0x10, 0x32, 0x98, - 0x74, 0, 7, 0x10, 0x85, 0x80, 0x00, 0x00, 0x4E, 0x00, - 0x98, 0, 2, 0x3E, 0x07, - GC9A01_CMD_TEARING_OFF, 0, 0, - GC9A01_CMD_INVERT_OFF, 0, 0, - GC9A01_CMD_SLEEP_OFF, 120, 0, - GC9A01_CMD_DISPLAY_ON, 20, 0 + GC9XXX_CMD_TEARING_ON, 0, 0, + GC9XXX_SET_PIXEL_FORMAT, 0, 1, GC9A01_PIXEL_FORMAT_16_BPP_DBI, + GC9XXX_CMD_INVERT_ON, 0, 0, + GC9XXX_CMD_SLEEP_OFF, 120, 0, + GC9XXX_CMD_DISPLAY_ON, 20, 0 }; // clang-format on - // clang-format on qp_comms_bulk_command_sequence(device, gc9a01_init_sequence, sizeof(gc9a01_init_sequence)); // Configure the rotation (i.e. the ordering and direction of memory writes in GRAM) const uint8_t madctl[] = { - [QP_ROTATION_0] = GC9A01_MADCTL_BGR, - [QP_ROTATION_90] = GC9A01_MADCTL_BGR | GC9A01_MADCTL_MX | GC9A01_MADCTL_MV, - [QP_ROTATION_180] = GC9A01_MADCTL_BGR | GC9A01_MADCTL_MX | GC9A01_MADCTL_MY, - [QP_ROTATION_270] = GC9A01_MADCTL_BGR | GC9A01_MADCTL_MV | GC9A01_MADCTL_MY, + [QP_ROTATION_0] = GC9XXX_MADCTL_BGR, + [QP_ROTATION_90] = GC9XXX_MADCTL_BGR | GC9XXX_MADCTL_MX | GC9XXX_MADCTL_MV, + [QP_ROTATION_180] = GC9XXX_MADCTL_BGR | GC9XXX_MADCTL_MX | GC9XXX_MADCTL_MY, + [QP_ROTATION_270] = GC9XXX_MADCTL_BGR | GC9XXX_MADCTL_MV | GC9XXX_MADCTL_MY, }; - qp_comms_command_databyte(device, GC9A01_SET_MEM_ACS_CTL, madctl[rotation]); + qp_comms_command_databyte(device, GC9XXX_SET_MEM_ACS_CTL, madctl[rotation]); return true; } @@ -110,11 +80,11 @@ const tft_panel_dc_reset_painter_driver_vtable_t gc9a01_driver_vtable = { .swap_window_coords = false, .opcodes = { - .display_on = GC9A01_CMD_DISPLAY_ON, - .display_off = GC9A01_CMD_DISPLAY_OFF, - .set_column_address = GC9A01_SET_COL_ADDR, - .set_row_address = GC9A01_SET_PAGE_ADDR, - .enable_writes = GC9A01_SET_MEM, + .display_on = GC9XXX_CMD_DISPLAY_ON, + .display_off = GC9XXX_CMD_DISPLAY_OFF, + .set_column_address = GC9XXX_SET_COL_ADDR, + .set_row_address = GC9XXX_SET_ROW_ADDR, + .enable_writes = GC9XXX_SET_MEM, }, }; diff --git a/drivers/painter/gc9a01/qp_gc9a01.h b/drivers/painter/gc9xxx/qp_gc9a01.h similarity index 100% rename from drivers/painter/gc9a01/qp_gc9a01.h rename to drivers/painter/gc9xxx/qp_gc9a01.h diff --git a/drivers/painter/gc9xxx/qp_gc9a01_opcodes.h b/drivers/painter/gc9xxx/qp_gc9a01_opcodes.h new file mode 100644 index 00000000000..5853902e683 --- /dev/null +++ b/drivers/painter/gc9xxx/qp_gc9a01_opcodes.h @@ -0,0 +1,104 @@ +// Copyright 2021 Paul Cotter (@gr1mr3aver) +// Copyright 2024 Fernando Birra +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Quantum Painter GC9A01 command opcodes +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +#define GC9A01_SET_MEM_CONT 0x3C // Set memory continue +#define GC9A01_SET_BRIGHTNESS 0x51 // Set brightness +#define GC9A01_SET_DISPLAY_CTL 0x53 // Set display ctl + +#define GC9A01_SET_RGB_IF_SIG_CTL 0xB0 // RGB IF signal ctl +#define GC9A01_SET_BLANKING_PORCH_CTL 0xB5 // Set blanking porch ctl +#define GC9A01_SET_FUNCTION_CTL 0xB6 // Set function ctl +#define GC9A01_SET_TEARING_EFFECT 0xBA // Set tering effect control +#define GC9A01_SET_POWER_CTL_7 0xA7 // Set power ctl 7 +#define GC9A01_SET_POWER_CTL_1 0xC1 // Set power ctl 1 +#define GC9A01_SET_POWER_CTL_2 0xC3 // Set power ctl 2 +#define GC9A01_SET_POWER_CTL_3 0xC4 // Set power ctl 3 +#define GC9A01_SET_POWER_CTL_4 0xC9 // Set power ctl 4 +#define GC9A01_SET_FRAME_RATE 0xE8 // Set frame rate +#define GC9A01_SET_SPI_2DATA 0xE9 // Set frame rate +#define GC9A01_SET_GAMMA3 0xF2 // Set gamma 3 +#define GC9A01_SET_GAMMA4 0xF3 // Set gamma 4 +#define GC9A01_SET_IF_CTL 0xF6 // Set interface control + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// GC9A01 MADCTL Flags +#define GC9A01_MADCTL_MH 0b00000100 + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// GC9A01 Parameter constants + +// Parameter values for +// GC9A01_SET_PIXEL_FORMAT +#define GC9A01_PIXEL_FORMAT_12_BPP_DBI (0b011 << 0) // 12 bits/pixel MCU interface format +#define GC9A01_PIXEL_FORMAT_16_BPP_DBI (0b101 << 0) // 16 bits/pixel MCU interface format +#define GC9A01_PIXEL_FORMAT_18_BPP_DBI (0b110 << 0) // 18 bits/pixel MCU interface format +#define GC9A01_PIXEL_FORMAT_16_BPP_DPI (0b101 << 4) // 16 bits/pixel RGB interface format +#define GC9A01_PIXEL_FORMAT_18_BPP_DPI (0b110 << 4) // 18 bits/pixel RGB interface format + +// Parameter values for +// GC9A01_SET_FUNCTION_CTL (2nd parameter) +#define GC9A01_SOURCE_OUTPUT_SCAN_DIRECTION_S1_TO_S360 0b00000000 +#define GC9A01_SOURCE_OUTPUT_SCAN_DIRECTION_S360_TO_S1 0b00100000 +#define GC9A01_GATE_OUTPUT_SCAN_DIRECTION_G1_TO_G32 0b00000000 +#define GC9A01_GATE_OUTPUT_SCAN_DIRECTION_G32_TO_G1 0b01000000 +#define GC9A01_SCAN_MODE_INTER 0x10 + +// Parameter values for +// GC9A01_SET_FUNCTION_CTL (3rd parameter) +#define GC9A01_LCD_DRIVE_LINE_16 0x01 +#define GC9A01_LCD_DRIVE_LINE_24 0x02 +#define GC9A01_LCD_DRIVE_LINE_32 0x03 +#define GC9A01_LCD_DRIVE_LINE_40 0x04 +#define GC9A01_LCD_DRIVE_LINE_48 0x05 +#define GC9A01_LCD_DRIVE_LINE_56 0x06 +#define GC9A01_LCD_DRIVE_LINE_64 0x07 +#define GC9A01_LCD_DRIVE_LINE_72 0x08 +#define GC9A01_LCD_DRIVE_LINE_80 0x09 +#define GC9A01_LCD_DRIVE_LINE_88 0x0A +#define GC9A01_LCD_DRIVE_LINE_96 0x0B +#define GC9A01_LCD_DRIVE_LINE_104 0x0C +#define GC9A01_LCD_DRIVE_LINE_112 0x0D +#define GC9A01_LCD_DRIVE_LINE_120 0x0E +#define GC9A01_LCD_DRIVE_LINE_128 0x0F +#define GC9A01_LCD_DRIVE_LINE_136 0x10 +#define GC9A01_LCD_DRIVE_LINE_144 0x11 +#define GC9A01_LCD_DRIVE_LINE_152 0x12 +#define GC9A01_LCD_DRIVE_LINE_160 0x13 +#define GC9A01_LCD_DRIVE_LINE_168 0x14 +#define GC9A01_LCD_DRIVE_LINE_176 0x15 +#define GC9A01_LCD_DRIVE_LINE_184 0x16 +#define GC9A01_LCD_DRIVE_LINE_192 0x17 +#define GC9A01_LCD_DRIVE_LINE_200 0x18 +#define GC9A01_LCD_DRIVE_LINE_208 0x19 +#define GC9A01_LCD_DRIVE_LINE_216 0x1A +#define GC9A01_LCD_DRIVE_LINE_224 0x1B +#define GC9A01_LCD_DRIVE_LINE_232 0x1C +#define GC9A01_LCD_DRIVE_LINE_240 0x1D + +// Parameter values for +// GC9A01_SET_DISPLAY_CTL +#define GC9A01_BRIGHTNESS_CONTROL_ON 0b00100000 +#define GC9A01_DIMMING_ON 0b00001000 +#define GC9A01_BACKLIGHT_ON 0b00000100 +#define GC9A01_BRIGHTNESS_CONTROL_OFF 0b00000000 +#define GC9A01_DIMMING_OFF 0b00000000 +#define GC9A01_BACKLIGHT_OFF 0b00000000 + +// Parameter values for +// GC9A01_SET_IF_CTL +#define GC9A01_DISPLAY_MODE_INTERNAL_CLOCK 0b00000000 +#define GC9A01_DISPLAY_MODE_RGB_INTERFACE 0b00000100 +#define GC9A01_DISPLAY_MODE_VSYNC_INTERFACE 0b00001000 +#define GC9A01_DSISPLAY_MODE_DISABLED 0b00001100 + +#define GC0A01_GRAM_INTERFACE_VSYNC 0b00000000 +#define GC9A01_GRAM_INTERFACE_RGB 0b00000010 + +#define GC9A01_RGB_INTERFACE_MODE_1_TRANSFER 0b00000000 +#define GC9A01_RGB_INTERFACE_MODE_3_TRANSFER 0b00000001 \ No newline at end of file diff --git a/drivers/painter/gc9xxx/qp_gc9xxx_opcodes.h b/drivers/painter/gc9xxx/qp_gc9xxx_opcodes.h new file mode 100644 index 00000000000..7e0fbf9110b --- /dev/null +++ b/drivers/painter/gc9xxx/qp_gc9xxx_opcodes.h @@ -0,0 +1,55 @@ +// Copyright 2021 Paul Cotter (@gr1mr3aver) +// Copyright 2024 Fernando Birra +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Quantum Painter GC9xxx command opcodes +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +#define GC9XXX_GET_ID_INFO 0x04 // Get ID information +#define GC9XXX_GET_STATUS 0x09 // Get status + +#define GC9XXX_CMD_SLEEP_ON 0x10 // Enter sleep mode +#define GC9XXX_CMD_SLEEP_OFF 0x11 // Exit sleep mode +#define GC9XXX_CMD_PARTIAL_ON 0x12 // Enter partial mode +#define GC9XXX_CMD_PARTIAL_OFF 0x13 // Exit partial mode + +#define GC9XXX_CMD_INVERT_OFF 0x20 // Exit inverted mode +#define GC9XXX_CMD_INVERT_ON 0x21 // Enter inverted mode +#define GC9XXX_CMD_DISPLAY_OFF 0x28 // Disable display +#define GC9XXX_CMD_DISPLAY_ON 0x29 // Enable display +#define GC9XXX_SET_COL_ADDR 0x2A // Set column address (MSB(StartCol),LSB(StartCol),MSB(EndCol),LSB(EndCol) +#define GC9XXX_SET_ROW_ADDR 0x2B // Set row address (MSB(StartRow),LSB(StartRow),MSB(EndRow),LSB(EndRow) +#define GC9XXX_SET_MEM 0x2C // Set (write) memory + +#define GC9XXX_SET_PARTIAL_AREA 0x30 // Set partial area (MSB(StartRow),LSB(StartRow),MSB(EndRow),LSB(EndRow) +#define GC9XXX_SET_VSCROLL 0x33 // Set vertical scroll MSB(TFA),LSB(TFA),MSB(VSA),LSB(VSA)+ GC9107 extra param: MSB(BFA),LSB(BFA) +#define GC9XXX_CMD_TEARING_OFF 0x34 // Tearing effect line OFF +#define GC9XXX_CMD_TEARING_ON 0x35 // Tearing effect line ON +#define GC9XXX_SET_MEM_ACS_CTL 0x36 // Set mem access ctl +#define GC9XXX_SET_VSCROLL_ADDR 0x37 // Set vscroll start addr +#define GC9XXX_CMD_IDLE_OFF 0x38 // Exit idle mode +#define GC9XXX_CMD_IDLE_ON 0x39 // Enter idle mode +#define GC9XXX_SET_PIXEL_FORMAT 0x3A // Set pixel format +#define GC9XXX_SET_TEAR_SCANLINE 0x44 // Set tearing scanline (Scanline = LS bit of Param 1 (GC9A01) + Param 2(GC9XXX)) +#define GC9XXX_GET_TEAR_SCANLINE 0x45 // Get tearing scanline (Scanline = LS bit of Param 1 (GC9A01) + Param 2(GC9XXX)) +#define GC9XXX_GET_ID1 0xDA // Get ID1 +#define GC9XXX_GET_ID2 0xDB // Get ID2 +#define GC9XXX_GET_ID3 0xDC // Get ID3 +#define GC9XXX_SET_INTER_REG_ENABLE1 0xFE // Enable Inter Register 1 +#define GC9XXX_SET_INTER_REG_ENABLE2 0xEF // Enable Inter Register 2 +#define GC9XXX_SET_GAMMA1 0xF0 // Set gamma 1 +#define GC9XXX_SET_GAMMA2 0xF1 // Set gamma 2 + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// MADCTL Flags +#define GC9XXX_MADCTL_MY 0b10000000 // Mirror Y (row address order) +#define GC9XXX_MADCTL_MX 0b01000000 // Mirror X (column address order) +#define GC9XXX_MADCTL_MV 0b00100000 // Vertical Refresh Order (bottom to top) +#define GC9XXX_MADCTL_ML 0b00010000 +#define GC9XXX_MADCTL_BGR 0b00001000 +#define GC9XXX_MADCTL_RGB 0b00000000 + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// GC9XXX Parameter constants diff --git a/quantum/painter/qp.h b/quantum/painter/qp.h index 02acbf589a3..820c418f43b 100644 --- a/quantum/painter/qp.h +++ b/quantum/painter/qp.h @@ -539,6 +539,12 @@ int16_t qp_drawtext_recolor(painter_device_t device, uint16_t x, uint16_t y, pai # define GC9A01_NUM_DEVICES 0 #endif // QUANTUM_PAINTER_GC9A01_ENABLE +#ifdef QUANTUM_PAINTER_GC9107_ENABLE +# include "qp_gc9107.h" +#else // QUANTUM_PAINTER_GC9107_ENABLE +# define GC9107_NUM_DEVICES 0 +#endif // QUANTUM_PAINTER_GC9107_ENABLE + #ifdef QUANTUM_PAINTER_SSD1351_ENABLE # include "qp_ssd1351.h" #else // QUANTUM_PAINTER_SSD1351_ENABLE diff --git a/quantum/painter/qp_internal.c b/quantum/painter/qp_internal.c index 1f0f9817967..7d4a6430afe 100644 --- a/quantum/painter/qp_internal.c +++ b/quantum/painter/qp_internal.c @@ -16,6 +16,7 @@ enum { + (ST7789_NUM_DEVICES) // ST7789 + (ST7735_NUM_DEVICES) // ST7735 + (GC9A01_NUM_DEVICES) // GC9A01 + + (GC9107_NUM_DEVICES) // GC9107 + (SSD1351_NUM_DEVICES) // SSD1351 + (SH1106_NUM_DEVICES) // SH1106 }; diff --git a/quantum/painter/rules.mk b/quantum/painter/rules.mk index d991a6d7423..7b2ab702ee1 100644 --- a/quantum/painter/rules.mk +++ b/quantum/painter/rules.mk @@ -14,6 +14,7 @@ VALID_QUANTUM_PAINTER_DRIVERS := \ st7735_spi \ st7789_spi \ gc9a01_spi \ + gc9107_spi \ ssd1351_spi \ sh1106_i2c \ sh1106_spi @@ -131,10 +132,21 @@ define handle_quantum_painter_driver OPT_DEFS += -DQUANTUM_PAINTER_GC9A01_ENABLE -DQUANTUM_PAINTER_GC9A01_SPI_ENABLE COMMON_VPATH += \ $(DRIVER_PATH)/painter/tft_panel \ - $(DRIVER_PATH)/painter/gc9a01 + $(DRIVER_PATH)/painter/gc9xxx SRC += \ $(DRIVER_PATH)/painter/tft_panel/qp_tft_panel.c \ - $(DRIVER_PATH)/painter/gc9a01/qp_gc9a01.c + $(DRIVER_PATH)/painter/gc9xxx/qp_gc9a01.c + + else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),gc9107_spi) + QUANTUM_PAINTER_NEEDS_COMMS_SPI := yes + QUANTUM_PAINTER_NEEDS_COMMS_SPI_DC_RESET := yes + OPT_DEFS += -DQUANTUM_PAINTER_GC9107_ENABLE -DQUANTUM_PAINTER_GC9107_SPI_ENABLE + COMMON_VPATH += \ + $(DRIVER_PATH)/painter/tft_panel \ + $(DRIVER_PATH)/painter/gc9xxx + SRC += \ + $(DRIVER_PATH)/painter/tft_panel/qp_tft_panel.c \ + $(DRIVER_PATH)/painter/gc9xxx/qp_gc9107.c else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),ssd1351_spi) QUANTUM_PAINTER_NEEDS_COMMS_SPI := yes From 333f8bf0d7a4f3efd56a60a5328d15b1e0be4942 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 8 Jun 2024 18:08:53 -0700 Subject: [PATCH 006/204] Add STM32F405RG ld script for tinyuf2 (#23885) --- .../boards/common/ld/STM32F405xG_tinyuf2.ld | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 platforms/chibios/boards/common/ld/STM32F405xG_tinyuf2.ld diff --git a/platforms/chibios/boards/common/ld/STM32F405xG_tinyuf2.ld b/platforms/chibios/boards/common/ld/STM32F405xG_tinyuf2.ld new file mode 100644 index 00000000000..1ee4aa1a06c --- /dev/null +++ b/platforms/chibios/boards/common/ld/STM32F405xG_tinyuf2.ld @@ -0,0 +1,89 @@ +/* + ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * STM32F405xG memory setup. + * Note: Use of ram1 and ram2 is mutually exclusive with use of ram0. + */ +MEMORY +{ + flash0 (rx) : org = 0x08000000 + 64k, len = 1M - 64k /* tinyuf2 bootloader requires app to be located at 64k offset for this MCU */ + flash1 (rx) : org = 0x00000000, len = 0 + flash2 (rx) : org = 0x00000000, len = 0 + flash3 (rx) : org = 0x00000000, len = 0 + flash4 (rx) : org = 0x00000000, len = 0 + flash5 (rx) : org = 0x00000000, len = 0 + flash6 (rx) : org = 0x00000000, len = 0 + flash7 (rx) : org = 0x00000000, len = 0 + ram0 (wx) : org = 0x20000000, len = 128k /* SRAM1 + SRAM2 */ + ram1 (wx) : org = 0x20000000, len = 112k /* SRAM1 */ + ram2 (wx) : org = 0x2001C000, len = 16k /* SRAM2 */ + ram3 (wx) : org = 0x00000000, len = 0 + ram4 (wx) : org = 0x10000000, len = 64k /* CCM SRAM */ + ram5 (wx) : org = 0x40024000, len = 4k /* BCKP SRAM */ + ram6 (wx) : org = 0x00000000, len = 0 + ram7 (wx) : org = 0x00000000, len = 0 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +/* Generic rules inclusion.*/ +INCLUDE rules.ld + +/* TinyUF2 bootloader reset support */ +_board_dfu_dbl_tap = ORIGIN(ram0) + 64k - 4; /* this is based off the linker file for tinyuf2 */ From 4926f0de8b9b05a2c3435a12b9b70f97e606b57c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=95=E3=82=A3=E3=83=AB=E3=82=BF=E3=83=BC=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=83=91=E3=83=BC?= <76888457+filterpaper@users.noreply.github.com> Date: Mon, 10 Jun 2024 01:57:08 +0800 Subject: [PATCH 007/204] [Keyboard] Fixup mt/mt84 (#23883) --- keyboards/mt/mt84/config.h | 18 +++--------------- keyboards/mt/mt84/keyboard.json | 1 - keyboards/mt/mt84/keymaps/default/keymap.c | 18 +++--------------- keyboards/mt/mt84/keymaps/via/keymap.c | 18 +++--------------- keyboards/mt/mt84/mt84.c | 18 +++--------------- 5 files changed, 12 insertions(+), 61 deletions(-) diff --git a/keyboards/mt/mt84/config.h b/keyboards/mt/mt84/config.h index 9b115d527d5..4a6ed1492ea 100644 --- a/keyboards/mt/mt84/config.h +++ b/keyboards/mt/mt84/config.h @@ -1,18 +1,6 @@ - /* Copyright 2020 MT <704340378@qq.com> - * - * 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 . - */ +// Copyright 2020 MaiKong<704340378@qq.com> +// SPDX-License-Identifier: GPL-2.0+ + #pragma once #define IS31FL3737_I2C_ADDRESS_1 IS31FL3737_I2C_ADDRESS_GND diff --git a/keyboards/mt/mt84/keyboard.json b/keyboards/mt/mt84/keyboard.json index 8833f77ed98..a76336e7edd 100644 --- a/keyboards/mt/mt84/keyboard.json +++ b/keyboards/mt/mt84/keyboard.json @@ -43,7 +43,6 @@ "hue_wave": true, "pixel_rain": true, "pixel_flow": true, - "pixel_fractal": true, "solid_reactive_simple": true, "solid_reactive": true, "solid_reactive_wide": true, diff --git a/keyboards/mt/mt84/keymaps/default/keymap.c b/keyboards/mt/mt84/keymaps/default/keymap.c index e3c7fa8b879..2b3371257c6 100644 --- a/keyboards/mt/mt84/keymaps/default/keymap.c +++ b/keyboards/mt/mt84/keymaps/default/keymap.c @@ -1,18 +1,6 @@ - /* Copyright 2020 mt<704340378@qq.com> - * - * 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 . - */ +// Copyright 2020 MaiKong<704340378@qq.com> +// SPDX-License-Identifier: GPL-2.0 + #include QMK_KEYBOARD_H diff --git a/keyboards/mt/mt84/keymaps/via/keymap.c b/keyboards/mt/mt84/keymaps/via/keymap.c index 6906ddf9fe3..906ed635ad0 100644 --- a/keyboards/mt/mt84/keymaps/via/keymap.c +++ b/keyboards/mt/mt84/keymaps/via/keymap.c @@ -1,18 +1,6 @@ - /* Copyright 2020 MaiKong<704340378@qq.com> - * - * 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 . - */ +// Copyright 2020 MaiKong<704340378@qq.com> +// SPDX-License-Identifier: GPL-2.0+ + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/mt/mt84/mt84.c b/keyboards/mt/mt84/mt84.c index 276c92fc065..f7e1503cea4 100644 --- a/keyboards/mt/mt84/mt84.c +++ b/keyboards/mt/mt84/mt84.c @@ -1,18 +1,6 @@ - /* Copyright 2020 MT<704340378@qq.com> - * - * 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 . - */ +// Copyright 2020 MaiKong<704340378@qq.com> +// SPDX-License-Identifier: GPL-2.0+ + #include "quantum.h" #ifdef RGB_MATRIX_ENABLE From 354a2e40cf8348d043d39b34ca63223f6b5b689c Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 11 Jun 2024 13:25:51 +1000 Subject: [PATCH 008/204] splitkb/kyria: remove `CONVERT_TO` at keyboard level (#23857) --- keyboards/splitkb/kyria/info.json | 1 - .../splitkb/kyria/rev1/base/keyboard.json | 25 ++++++++++++-- keyboards/splitkb/kyria/rev1/config.h | 30 ++-------------- keyboards/splitkb/kyria/rev1/info.json | 17 ---------- .../splitkb/kyria/rev1/proton_c/config.h | 17 ++++++++++ .../splitkb/kyria/rev1/proton_c/keyboard.json | 23 ++++++++++++- .../splitkb/kyria/rev1/proton_c/rules.mk | 1 - .../splitkb/kyria/rev2/base/keyboard.json | 34 +++++++++++++++++-- keyboards/splitkb/kyria/rev2/config.h | 31 ++--------------- keyboards/splitkb/kyria/rev2/info.json | 23 ------------- .../splitkb/kyria/rev2/proton_c/config.h | 17 ++++++++++ .../splitkb/kyria/rev2/proton_c/keyboard.json | 32 ++++++++++++++++- .../splitkb/kyria/rev2/proton_c/rules.mk | 1 - keyboards/splitkb/kyria/rev3/config.h | 7 ++-- keyboards/splitkb/kyria/rev3/keyboard.json | 4 +-- 15 files changed, 149 insertions(+), 114 deletions(-) create mode 100644 keyboards/splitkb/kyria/rev1/proton_c/config.h create mode 100644 keyboards/splitkb/kyria/rev2/proton_c/config.h diff --git a/keyboards/splitkb/kyria/info.json b/keyboards/splitkb/kyria/info.json index f70e8e3bb22..050e12f2ff5 100644 --- a/keyboards/splitkb/kyria/info.json +++ b/keyboards/splitkb/kyria/info.json @@ -6,7 +6,6 @@ "vid": "0x8D1D", "device_version": "1.0.0" }, - "development_board": "elite_c", "split": { "enabled": true }, diff --git a/keyboards/splitkb/kyria/rev1/base/keyboard.json b/keyboards/splitkb/kyria/rev1/base/keyboard.json index 9f75b9c218b..df92d71ad13 100644 --- a/keyboards/splitkb/kyria/rev1/base/keyboard.json +++ b/keyboards/splitkb/kyria/rev1/base/keyboard.json @@ -1,5 +1,26 @@ { - "build": { - "lto": true + "development_board": "elite_c", + "matrix_pins": { + "cols": ["B6", "B2", "B3", "B1", "F7", "F6", "F5", "F4"], + "rows": ["B4", "E6", "D7", "D4"] + }, + "diode_direction": "COL2ROW", + "encoder": { + "rotary": [ + {"pin_a": "C6", "pin_b": "B5"} + ] + }, + "split": { + "soft_serial_pin": "D2", + "encoder": { + "right": { + "rotary": [ + {"pin_a": "B5", "pin_b": "C6"} + ] + } + } + }, + "ws2812": { + "pin": "D3" } } diff --git a/keyboards/splitkb/kyria/rev1/config.h b/keyboards/splitkb/kyria/rev1/config.h index 4f130293e22..615d93496dd 100644 --- a/keyboards/splitkb/kyria/rev1/config.h +++ b/keyboards/splitkb/kyria/rev1/config.h @@ -17,31 +17,5 @@ along with this program. If not, see . #pragma once -/* - * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. - */ - -#if defined(CONVERT_TO_PROTON_C) -# define SERIAL_USART_FULL_DUPLEX // Enable full duplex operation mode. -# define SERIAL_USART_PIN_SWAP // Swap TX and RX pins if keyboard is master halve. -# define SERIAL_USART_DRIVER SD1 // USART driver of TX pin. default: SD1 -# define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7 -# define SERIAL_USART_TX_PIN D3 -# define SERIAL_USART_RX_PIN D2 - -# define WS2812_DI_PIN PAL_LINE(GPIOA, 3) -# define WS2812_PWM_DRIVER PWMD2 // default: PWMD2 -# define WS2812_PWM_CHANNEL 4 // default: 2 -# define WS2812_PWM_PAL_MODE 1 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 2 -# define WS2812_PWM_DMA_STREAM STM32_DMA1_STREAM2 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. -# define WS2812_PWM_DMA_CHANNEL 2 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. -# define WS2812_PWM_DMAMUX_ID STM32_DMAMUX1_TIM2_UP // DMAMUX configuration for TIMx_UP -- only required if your MCU has a DMAMUX peripheral, see the respective reference manual for the appropriate values for your MCU. -#else -# define WS2812_DI_PIN D3 -# define SOFT_SERIAL_PIN D2 -#endif - -#ifdef OLED_ENABLE -# define OLED_DISPLAY_128X64 -# define SPLIT_OLED_ENABLE -#endif +#define OLED_DISPLAY_128X64 +#define SPLIT_OLED_ENABLE diff --git a/keyboards/splitkb/kyria/rev1/info.json b/keyboards/splitkb/kyria/rev1/info.json index 3d84b37b311..1e21c609782 100644 --- a/keyboards/splitkb/kyria/rev1/info.json +++ b/keyboards/splitkb/kyria/rev1/info.json @@ -23,24 +23,7 @@ "sleep": true, "split_count": [10, 10] }, - "matrix_pins": { - "cols": ["B6", "B2", "B3", "B1", "F7", "F6", "F5", "F4"], - "rows": ["B4", "E6", "D7", "D4"] - }, - "diode_direction": "COL2ROW", - "encoder": { - "rotary": [ - {"pin_a": "C6", "pin_b": "B5"} - ] - }, "split": { - "encoder": { - "right": { - "rotary": [ - {"pin_a": "B5", "pin_b": "C6"} - ] - } - }, "transport": { "sync": { "matrix_state": true diff --git a/keyboards/splitkb/kyria/rev1/proton_c/config.h b/keyboards/splitkb/kyria/rev1/proton_c/config.h new file mode 100644 index 00000000000..df2eb96ae22 --- /dev/null +++ b/keyboards/splitkb/kyria/rev1/proton_c/config.h @@ -0,0 +1,17 @@ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define SERIAL_USART_FULL_DUPLEX // Enable full duplex operation mode. +#define SERIAL_USART_PIN_SWAP // Swap TX and RX pins if keyboard is master halve. +#define SERIAL_USART_DRIVER SD1 // USART driver of TX pin. default: SD1 +#define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7 +#define SERIAL_USART_TX_PIN A9 +#define SERIAL_USART_RX_PIN A10 + +#define WS2812_PWM_CHANNEL 4 +#define WS2812_PWM_PAL_MODE 1 +#define WS2812_PWM_DMA_STREAM STM32_DMA1_STREAM2 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. +#define WS2812_PWM_DMA_CHANNEL 2 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. +#define WS2812_PWM_DMAMUX_ID STM32_DMAMUX1_TIM2_UP // DMAMUX configuration for TIMx_UP -- only required if your MCU has a DMAMUX peripheral, see the respective reference manual for the appropriate values for your MCU. diff --git a/keyboards/splitkb/kyria/rev1/proton_c/keyboard.json b/keyboards/splitkb/kyria/rev1/proton_c/keyboard.json index 6cc38d4a212..a7181fef8df 100644 --- a/keyboards/splitkb/kyria/rev1/proton_c/keyboard.json +++ b/keyboards/splitkb/kyria/rev1/proton_c/keyboard.json @@ -1,5 +1,26 @@ { + "development_board": "proton_c", + "matrix_pins": { + "cols": ["B9", "B15", "B14", "B13", "B8", "A0", "A1", "A2"], + "rows": ["B1", "B2", "B3", "B5"] + }, + "diode_direction": "COL2ROW", + "encoder": { + "rotary": [ + {"pin_a": "B4", "pin_b": "B0"} + ] + }, + "split": { + "encoder": { + "right": { + "rotary": [ + {"pin_a": "B0", "pin_b": "B4"} + ] + } + } + }, "ws2812": { - "driver": "pwm" + "driver": "pwm", + "pin": "A3" } } diff --git a/keyboards/splitkb/kyria/rev1/proton_c/rules.mk b/keyboards/splitkb/kyria/rev1/proton_c/rules.mk index a58b20c575c..c6e29883213 100644 --- a/keyboards/splitkb/kyria/rev1/proton_c/rules.mk +++ b/keyboards/splitkb/kyria/rev1/proton_c/rules.mk @@ -1,2 +1 @@ SERIAL_DRIVER = usart -CONVERT_TO = proton_c diff --git a/keyboards/splitkb/kyria/rev2/base/keyboard.json b/keyboards/splitkb/kyria/rev2/base/keyboard.json index 9f75b9c218b..8de0f335cc5 100644 --- a/keyboards/splitkb/kyria/rev2/base/keyboard.json +++ b/keyboards/splitkb/kyria/rev2/base/keyboard.json @@ -1,5 +1,35 @@ { - "build": { - "lto": true + "development_board": "elite_c", + "matrix_pins": { + "cols": ["B2", "B6", "B5", "B4", "E6", "D7", "C6", "D4"], + "rows": ["F6", "F7", "B1", "B3"] + }, + "diode_direction": "COL2ROW", + "encoder": { + "rotary": [ + {"pin_a": "F4", "pin_b": "F5"} + ] + }, + "split": { + "handedness": { + "matrix_grid": ["E6", "B3"] + }, + "soft_serial_pin": "D2", + "encoder": { + "right": { + "rotary": [ + {"pin_a": "F5", "pin_b": "F4"} + ] + } + }, + "matrix_pins": { + "right": { + "cols": ["B4", "B5", "B6", "B2", "B3", "B1", "F7", "F6"], + "rows": ["D4", "C6", "D7", "E6"] + } + } + }, + "ws2812": { + "pin": "D3" } } diff --git a/keyboards/splitkb/kyria/rev2/config.h b/keyboards/splitkb/kyria/rev2/config.h index 54d8f0985ae..fb9e7bb9590 100644 --- a/keyboards/splitkb/kyria/rev2/config.h +++ b/keyboards/splitkb/kyria/rev2/config.h @@ -19,34 +19,7 @@ along with this program. If not, see . // Side detection // col 4 row 3 on right-hand-side -#define SPLIT_HAND_MATRIX_GRID E6, B3 // row first because the board is col2row #define MATRIX_MASKED // actual mask is defined by `matrix_mask` in `rev2.c` -/* - * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. - */ - -#if defined(CONVERT_TO_PROTON_C) -# define SERIAL_USART_FULL_DUPLEX // Enable full duplex operation mode. -# define SERIAL_USART_PIN_SWAP // Swap TX and RX pins if keyboard is master halve. -# define SERIAL_USART_DRIVER SD1 // USART driver of TX pin. default: SD1 -# define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7 -# define SERIAL_USART_TX_PIN D3 -# define SERIAL_USART_RX_PIN D2 - -# define WS2812_DI_PIN PAL_LINE(GPIOA, 3) -# define WS2812_PWM_DRIVER PWMD2 // default: PWMD2 -# define WS2812_PWM_CHANNEL 4 // default: 2 -# define WS2812_PWM_PAL_MODE 1 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 2 -# define WS2812_PWM_DMA_STREAM STM32_DMA1_STREAM2 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. -# define WS2812_PWM_DMA_CHANNEL 2 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. -# define WS2812_PWM_DMAMUX_ID STM32_DMAMUX1_TIM2_UP // DMAMUX configuration for TIMx_UP -- only required if your MCU has a DMAMUX peripheral, see the respective reference manual for the appropriate values for your MCU. -#else -# define WS2812_DI_PIN D3 -# define SOFT_SERIAL_PIN D2 -#endif - -#ifdef OLED_ENABLE -# define OLED_DISPLAY_128X64 -# define SPLIT_OLED_ENABLE -#endif +#define OLED_DISPLAY_128X64 +#define SPLIT_OLED_ENABLE diff --git a/keyboards/splitkb/kyria/rev2/info.json b/keyboards/splitkb/kyria/rev2/info.json index 80f801e3d15..d1507a26b0d 100644 --- a/keyboards/splitkb/kyria/rev2/info.json +++ b/keyboards/splitkb/kyria/rev2/info.json @@ -23,30 +23,7 @@ "sleep": true, "split_count": [10, 10] }, - "matrix_pins": { - "cols": ["B2", "B6", "B5", "B4", "E6", "D7", "C6", "D4"], - "rows": ["F6", "F7", "B1", "B3"] - }, - "diode_direction": "COL2ROW", - "encoder": { - "rotary": [ - {"pin_a": "F4", "pin_b": "F5"} - ] - }, "split": { - "encoder": { - "right": { - "rotary": [ - {"pin_a": "F5", "pin_b": "F4"} - ] - } - }, - "matrix_pins": { - "right": { - "cols": ["B4", "B5", "B6", "B2", "B3", "B1", "F7", "F6"], - "rows": ["D4", "C6", "D7", "E6"] - } - }, "transport": { "sync": { "matrix_state": true diff --git a/keyboards/splitkb/kyria/rev2/proton_c/config.h b/keyboards/splitkb/kyria/rev2/proton_c/config.h new file mode 100644 index 00000000000..df2eb96ae22 --- /dev/null +++ b/keyboards/splitkb/kyria/rev2/proton_c/config.h @@ -0,0 +1,17 @@ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define SERIAL_USART_FULL_DUPLEX // Enable full duplex operation mode. +#define SERIAL_USART_PIN_SWAP // Swap TX and RX pins if keyboard is master halve. +#define SERIAL_USART_DRIVER SD1 // USART driver of TX pin. default: SD1 +#define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7 +#define SERIAL_USART_TX_PIN A9 +#define SERIAL_USART_RX_PIN A10 + +#define WS2812_PWM_CHANNEL 4 +#define WS2812_PWM_PAL_MODE 1 +#define WS2812_PWM_DMA_STREAM STM32_DMA1_STREAM2 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. +#define WS2812_PWM_DMA_CHANNEL 2 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. +#define WS2812_PWM_DMAMUX_ID STM32_DMAMUX1_TIM2_UP // DMAMUX configuration for TIMx_UP -- only required if your MCU has a DMAMUX peripheral, see the respective reference manual for the appropriate values for your MCU. diff --git a/keyboards/splitkb/kyria/rev2/proton_c/keyboard.json b/keyboards/splitkb/kyria/rev2/proton_c/keyboard.json index 6cc38d4a212..43a3d532f22 100644 --- a/keyboards/splitkb/kyria/rev2/proton_c/keyboard.json +++ b/keyboards/splitkb/kyria/rev2/proton_c/keyboard.json @@ -1,5 +1,35 @@ { + "development_board": "proton_c", + "matrix_pins": { + "cols": ["B15", "B9", "B0", "B1", "B2", "B3", "B4", "B5"], + "rows": ["A0", "B8", "B13", "B14"] + }, + "diode_direction": "COL2ROW", + "encoder": { + "rotary": [ + {"pin_a": "A2", "pin_b": "A1"} + ] + }, + "split": { + "handedness": { + "matrix_grid": ["B2", "B14"] + }, + "encoder": { + "right": { + "rotary": [ + {"pin_a": "A1", "pin_b": "A2"} + ] + } + }, + "matrix_pins": { + "right": { + "cols": ["B1", "B0", "B9", "B15", "B14", "B13", "B8", "A0"], + "rows": ["B5", "B4", "B3", "B2"] + } + } + }, "ws2812": { - "driver": "pwm" + "driver": "pwm", + "pin": "A3" } } diff --git a/keyboards/splitkb/kyria/rev2/proton_c/rules.mk b/keyboards/splitkb/kyria/rev2/proton_c/rules.mk index a58b20c575c..c6e29883213 100644 --- a/keyboards/splitkb/kyria/rev2/proton_c/rules.mk +++ b/keyboards/splitkb/kyria/rev2/proton_c/rules.mk @@ -1,2 +1 @@ SERIAL_DRIVER = usart -CONVERT_TO = proton_c diff --git a/keyboards/splitkb/kyria/rev3/config.h b/keyboards/splitkb/kyria/rev3/config.h index b0a64320c60..7938384a781 100644 --- a/keyboards/splitkb/kyria/rev3/config.h +++ b/keyboards/splitkb/kyria/rev3/config.h @@ -20,8 +20,5 @@ // but can't yet be given a value #define SPLIT_HAND_PIN B5 -// Not yet available in `info.json` -#ifdef OLED_ENABLE -# define OLED_DISPLAY_128X64 -# define SPLIT_OLED_ENABLE -#endif +#define OLED_DISPLAY_128X64 +#define SPLIT_OLED_ENABLE diff --git a/keyboards/splitkb/kyria/rev3/keyboard.json b/keyboards/splitkb/kyria/rev3/keyboard.json index 4a426cb2060..750f87ae4b3 100644 --- a/keyboards/splitkb/kyria/rev3/keyboard.json +++ b/keyboards/splitkb/kyria/rev3/keyboard.json @@ -1,14 +1,12 @@ { "keyboard_name": "Kyria rev3", + "development_board": "elite_c", "usb": { "pid": "0xCF44" }, "bootmagic": { "matrix": [0, 6] }, - "build": { - "lto": true - }, "features": { "mousekey": true, "bootmagic": true, From b826877c40b64be023fda2879a268d5fa6aa610e Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Wed, 12 Jun 2024 04:00:23 +0100 Subject: [PATCH 009/204] Decouple VIA from STM32 L0/L1 EEPROM implementation (#23901) --- platforms/chibios/drivers/eeprom/eeprom_stm32_L0_L1.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platforms/chibios/drivers/eeprom/eeprom_stm32_L0_L1.h b/platforms/chibios/drivers/eeprom/eeprom_stm32_L0_L1.h index 616d7ccbeee..c1d801f2250 100644 --- a/platforms/chibios/drivers/eeprom/eeprom_stm32_L0_L1.h +++ b/platforms/chibios/drivers/eeprom/eeprom_stm32_L0_L1.h @@ -20,7 +20,7 @@ The size used by the STM32 L0/L1 EEPROM driver. */ #ifndef STM32_ONBOARD_EEPROM_SIZE -# ifdef VIA_ENABLE +# ifdef DYNAMIC_KEYMAP_ENABLE # define STM32_ONBOARD_EEPROM_SIZE 1024 # else # include "eeconfig.h" From c4a74be7f02ec64033638e93a49924df20fb2e57 Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 13 Jun 2024 21:59:46 +1000 Subject: [PATCH 010/204] Add process_keycode handlers for new RGB Matrix and Underglow keycodes (#23896) --- quantum/process_keycode/process_rgb_matrix.c | 101 +++++++++++++++++++ quantum/process_keycode/process_rgb_matrix.h | 10 ++ quantum/process_keycode/process_underglow.c | 91 +++++++++++++++++ quantum/process_keycode/process_underglow.h | 10 ++ 4 files changed, 212 insertions(+) create mode 100644 quantum/process_keycode/process_rgb_matrix.c create mode 100644 quantum/process_keycode/process_rgb_matrix.h create mode 100644 quantum/process_keycode/process_underglow.c create mode 100644 quantum/process_keycode/process_underglow.h diff --git a/quantum/process_keycode/process_rgb_matrix.c b/quantum/process_keycode/process_rgb_matrix.c new file mode 100644 index 00000000000..fd2aa1a0c73 --- /dev/null +++ b/quantum/process_keycode/process_rgb_matrix.c @@ -0,0 +1,101 @@ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "process_rgb_matrix.h" +#include "rgb_matrix.h" +#include "action_util.h" +#include "keycodes.h" +#include "modifiers.h" + +bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record) { +#ifdef RGB_TRIGGER_ON_KEYDOWN + if (record->event.pressed) { +#else + if (!record->event.pressed) { +#endif + bool shifted = get_mods() & MOD_MASK_SHIFT; + switch (keycode) { + case QK_RGB_MATRIX_ON: + rgb_matrix_enable(); + return false; + case QK_RGB_MATRIX_OFF: + rgb_matrix_disable(); + return false; + case QK_RGB_MATRIX_TOGGLE: + rgb_matrix_toggle(); + return false; + case QK_RGB_MATRIX_MODE_NEXT: + if (shifted) { + rgb_matrix_step_reverse(); + } else { + rgb_matrix_step(); + } + return false; + case QK_RGB_MATRIX_MODE_PREVIOUS: + if (shifted) { + rgb_matrix_step(); + } else { + rgb_matrix_step_reverse(); + } + return false; + case QK_RGB_MATRIX_HUE_UP: + if (shifted) { + rgb_matrix_decrease_hue(); + } else { + rgb_matrix_increase_hue(); + } + return false; + case QK_RGB_MATRIX_HUE_DOWN: + if (shifted) { + rgb_matrix_increase_hue(); + } else { + rgb_matrix_decrease_hue(); + } + return false; + case QK_RGB_MATRIX_SATURATION_UP: + if (shifted) { + rgb_matrix_decrease_sat(); + } else { + rgb_matrix_increase_sat(); + } + return false; + case QK_RGB_MATRIX_SATURATION_DOWN: + if (shifted) { + rgb_matrix_increase_sat(); + } else { + rgb_matrix_decrease_sat(); + } + return false; + case QK_RGB_MATRIX_VALUE_UP: + if (shifted) { + rgb_matrix_decrease_val(); + } else { + rgb_matrix_increase_val(); + } + return false; + case QK_RGB_MATRIX_VALUE_DOWN: + if (shifted) { + rgb_matrix_increase_val(); + } else { + rgb_matrix_decrease_val(); + } + return false; + case QK_RGB_MATRIX_SPEED_UP: + if (shifted) { + rgb_matrix_decrease_speed(); + } else { + rgb_matrix_increase_speed(); + } + return false; + case QK_RGB_MATRIX_SPEED_DOWN: + if (shifted) { + rgb_matrix_increase_speed(); + } else { + rgb_matrix_decrease_speed(); + } + return false; + } + } + + return true; +} diff --git a/quantum/process_keycode/process_rgb_matrix.h b/quantum/process_keycode/process_rgb_matrix.h new file mode 100644 index 00000000000..a02bf57b5f3 --- /dev/null +++ b/quantum/process_keycode/process_rgb_matrix.h @@ -0,0 +1,10 @@ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include +#include +#include "action.h" + +bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record); diff --git a/quantum/process_keycode/process_underglow.c b/quantum/process_keycode/process_underglow.c new file mode 100644 index 00000000000..779672ac076 --- /dev/null +++ b/quantum/process_keycode/process_underglow.c @@ -0,0 +1,91 @@ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "process_underglow.h" +#include "rgblight.h" +#include "action_util.h" +#include "keycodes.h" +#include "modifiers.h" + +bool process_underglow(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + uint8_t shifted = get_mods() & MOD_MASK_SHIFT; + switch (keycode) { + case QK_UNDERGLOW_TOGGLE: + rgblight_toggle(); + return false; + case QK_UNDERGLOW_MODE_NEXT: + if (shifted) { + rgblight_step_reverse(); + } else { + rgblight_step(); + } + return false; + case QK_UNDERGLOW_MODE_PREVIOUS: + if (shifted) { + rgblight_step(); + } else { + rgblight_step_reverse(); + } + return false; + case QK_UNDERGLOW_HUE_UP: + if (shifted) { + rgblight_decrease_hue(); + } else { + rgblight_increase_hue(); + } + return false; + case QK_UNDERGLOW_HUE_DOWN: + if (shifted) { + rgblight_increase_hue(); + } else { + rgblight_decrease_hue(); + } + return false; + case QK_UNDERGLOW_SATURATION_UP: + if (shifted) { + rgblight_decrease_sat(); + } else { + rgblight_increase_sat(); + } + return false; + case QK_UNDERGLOW_SATURATION_DOWN: + if (shifted) { + rgblight_increase_sat(); + } else { + rgblight_decrease_sat(); + } + return false; + case QK_UNDERGLOW_VALUE_UP: + if (shifted) { + rgblight_decrease_val(); + } else { + rgblight_increase_val(); + } + return false; + case QK_UNDERGLOW_VALUE_DOWN: + if (shifted) { + rgblight_increase_hue(); + } else { + rgblight_decrease_hue(); + } + return false; + case QK_UNDERGLOW_SPEED_UP: + if (shifted) { + rgblight_decrease_speed(); + } else { + rgblight_increase_speed(); + } + return false; + case QK_UNDERGLOW_SPEED_DOWN: + if (shifted) { + rgblight_increase_speed(); + } else { + rgblight_decrease_speed(); + } + return false; + } + } + + return true; +} diff --git a/quantum/process_keycode/process_underglow.h b/quantum/process_keycode/process_underglow.h new file mode 100644 index 00000000000..b409cafbb89 --- /dev/null +++ b/quantum/process_keycode/process_underglow.h @@ -0,0 +1,10 @@ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include +#include +#include "action.h" + +bool process_underglow(uint16_t keycode, keyrecord_t *record); From 55538b2e1e743ec1a209e61880d52bb5d2156669 Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 13 Jun 2024 22:19:45 +1000 Subject: [PATCH 011/204] APA102: API rework (#23355) --- docs/drivers/apa102.md | 51 +++++++++++++++++++++++------ drivers/led/apa102.c | 25 ++++++++++---- drivers/led/apa102.h | 15 ++------- quantum/rgblight/rgblight_drivers.c | 8 +++++ 4 files changed, 70 insertions(+), 29 deletions(-) diff --git a/docs/drivers/apa102.md b/docs/drivers/apa102.md index 88868a73b59..197b18869e8 100644 --- a/docs/drivers/apa102.md +++ b/docs/drivers/apa102.md @@ -26,20 +26,51 @@ Add the following to your `config.h`: ## API {#api} -### `void apa102_setleds(rgb_led_t *start_led, uint16_t num_leds)` +### `void apa102_init(void)` {#api-apa102-init} -Send RGB data to the APA102 LED chain. - -#### Arguments {#api-apa102-setleds-arguments} - - - `rgb_led_t *start_led` - A pointer to the LED array. - - `uint16_t num_leds` - The length of the LED array. +Initialize the LED driver. This function should be called first. --- -### `void apa102_set_brightness(uint8_t brightness)` +### `void apa102_set_color(uint16_t index, uint8_t red, uint8_t green, uint8_t blue)` {#api-apa102-set-color} + +Set the color of a single LED. This function does not immediately update the LEDs; call `apa102_flush()` after you are finished. + +#### Arguments {#api-apa102-set-color-arguments} + + - `uint16_t index` + The LED index in the APA102 chain. + - `uint8_t red` + The red value to set. + - `uint8_t green` + The green value to set. + - `uint8_t blue` + The blue value to set. + +--- + +### `void apa102_set_color_all(uint8_t red, uint8_t green, uint8_t blue)` {#api-apa102-set-color-all} + +Set the color of all LEDs. + +#### Arguments {#api-apa102-set-color-all-arguments} + + - `uint8_t red` + The red value to set. + - `uint8_t green` + The green value to set. + - `uint8_t blue` + The blue value to set. + +--- + +### `void apa102_flush(void)` {#api-apa102-flush} + +Flush the PWM values to the LED chain. + +--- + +### `void apa102_set_brightness(uint8_t brightness)` {#api-apa102-set-brightness} Set the global brightness. diff --git a/drivers/led/apa102.c b/drivers/led/apa102.c index b171b07b12c..0cf0ecb4018 100644 --- a/drivers/led/apa102.c +++ b/drivers/led/apa102.c @@ -53,7 +53,8 @@ io_wait; \ } while (0) -uint8_t apa102_led_brightness = APA102_DEFAULT_BRIGHTNESS; +rgb_led_t apa102_leds[APA102_LED_COUNT]; +uint8_t apa102_led_brightness = APA102_DEFAULT_BRIGHTNESS; static void apa102_send_byte(uint8_t byte) { APA102_SEND_BIT(byte, 7); @@ -121,14 +122,24 @@ void apa102_init(void) { gpio_set_pin_output(APA102_CI_PIN); } -void apa102_setleds(rgb_led_t *start_led, uint16_t num_leds) { - rgb_led_t *end = start_led + num_leds; +void apa102_set_color(uint16_t index, uint8_t red, uint8_t green, uint8_t blue) { + apa102_leds[index].r = red; + apa102_leds[index].g = green; + apa102_leds[index].b = blue; +} - apa102_start_frame(); - for (rgb_led_t *led = start_led; led < end; led++) { - apa102_send_frame(led->r, led->g, led->b, apa102_led_brightness); +void apa102_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { + for (uint16_t i = 0; i < APA102_LED_COUNT; i++) { + apa102_set_color(i, red, green, blue); } - apa102_end_frame(num_leds); +} + +void apa102_flush(void) { + apa102_start_frame(); + for (uint8_t i = 0; i < APA102_LED_COUNT; i++) { + apa102_send_frame(apa102_leds[i].r, apa102_leds[i].g, apa102_leds[i].b, apa102_led_brightness); + } + apa102_end_frame(APA102_LED_COUNT); } void apa102_set_brightness(uint8_t brightness) { diff --git a/drivers/led/apa102.h b/drivers/led/apa102.h index 5e2f78658be..42f1344f0c9 100644 --- a/drivers/led/apa102.h +++ b/drivers/led/apa102.h @@ -32,17 +32,8 @@ #define APA102_MAX_BRIGHTNESS 31 void apa102_init(void); - -/* User Interface - * - * Input: - * start_led: An array of GRB data describing the LED colors - * num_leds: The number of LEDs to write - * - * The functions will perform the following actions: - * - Set the data-out pin as output - * - Send out the LED data - */ -void apa102_setleds(rgb_led_t *start_led, uint16_t num_leds); +void apa102_set_color(uint16_t index, uint8_t red, uint8_t green, uint8_t blue); +void apa102_set_color_all(uint8_t red, uint8_t green, uint8_t blue); +void apa102_flush(void); void apa102_set_brightness(uint8_t brightness); diff --git a/quantum/rgblight/rgblight_drivers.c b/quantum/rgblight/rgblight_drivers.c index 8902b8f842e..76e9031aec9 100644 --- a/quantum/rgblight/rgblight_drivers.c +++ b/quantum/rgblight/rgblight_drivers.c @@ -14,6 +14,14 @@ const rgblight_driver_t rgblight_driver = { #elif defined(RGBLIGHT_APA102) # include "apa102.h" +// Temporary shim +static void apa102_setleds(rgb_led_t *ledarray, uint16_t number_of_leds) { + for (uint16_t i = 0; i < number_of_leds; i++) { + apa102_set_color(i, ledarray[i].r, ledarray[i].g, ledarray[i].b); + } + apa102_flush(); +} + const rgblight_driver_t rgblight_driver = { .init = apa102_init, .setleds = apa102_setleds, From 51acd35e6f2196ca1d9a1328be92355b128d8239 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Mon, 17 Jun 2024 19:22:47 +0100 Subject: [PATCH 012/204] Implement data driven serial driver (#23923) --- data/mappings/info_rules.hjson | 1 + data/schemas/keyboard.jsonschema | 10 ++++++++++ docs/reference_info_json.md | 4 ++++ 3 files changed, 15 insertions(+) diff --git a/data/mappings/info_rules.hjson b/data/mappings/info_rules.hjson index 97611bcf587..384bc87b783 100644 --- a/data/mappings/info_rules.hjson +++ b/data/mappings/info_rules.hjson @@ -41,6 +41,7 @@ "RGB_MATRIX_DRIVER": {"info_key": "rgb_matrix.driver"}, "RGBLIGHT_DRIVER": {"info_key": "rgblight.driver"}, "SECURE_ENABLE": {"info_key": "secure.enabled", "value_type": "bool"}, + "SERIAL_DRIVER": {"info_key": "split.serial.driver"}, "SPLIT_KEYBOARD": {"info_key": "split.enabled", "value_type": "bool"}, "SPLIT_TRANSPORT": {"info_key": "split.transport.protocol", "to_c": false}, "STENO_ENABLE": {"info_key": "stenography.enabled", "value_type": "bool"}, diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema index e5802fe07dd..5b63acf8e80 100644 --- a/data/schemas/keyboard.jsonschema +++ b/data/schemas/keyboard.jsonschema @@ -799,6 +799,16 @@ "minimum": 0, "maximum": 5 }, + "serial": { + "type": "object", + "additionalProperties": false, + "properties": { + "driver": { + "type": "string", + "enum": ["bitbang", "usart", "vendor"] + } + } + }, "transport": { "type": "object", "additionalProperties": false, diff --git a/docs/reference_info_json.md b/docs/reference_info_json.md index 2db2cd14277..a7a6caff799 100644 --- a/docs/reference_info_json.md +++ b/docs/reference_info_json.md @@ -732,6 +732,10 @@ Configures the [Split Keyboard](features/split_keyboard) feature. * `matrix_pins` * `right` * See [Matrix](#matrix) config. + * `serial` + * `driver` + * The driver to use. Must be one of `bitbang`, `usart`, `vendor`. + * Default: `"bitbang"` * `soft_serial_pin` * The GPIO pin to use (`serial` transport protocol only). * `soft_serial_speed` From 938badc3b0a8b71647e2463241f2e3fe8578f32a Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Mon, 17 Jun 2024 21:51:53 +0100 Subject: [PATCH 013/204] Generate keymap dd keycodes to header (#20273) --- builddefs/build_keyboard.mk | 7 +++- lib/python/qmk/cli/__init__.py | 1 + lib/python/qmk/cli/generate/keymap_h.py | 51 +++++++++++++++++++++++++ lib/python/qmk/keymap.py | 34 ++--------------- 4 files changed, 61 insertions(+), 32 deletions(-) create mode 100644 lib/python/qmk/cli/generate/keymap_h.py diff --git a/builddefs/build_keyboard.mk b/builddefs/build_keyboard.mk index f0788e55c99..ebc52a93090 100644 --- a/builddefs/build_keyboard.mk +++ b/builddefs/build_keyboard.mk @@ -212,7 +212,12 @@ $(INTERMEDIATE_OUTPUT)/src/config.h: $(KEYMAP_JSON) $(eval CMD=$(QMK_BIN) generate-config-h --quiet --output $(KEYMAP_H) $(KEYMAP_JSON)) @$(BUILD_CMD) -generated-files: $(INTERMEDIATE_OUTPUT)/src/config.h $(INTERMEDIATE_OUTPUT)/src/keymap.c +$(INTERMEDIATE_OUTPUT)/src/keymap.h: $(KEYMAP_JSON) + @$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD) + $(eval CMD=$(QMK_BIN) generate-keymap-h --quiet --output $(INTERMEDIATE_OUTPUT)/src/keymap.h $(KEYMAP_JSON)) + @$(BUILD_CMD) + +generated-files: $(INTERMEDIATE_OUTPUT)/src/config.h $(INTERMEDIATE_OUTPUT)/src/keymap.c $(INTERMEDIATE_OUTPUT)/src/keymap.h endif diff --git a/lib/python/qmk/cli/__init__.py b/lib/python/qmk/cli/__init__.py index 6d05a5fc21c..b656909f853 100644 --- a/lib/python/qmk/cli/__init__.py +++ b/lib/python/qmk/cli/__init__.py @@ -58,6 +58,7 @@ subcommands = [ 'qmk.cli.generate.keyboard_h', 'qmk.cli.generate.keycodes', 'qmk.cli.generate.keycodes_tests', + 'qmk.cli.generate.keymap_h', 'qmk.cli.generate.make_dependencies', 'qmk.cli.generate.rgb_breathe_table', 'qmk.cli.generate.rules_mk', diff --git a/lib/python/qmk/cli/generate/keymap_h.py b/lib/python/qmk/cli/generate/keymap_h.py new file mode 100644 index 00000000000..a3aaa405c0f --- /dev/null +++ b/lib/python/qmk/cli/generate/keymap_h.py @@ -0,0 +1,51 @@ +from argcomplete.completers import FilesCompleter + +from milc import cli + +import qmk.path +from qmk.commands import dump_lines +from qmk.commands import parse_configurator_json +from qmk.constants import GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE + + +def _generate_keycodes_function(keymap_json): + """Generates keymap level keycodes. + """ + lines = [] + lines.append('enum keymap_keycodes {') + + for index, item in enumerate(keymap_json.get('keycodes', [])): + key = item["key"] + if index == 0: + lines.append(f' {key} = QK_USER_0,') + else: + lines.append(f' {key},') + + lines.append('};') + + for item in keymap_json.get('keycodes', []): + key = item["key"] + for alias in item.get("aliases", []): + lines.append(f'#define {alias} {key}') + + return lines + + +@cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to') +@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages") +@cli.argument('filename', type=qmk.path.FileType('r'), arg_only=True, completer=FilesCompleter('.json'), help='Configurator JSON file') +@cli.subcommand('Creates a keymap.h from a QMK Configurator export.') +def generate_keymap_h(cli): + """Creates a keymap.h from a QMK Configurator export + """ + if cli.args.output and cli.args.output.name == '-': + cli.args.output = None + + keymap_h_lines = [GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE, '#pragma once', '// clang-format off'] + + keymap_json = parse_configurator_json(cli.args.filename) + + if 'keycodes' in keymap_json and keymap_json['keycodes'] is not None: + keymap_h_lines += _generate_keycodes_function(keymap_json) + + dump_lines(cli.args.output, keymap_h_lines, cli.args.quiet) diff --git a/lib/python/qmk/keymap.py b/lib/python/qmk/keymap.py index b7bf897377c..ca76f1b2888 100644 --- a/lib/python/qmk/keymap.py +++ b/lib/python/qmk/keymap.py @@ -19,6 +19,9 @@ from qmk.info import info_json # The `keymap.c` template to use when a keyboard doesn't have its own DEFAULT_KEYMAP_C = """#include QMK_KEYBOARD_H +#if __has_include("keymap.h") +# include "keymap.h" +#endif __INCLUDES__ /* THIS FILE WAS GENERATED! @@ -26,8 +29,6 @@ __INCLUDES__ * This file was generated by qmk json2c. You may or may not want to * edit it directly. */ -__KEYCODE_OUTPUT_GOES_HERE__ - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { __KEYMAP_GOES_HERE__ }; @@ -125,29 +126,6 @@ def _generate_macros_function(keymap_json): return macro_txt -def _generate_keycodes_function(keymap_json): - """Generates keymap level keycodes. - """ - lines = [] - lines.append('enum keymap_keycodes {') - - for index, item in enumerate(keymap_json.get('keycodes', [])): - key = item["key"] - if index == 0: - lines.append(f' {key} = QK_USER_0,') - else: - lines.append(f' {key},') - - lines.append('};') - - for item in keymap_json.get('keycodes', []): - key = item["key"] - for alias in item.get("aliases", []): - lines.append(f'#define {alias} {key}') - - return lines - - def template_json(keyboard): """Returns a `keymap.json` template for a keyboard. @@ -350,12 +328,6 @@ def generate_c(keymap_json): hostlang = f'#include "keymap_{keymap_json["host_language"]}.h"\n#include "sendstring_{keymap_json["host_language"]}.h"\n' new_keymap = new_keymap.replace('__INCLUDES__', hostlang) - keycodes = '' - if 'keycodes' in keymap_json and keymap_json['keycodes'] is not None: - keycodes_txt = _generate_keycodes_function(keymap_json) - keycodes = '\n'.join(keycodes_txt) - new_keymap = new_keymap.replace('__KEYCODE_OUTPUT_GOES_HERE__', keycodes) - return new_keymap From 53a0cdc4467fb688faa2708fe75daa26686e918d Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Tue, 18 Jun 2024 03:44:22 +0100 Subject: [PATCH 014/204] Implement data driven joysticks (#22947) --- data/mappings/info_config.hjson | 5 +++ data/mappings/info_rules.hjson | 2 + data/schemas/keyboard.jsonschema | 30 +++++++++++++++ .../battleship_gamepad/battleship_gamepad.c | 6 --- .../handwired/battleship_gamepad/config.h | 21 ---------- .../battleship_gamepad/keyboard.json | 8 ++++ .../handwired/battleship_gamepad/rules.mk | 1 - lib/python/qmk/cli/generate/keyboard_c.py | 38 ++++++++++++++++++- lib/python/qmk/constants.py | 2 + lib/python/qmk/info.py | 15 +++++++- 10 files changed, 97 insertions(+), 31 deletions(-) delete mode 100644 keyboards/handwired/battleship_gamepad/config.h delete mode 100644 keyboards/handwired/battleship_gamepad/rules.mk diff --git a/data/mappings/info_config.hjson b/data/mappings/info_config.hjson index b61ca040714..4f731b60113 100644 --- a/data/mappings/info_config.hjson +++ b/data/mappings/info_config.hjson @@ -72,6 +72,11 @@ "LED_KANA_PIN": {"info_key": "indicators.kana"}, "LED_PIN_ON_STATE": {"info_key": "indicators.on_state", "value_type": "int"}, + // Joystick + "JOYSTICK_AXIS_COUNT": {"info_key": "joystick.axis_count", "value_type": "int"}, + "JOYSTICK_AXIS_RESOLUTION": {"info_key": "joystick.axis_resolution", "value_type": "int"}, + "JOYSTICK_BUTTON_COUNT": {"info_key": "joystick.button_count", "value_type": "int"}, + // Leader Key "LEADER_PER_KEY_TIMING": {"info_key": "leader_key.timing", "value_type": "flag"}, "LEADER_KEY_STRICT_KEY_PROCESSING": {"info_key": "leader_key.strict_processing", "value_type": "flag"}, diff --git a/data/mappings/info_rules.hjson b/data/mappings/info_rules.hjson index 384bc87b783..64972af63b0 100644 --- a/data/mappings/info_rules.hjson +++ b/data/mappings/info_rules.hjson @@ -25,6 +25,8 @@ "ENCODER_DRIVER": {"info_key": "encoder.driver"}, "FIRMWARE_FORMAT": {"info_key": "build.firmware_format"}, "HAPTIC_DRIVER": {"info_key": "haptic.driver"}, + "JOYSTICK_DRIVER": {"info_key": "joystick.driver"}, + "JOYSTICK_ENABLE": {"info_key": "joystick.enabled", "value_type": "bool"}, "KEYBOARD_SHARED_EP": {"info_key": "usb.shared_endpoint.keyboard", "value_type": "bool"}, "LAYOUTS": {"info_key": "community_layouts", "value_type": "list"}, "LED_MATRIX_DRIVER": {"info_key": "led_matrix.driver"}, diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema index 5b63acf8e80..e758c325c77 100644 --- a/data/schemas/keyboard.jsonschema +++ b/data/schemas/keyboard.jsonschema @@ -342,6 +342,36 @@ "on_state": {"$ref": "qmk.definitions.v1#/bit"} } }, + "joystick": { + "type": "object", + "properties": { + "enabled": {"type": "boolean"}, + "driver": {"type": "string"}, + "button_count": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "axis_resolution": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "axes": { + "type": "object", + "propertyNames": {"enum": ["x", "y", "z", "rx", "ry", "rz"]} + "additionalProperties": { + "oneOf": [ + { + "type": "object", + "properties": { + "input_pin": {"$ref": "qmk.definitions.v1#/mcu_pin"}, + "low": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "rest": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "high": {"$ref": "qmk.definitions.v1#/unsigned_int"} + } + }, + { + "type": "string", + "enum": ["virtual"] + } + ] + } + } + } + }, "keycodes": {"$ref": "qmk.definitions.v1#/keycode_decl_array"}, "layout_aliases": { "type": "object", diff --git a/keyboards/handwired/battleship_gamepad/battleship_gamepad.c b/keyboards/handwired/battleship_gamepad/battleship_gamepad.c index cccc03a2872..7b5e65a9907 100644 --- a/keyboards/handwired/battleship_gamepad/battleship_gamepad.c +++ b/keyboards/handwired/battleship_gamepad/battleship_gamepad.c @@ -16,12 +16,6 @@ #include "quantum.h" -/* joystick config */ -joystick_config_t joystick_axes[JOYSTICK_AXIS_COUNT] = { - [0] = JOYSTICK_AXIS_IN(F5, 1023, 512, 0), - [1] = JOYSTICK_AXIS_IN(F4, 0, 512, 1023) -}; - /* joystick button code (thumbstick pressed) */ void keyboard_pre_init_kb(void) { gpio_set_pin_input_high(F6); diff --git a/keyboards/handwired/battleship_gamepad/config.h b/keyboards/handwired/battleship_gamepad/config.h deleted file mode 100644 index b785c80aadf..00000000000 --- a/keyboards/handwired/battleship_gamepad/config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright 2021 Andrew Braini - * - * 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 - -/* joystick configuration */ -#define JOYSTICK_BUTTON_COUNT 25 -#define JOYSTICK_AXIS_RESOLUTION 10 diff --git a/keyboards/handwired/battleship_gamepad/keyboard.json b/keyboards/handwired/battleship_gamepad/keyboard.json index 28327418758..8350f31fddb 100644 --- a/keyboards/handwired/battleship_gamepad/keyboard.json +++ b/keyboards/handwired/battleship_gamepad/keyboard.json @@ -13,6 +13,14 @@ "rows": ["B6", "B2", "B3", "B1", "F7"] }, "diode_direction": "COL2ROW", + "joystick": { + "button_count": 25, + "axis_resolution": 10, + "axes": { + "x": {"input_pin": "F5", "low": 1023, "rest": 512, "high": 0}, + "y": {"input_pin": "F4", "low": 0, "rest": 512, "high": 1023} + } + }, "processor": "atmega32u4", "bootloader": "caterina", "features": { diff --git a/keyboards/handwired/battleship_gamepad/rules.mk b/keyboards/handwired/battleship_gamepad/rules.mk deleted file mode 100644 index c5ab560bca9..00000000000 --- a/keyboards/handwired/battleship_gamepad/rules.mk +++ /dev/null @@ -1 +0,0 @@ -JOYSTICK_DRIVER = analog diff --git a/lib/python/qmk/cli/generate/keyboard_c.py b/lib/python/qmk/cli/generate/keyboard_c.py index 5a6c9674860..228b320942a 100755 --- a/lib/python/qmk/cli/generate/keyboard_c.py +++ b/lib/python/qmk/cli/generate/keyboard_c.py @@ -6,7 +6,7 @@ from qmk.info import info_json from qmk.commands import dump_lines from qmk.keyboard import keyboard_completer, keyboard_folder from qmk.path import normpath -from qmk.constants import GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE +from qmk.constants import GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE, JOYSTICK_AXES def _gen_led_configs(info_data): @@ -91,6 +91,41 @@ def _gen_matrix_mask(info_data): return lines +def _gen_joystick_axes(info_data): + """Convert info.json content to joystick_axes + """ + if 'axes' not in info_data.get('joystick', {}): + return [] + + axes = info_data['joystick']['axes'] + axes_keys = list(axes.keys()) + + lines = [] + lines.append('#ifdef JOYSTICK_ENABLE') + lines.append('joystick_config_t joystick_axes[JOYSTICK_AXIS_COUNT] = {') + + # loop over all available axes - injecting virtual axis for those not specified + for index, cur in enumerate(JOYSTICK_AXES): + # bail out if we have generated all requested axis + if len(axes_keys) == 0: + break + + axis = 'virtual' + if cur in axes: + axis = axes[cur] + axes_keys.remove(cur) + + if axis == 'virtual': + lines.append(f" [{index}] = JOYSTICK_AXIS_VIRTUAL,") + else: + lines.append(f" [{index}] = JOYSTICK_AXIS_IN({axis['input_pin']}, {axis['low']}, {axis['rest']}, {axis['high']}),") + + lines.append('};') + lines.append('#endif') + + return lines + + @cli.argument('-o', '--output', arg_only=True, type=normpath, help='File to write to') @cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages") @cli.argument('-kb', '--keyboard', arg_only=True, type=keyboard_folder, completer=keyboard_completer, required=True, help='Keyboard to generate keyboard.c for.') @@ -105,6 +140,7 @@ def generate_keyboard_c(cli): keyboard_h_lines.extend(_gen_led_configs(kb_info_json)) keyboard_h_lines.extend(_gen_matrix_mask(kb_info_json)) + keyboard_h_lines.extend(_gen_joystick_axes(kb_info_json)) # Show the results dump_lines(cli.args.output, keyboard_h_lines, cli.args.quiet) diff --git a/lib/python/qmk/constants.py b/lib/python/qmk/constants.py index 90e4452f2b9..b6f46180b29 100644 --- a/lib/python/qmk/constants.py +++ b/lib/python/qmk/constants.py @@ -320,3 +320,5 @@ LICENSE_TEXTS = [ you may not use this file except in compliance with the License. """]), ] + +JOYSTICK_AXES = ['x', 'y', 'z', 'rx', 'ry', 'rz'] diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py index 833271c09cc..091a11854c0 100644 --- a/lib/python/qmk/info.py +++ b/lib/python/qmk/info.py @@ -7,7 +7,7 @@ from dotty_dict import dotty from milc import cli -from qmk.constants import COL_LETTERS, ROW_LETTERS, CHIBIOS_PROCESSORS, LUFA_PROCESSORS, VUSB_PROCESSORS +from qmk.constants import COL_LETTERS, ROW_LETTERS, CHIBIOS_PROCESSORS, LUFA_PROCESSORS, VUSB_PROCESSORS, JOYSTICK_AXES from qmk.c_parse import find_layouts, parse_config_h_file, find_led_config from qmk.json_schema import deep_update, json_load, validate from qmk.keyboard import config_h, rules_mk @@ -249,8 +249,9 @@ def info_json(keyboard): info_data = _extract_rules_mk(info_data, rules_mk(str(keyboard))) info_data = _extract_config_h(info_data, config_h(str(keyboard))) - # Ensure that we have matrix row and column counts + # Ensure that we have various calculated values info_data = _matrix_size(info_data) + info_data = _joystick_axis_count(info_data) # Merge in data from info_data = _extract_led_config(info_data, str(keyboard)) @@ -800,6 +801,16 @@ def _matrix_size(info_data): return info_data +def _joystick_axis_count(info_data): + """Add info_data['joystick.axis_count'] if required + """ + if 'axes' in info_data.get('joystick', {}): + axes_keys = info_data['joystick']['axes'].keys() + info_data['joystick']['axis_count'] = max(JOYSTICK_AXES.index(a) for a in axes_keys) + 1 if axes_keys else 0 + + return info_data + + def _check_matrix(info_data): """Check the matrix to ensure that row/column count is consistent. """ From 0a5b8928202078a7a64b7fadf11b0fc25a26b4a6 Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 20 Jun 2024 04:43:23 +1000 Subject: [PATCH 015/204] [CLI] Force `dump_lines()` to always use Unix line endings (#23954) --- lib/python/qmk/commands.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/python/qmk/commands.py b/lib/python/qmk/commands.py index 3db8353bfda..873380c28b7 100644 --- a/lib/python/qmk/commands.py +++ b/lib/python/qmk/commands.py @@ -102,7 +102,9 @@ def dump_lines(output_file, lines, quiet=True): output_file.parent.mkdir(parents=True, exist_ok=True) if output_file.exists(): output_file.replace(output_file.parent / (output_file.name + '.bak')) - output_file.write_text(generated, encoding='utf-8') + with open(output_file, 'w', encoding='utf-8', newline='\n') as f: + f.write(generated) + # output_file.write_text(generated, encoding='utf-8', newline='\n') # `newline` needs Python 3.10 if not quiet: cli.log.info(f'Wrote {output_file.name} to {output_file}.') From 751a6b5bc4404e8398b360a925cb95e17be848d8 Mon Sep 17 00:00:00 2001 From: Amir Date: Fri, 21 Jun 2024 02:42:16 +0330 Subject: [PATCH 016/204] add farsi keymap extras (#23650) --- .../extras/keycodes_farsi_0.0.1.hjson | 616 ++++++++++++++++++ docs/reference_keymap_extras.md | 1 + quantum/keymap_extras/keymap_farsi.h | 171 +++++ 3 files changed, 788 insertions(+) create mode 100644 data/constants/keycodes/extras/keycodes_farsi_0.0.1.hjson create mode 100644 quantum/keymap_extras/keymap_farsi.h diff --git a/data/constants/keycodes/extras/keycodes_farsi_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_farsi_0.0.1.hjson new file mode 100644 index 00000000000..d59b6fab264 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_farsi_0.0.1.hjson @@ -0,0 +1,616 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ ۱ │ ۲ │ ۳ │ ۴ │ ۵ │ ۶ │ ۷ │ ۸ │ ۹ │ ۰ │ - │ = │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ ض │ ص │ ث │ ق │ ف │ غ │ ع │ ه │ خ │ ح │ ج │ چ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ ش │ س │ ی │ ب │ ل │ ا │ ت │ ن │ م │ ک │ گ │ \ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ < │ ظ │ ط │ ز │ ر │ ذ │ د │ پ │ و │ . │ / │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "FA_ZWJ", + "label": "(zero-width joiner)", + } + "KC_1": { + "key": "FA_1A", + "label": "۱", + } + "KC_2": { + "key": "FA_2A", + "label": "۲", + } + "KC_3": { + "key": "FA_3A", + "label": "۳", + } + "KC_4": { + "key": "FA_4A", + "label": "۴", + } + "KC_5": { + "key": "FA_5A", + "label": "۵", + } + "KC_6": { + "key": "FA_6A", + "label": "۶", + } + "KC_7": { + "key": "FA_7A", + "label": "۷", + } + "KC_8": { + "key": "FA_8A", + "label": "۸", + } + "KC_9": { + "key": "FA_9A", + "label": "۹", + } + "KC_0": { + "key": "FA_0A", + "label": "۰", + } + "KC_MINS": { + "key": "FA_MINS", + "label": "-", + } + "KC_EQL": { + "key": "FA_EQL", + "label": "=", + } + "KC_Q": { + "key": "FA_ZAD", + "label": "ض", + } + "KC_W": { + "key": "FA_SAD", + "label": "ص", + } + "KC_E": { + "key": "FA_SE", + "label": "ث", + } + "KC_R": { + "key": "FA_QAF", + "label": "ق", + } + "KC_T": { + "key": "FA_FE", + "label": "ف", + } + "KC_Y": { + "key": "FA_GHYN", + "label": "غ", + } + "KC_U": { + "key": "FA_EYN", + "label": "ع", + } + "KC_I": { + "key": "FA_HE", + "label": "ه", + } + "KC_O": { + "key": "FA_KHE", + "label": "خ", + } + "KC_P": { + "key": "FA_HEJ", + "label": "ح", + } + "KC_LBRC": { + "key": "FA_JIM", + "label": "ج", + } + "KC_RBRC": { + "key": "FA_CHE", + "label": "چ", + } + "KC_A": { + "key": "FA_SHIN", + "label": "ش", + } + "KC_S": { + "key": "FA_SIN", + "label": "س", + } + "KC_D": { + "key": "FA_YE", + "label": "ی", + } + "KC_F": { + "key": "FA_BE", + "label": "ب", + } + "KC_G": { + "key": "FA_LAM", + "label": "ل", + } + "KC_H": { + "key": "FA_ALEF", + "label": "ا", + } + "KC_J": { + "key": "FA_TE", + "label": "ت", + } + "KC_K": { + "key": "FA_NOON", + "label": "ن", + } + "KC_L": { + "key": "FA_MIM", + "label": "م", + } + "KC_SCLN": { + "key": "FA_KAF", + "label": "ک", + } + "KC_QUOT": { + "key": "FA_GAF", + "label": "گ", + } + "KC_BSLS": { + "key": "FA_BSLS", + "label": "\\", + } + "KC_LT": { + "key": "FA_LT", + "label": "<", + } + "KC_Z": { + "key": "FA_ZA", + "label": "ظ", + } + "KC_X": { + "key": "FA_TA", + "label": "ط", + } + "KC_C": { + "key": "FA_ZE", + "label": "ز", + } + "KC_V": { + "key": "FA_RE", + "label": "ر", + } + "KC_B": { + "key": "FA_ZAL", + "label": "ذ", + } + "KC_N": { + "key": "FA_DAL", + "label": "د", + } + "KC_M": { + "key": "FA_PE", + "label": "پ", + } + "KC_COMM": { + "key": "FA_WAW", + "label": "و", + } + "KC_DOT": { + "key": "FA_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "FA_SLSH", + "label": "/", + } + "KC_SPC": { + "key": "FA_SPC", + "label": " ", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ÷ │ ! │ ٬ │ ٫ │ ﷼ │ ٪ │ × │ ، │ * │ ) │ ( │ ـ │ + │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ ْ │ ٌ │ ٍ │ ً │ ُ │ ِ │ َ │ ّ │ ] │ [ │ } │ { │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ ؤ │ ئ │ ي │ إ │ أ │ آ │ ة │ » │ « │ : │ ؛ │ | │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ > │ ك │ ٓ │ ژ │ ٰ │ │ ٔ │ ء │ │ │ ؟ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(FA_ZWJ)": { + "key": "FA_DIV", + "label": "÷", + } + "S(FA_1A)": { + "key": "FA_EXLM", + "label": "!", + } + "S(FA_2A)": { + "key": "FA_THS", + "label": "٬", + } + "S(FA_3A)": { + "key": "FA_DECS", + "label": "٫", + } + "S(FA_4A)": { + "key": "FA_RIAL", + "label": "﷼", + } + "S(FA_5A)": { + "key": "FA_PRCA", + "label": "٪", + } + "S(FA_6A)": { + "key": "FA_MUL", + "label": "×", + } + "S(FA_7A)": { + "key": "FA_COMA", + "label": "،", + } + "S(FA_8A)": { + "key": "FA_ASTR", + "label": "*", + } + "S(FA_9A)": { + "key": "FA_RPRN", + "label": ")", + } + "S(FA_0A)": { + "key": "FA_LPRN", + "label": "(", + } + "S(FA_MINS)": { + "key": "FA_TATW", + "label": "ـ", + } + "S(FA_EQL)": { + "key": "FA_PLUS", + "label": "+", + } + "S(FA_ZAD)": { + "key": "FA_SUK", + "label": "ْ", + } + "S(FA_SAD)": { + "key": "FA_DMTN", + "label": "ٌ", + } + "S(FA_SE)": { + "key": "FA_KSTN", + "label": "ٍ", + } + "S(FA_QAF)": { + "key": "FA_FTHN", + "label": "ً", + } + "S(FA_FE)": { + "key": "FA_DMM", + "label": "ُ", + } + "S(FA_GHYN)": { + "key": "FA_KAS", + "label": "ِ", + } + "S(FA_EYN)": { + "key": "FA_FAT", + "label": "َ", + } + "S(FA_HE)": { + "key": "FA_TSDD", + "label": "", + } + "S(FA_KHE)": { + "key": "FA_RBRC", + "label": "]", + } + "S(FA_HEJ)": { + "key": "FA_LBRC", + "label": "[", + } + "S(FA_JIM)": { + "key": "FA_RCBR", + "label": "}", + } + "S(FA_CHE)": { + "key": "FA_LCBR", + "label": "{", + } + "S(FA_SHIN)": { + "key": "FA_HMZV", + "label": "ؤ", + } + "S(FA_SIN)": { + "key": "FA_HMZY", + "label": "ئ", + } + "S(FA_YE)": { + "key": "FA_YEA", + "label": "ي", + } + "S(FA_BE)": { + "key": "FA_HMZU", + "label": "إ", + } + "S(FA_LAM)": { + "key": "FA_HMZO", + "label": "أ", + } + "S(FA_ALEF)": { + "key": "FA_MALF", + "label": "آ", + } + "S(FA_TE)": { + "key": "FA_TEHM", + "label": "ة", + } + "S(FA_NOON)": { + "key": "FA_RQOT", + "label": "»", + } + "S(FA_MIM)": { + "key": "FA_LQOT", + "label": "«", + } + "S(FA_KAF)": { + "key": "FA_COLN", + "label": ":", + } + "S(FA_GAF)": { + "key": "FA_SCLA", + "label": "؛", + } + "S(FA_LT)": { + "key": "FA_GT", + "label": ">", + } + "S(FA_ZA)": { + "key": "FA_KAFA", + "label": "ك", + } + "S(FA_TA)": { + "key": "FA_MADO", + "label": "ٓ", + } + "S(FA_ZE)": { + "key": "FA_JEH", + "label": "ژ", + } + "S(FA_RE)": { + "key": "FA_SUPA", + "label": "ٰ", + } + "S(FA_ZAL)": { + "key": "FA_ZWNJ", + "label": "(zero-width non-joiner)", + } + "S(FA_DAL)": { + "key": "FA_HMZA", + "label": "ٔ", + } + "S(FA_PE)": { + "key": "FA_HMZ", + "label": "ء", + } + "S(FA_SLSH)": { + "key": "FA_QSA", + "label": "؟", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ~ │ ` │ @ │ # │ $ │ % │ ^ │ & │ • │ │ │ _ │ − │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ ° │ │ € │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ ى │ │ │ ٱ │ │ ﴾ │ ﴿ │ ; │ " │ ‐ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ | │ │ │ │ ٖ │ │ ٕ │ … │ , │ ' │ ? │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(FA_ZWJ)": { + "key": "FA_TILD", + "label": "~", + } + "ALGR(FA_1A)": { + "key": "FA_GRV", + "label": "`", + } + "ALGR(FA_2A)": { + "key": "FA_AT", + "label": "@", + } + "ALGR(FA_3A)": { + "key": "FA_HASH", + "label": "#", + } + "ALGR(FA_4A)": { + "key": "FA_DLR", + "label": "$", + } + "ALGR(FA_5A)": { + "key": "FA_PERC", + "label": "%", + } + "ALGR(FA_6A)": { + "key": "FA_CIRC", + "label": "^", + } + "ALGR(FA_7A)": { + "key": "FA_AMPR", + "label": "&", + } + "ALGR(FA_8A)": { + "key": "FA_BULT", + "label": "•", + } + "ALGR(FA_9A)": { + "key": "FA_LRM", + "label": "(left-to-right mark)", + } + "ALGR(FA_0A)": { + "key": "FA_RLM", + "label": "(right-to-left mark)", + } + "ALGR(FA_MINS)": { + "key": "FA_UNDS", + "label": "_", + } + "ALGR(FA_EQL)": { + "key": "FA_DMNS", + "label": "− (dead)", + } + "ALGR(FA_ZAD)": { + "key": "FA_DEG", + "label": "°", + } + "ALGR(FA_SE)": { + "key": "FA_EURO", + "label": "€", + } + "ALGR(FA_HE)": { + "key": "FA_LRO", + "label": "(left-to-right override)", + } + "ALGR(FA_KHE)": { + "key": "FA_RLO", + "label": "(right-to-left override)", + } + "ALGR(FA_HEJ)": { + "key": "FA_PDF", + "label": "(pop directional formatting)", + } + "ALGR(FA_JIM)": { + "key": "FA_LRE", + "label": "(left-to-right embedding)", + } + "ALGR(FA_CHE)": { + "key": "FA_RLE", + "label": "(right-to-left embedding)", + } + "ALGR(FA_YE)": { + "key": "FA_ALFM", + "label": "ى", + } + "ALGR(FA_ALEF)": { + "key": "FA_ALFW", + "label": "ٱ", + } + "ALGR(FA_NOON)": { + "key": "FA_LORP", + "label": "﴾", + } + "ALGR(FA_MIM)": { + "key": "FA_RORP", + "label": "﴿", + } + "ALGR(FA_KAF)": { + "key": "FA_SCLN", + "label": ";", + } + "ALGR(FA_GAF)": { + "key": "FA_DQT", + "label": "\"", + } + "ALGR(FA_BSLS)": { + "key": "FA_MINA", + "label": "-", + } + "ALGR(FA_ZA)": { + "key": "FA_PIPE", + "label": "|", + } + "ALGR(FA_RA)": { + "key": "FA_SUBA", + "label": "ٖ", + } + "ALGR(FA_DAL)": { + "key": "FA_HMZB", + "label": "ء", + } + "ALGR(FA_PE)": { + "key": "FA_ELLP", + "label": "…", + } + "ALGR(FA_WAW)": { + "key": "FA_COMM", + "label": ",", + } + "ALGR(FA_DOT)": { + "key": "FA_QUOT", + "label": "'", + } + "ALGR(FA_SLSH)": { + "key": "FA_QUES", + "label": "?", + } +/* Shift+AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ ¦ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(ALGR(FA_1A))": { + "key": "FA_1", + "label": "1", + } + "S(ALGR(FA_2A))": { + "key": "FA_2", + "label": "2", + } + "S(ALGR(FA_3A))": { + "key": "FA_3", + "label": "3", + } + "S(ALGR(FA_4A))": { + "key": "FA_4", + "label": "4", + } + "S(ALGR(FA_5A))": { + "key": "FA_5", + "label": "5", + } + "S(ALGR(FA_6A))": { + "key": "FA_6", + "label": "6", + } + "S(ALGR(FA_7A))": { + "key": "FA_7", + "label": "7", + } + "S(ALGR(FA_8A))": { + "key": "FA_8", + "label": "8", + } + "S(ALGR(FA_9A))": { + "key": "FA_9", + "label": "9", + } + "S(ALGR(FA_0A))": { + "key": "FA_0", + "label": "0", + } + "S(ALGR(FA_LT))": { + "key": "FA_BRKP", + "label": "¦", + } + "S(ALGR(FA_SPC))": { + "key": "FA_NNBS", + "label": "(narrow non-breaking space)", + } + } +} diff --git a/docs/reference_keymap_extras.md b/docs/reference_keymap_extras.md index 191e0d4ea8d..d45183b6c6a 100644 --- a/docs/reference_keymap_extras.md +++ b/docs/reference_keymap_extras.md @@ -33,6 +33,7 @@ These headers are located in [`quantum/keymap_extras/`](https://github.com/qmk/q |English (US International) |`keymap_us_international.h` |`sendstring_us_international.h` | |English (US International, Linux)|`keymap_us_international_linux.h`| | |Estonian |`keymap_estonian.h` |`sendstring_estonian.h` | +|Farsi |`keymap_farsi.h` | | |Finnish |`keymap_finnish.h` |`sendstring_finnish.h` | |French |`keymap_french.h` |`sendstring_french.h` | |French (AFNOR) |`keymap_french_afnor.h` |`sendstring_french_afnor.h` | diff --git a/quantum/keymap_extras/keymap_farsi.h b/quantum/keymap_extras/keymap_farsi.h new file mode 100644 index 00000000000..d2689175131 --- /dev/null +++ b/quantum/keymap_extras/keymap_farsi.h @@ -0,0 +1,171 @@ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ + +#pragma once +#include "keycodes.h" +// clang-format off + +// Aliases +#define FA_ZWJ KC_GRV // (zero-width joiner) +#define FA_1A KC_1 // ۱ +#define FA_2A KC_2 // ۲ +#define FA_3A KC_3 // ۳ +#define FA_4A KC_4 // ۴ +#define FA_5A KC_5 // ۵ +#define FA_6A KC_6 // ۶ +#define FA_7A KC_7 // ۷ +#define FA_8A KC_8 // ۸ +#define FA_9A KC_9 // ۹ +#define FA_0A KC_0 // ۰ +#define FA_MINS KC_MINS // - +#define FA_EQL KC_EQL // = +#define FA_ZAD KC_Q // ض +#define FA_SAD KC_W // ص +#define FA_SE KC_E // ث +#define FA_QAF KC_R // ق +#define FA_FE KC_T // ف +#define FA_GHYN KC_Y // غ +#define FA_EYN KC_U // ع +#define FA_HE KC_I // ه +#define FA_KHE KC_O // خ +#define FA_HEJ KC_P // ح +#define FA_JIM KC_LBRC // ج +#define FA_CHE KC_RBRC // چ +#define FA_SHIN KC_A // ش +#define FA_SIN KC_S // س +#define FA_YE KC_D // ی +#define FA_BE KC_F // ب +#define FA_LAM KC_G // ل +#define FA_ALEF KC_H // ا +#define FA_TE KC_J // ت +#define FA_NOON KC_K // ن +#define FA_MIM KC_L // م +#define FA_KAF KC_SCLN // ک +#define FA_GAF KC_QUOT // گ +#define FA_BSLS KC_BSLS // (backslash) +#define FA_LT KC_LT // < +#define FA_ZA KC_Z // ظ +#define FA_TA KC_X // ط +#define FA_ZE KC_C // ز +#define FA_RE KC_V // ر +#define FA_ZAL KC_B // ذ +#define FA_DAL KC_N // د +#define FA_PE KC_M // پ +#define FA_WAW KC_COMM // و +#define FA_DOT KC_DOT // . +#define FA_SLSH KC_SLSH // / +#define FA_SPC KC_SPC // +#define FA_DIV S(FA_ZWJ) // ÷ +#define FA_EXLM S(FA_1A) // ! +#define FA_THS S(FA_2A) // ٬ +#define FA_DECS S(FA_3A) // ٫ +#define FA_RIAL S(FA_4A) // ﷼ +#define FA_PRCA S(FA_5A) // ٪ +#define FA_MUL S(FA_6A) // × +#define FA_COMA S(FA_7A) // ، +#define FA_ASTR S(FA_8A) // * +#define FA_RPRN S(FA_9A) // ) +#define FA_LPRN S(FA_0A) // ( +#define FA_TATW S(FA_MINS) // ـ +#define FA_PLUS S(FA_EQL) // + +#define FA_SUK S(FA_ZAD) // ْ +#define FA_DMTN S(FA_SAD) // ٌ +#define FA_KSTN S(FA_SE) // ٍ +#define FA_FTHN S(FA_QAF) // ً +#define FA_DMM S(FA_FE) // ُ +#define FA_KAS S(FA_GHYN) // ِ +#define FA_FAT S(FA_EYN) // َ +#define FA_TSDD S(FA_HE) // +#define FA_RBRC S(FA_KHE) // ] +#define FA_LBRC S(FA_HEJ) // [ +#define FA_RCBR S(FA_JIM) // } +#define FA_LCBR S(FA_CHE) // { +#define FA_HMZV S(FA_SHIN) // ؤ +#define FA_HMZY S(FA_SIN) // ئ +#define FA_YEA S(FA_YE) // ي +#define FA_HMZU S(FA_BE) // إ +#define FA_HMZO S(FA_LAM) // أ +#define FA_MALF S(FA_ALEF) // آ +#define FA_TEHM S(FA_TE) // ة +#define FA_RQOT S(FA_NOON) // » +#define FA_LQOT S(FA_MIM) // « +#define FA_COLN S(FA_KAF) // : +#define FA_SCLA S(FA_GAF) // ؛ +#define FA_GT S(FA_LT) // > +#define FA_KAFA S(FA_ZA) // ك +#define FA_MADO S(FA_TA) // ٓ +#define FA_JEH S(FA_ZE) // ژ +#define FA_SUPA S(FA_RE) // ٰ +#define FA_ZWNJ S(FA_ZAL) // (zero-width non-joiner) +#define FA_HMZA S(FA_DAL) // ٔ +#define FA_HMZ S(FA_PE) // ء +#define FA_QSA S(FA_SLSH) // ؟ +#define FA_TILD ALGR(FA_ZWJ) // ~ +#define FA_GRV ALGR(FA_1A) // ` +#define FA_AT ALGR(FA_2A) // @ +#define FA_HASH ALGR(FA_3A) // # +#define FA_DLR ALGR(FA_4A) // $ +#define FA_PERC ALGR(FA_5A) // % +#define FA_CIRC ALGR(FA_6A) // ^ +#define FA_AMPR ALGR(FA_7A) // & +#define FA_BULT ALGR(FA_8A) // • +#define FA_LRM ALGR(FA_9A) // (left-to-right mark) +#define FA_RLM ALGR(FA_0A) // (right-to-left mark) +#define FA_UNDS ALGR(FA_MINS) // _ +#define FA_DMNS ALGR(FA_EQL) // − (dead) +#define FA_DEG ALGR(FA_ZAD) // ° +#define FA_EURO ALGR(FA_SE) // € +#define FA_LRO ALGR(FA_HE) // (left-to-right override) +#define FA_RLO ALGR(FA_KHE) // (right-to-left override) +#define FA_PDF ALGR(FA_HEJ) // (pop directional formatting) +#define FA_LRE ALGR(FA_JIM) // (left-to-right embedding) +#define FA_RLE ALGR(FA_CHE) // (right-to-left embedding) +#define FA_ALFM ALGR(FA_YE) // ى +#define FA_ALFW ALGR(FA_ALEF) // ٱ +#define FA_LORP ALGR(FA_NOON) // ﴾ +#define FA_RORP ALGR(FA_MIM) // ﴿ +#define FA_SCLN ALGR(FA_KAF) // ; +#define FA_DQT ALGR(FA_GAF) // " +#define FA_MINA ALGR(FA_BSLS) // - +#define FA_PIPE ALGR(FA_ZA) // | +#define FA_SUBA ALGR(FA_RA) // ٖ +#define FA_HMZB ALGR(FA_DAL) // ء +#define FA_ELLP ALGR(FA_PE) // … +#define FA_COMM ALGR(FA_WAW) // , +#define FA_QUOT ALGR(FA_DOT) // ' +#define FA_QUES ALGR(FA_SLSH) // ? +#define FA_1 S(ALGR(FA_1A)) // 1 +#define FA_2 S(ALGR(FA_2A)) // 2 +#define FA_3 S(ALGR(FA_3A)) // 3 +#define FA_4 S(ALGR(FA_4A)) // 4 +#define FA_5 S(ALGR(FA_5A)) // 5 +#define FA_6 S(ALGR(FA_6A)) // 6 +#define FA_7 S(ALGR(FA_7A)) // 7 +#define FA_8 S(ALGR(FA_8A)) // 8 +#define FA_9 S(ALGR(FA_9A)) // 9 +#define FA_0 S(ALGR(FA_0A)) // 0 +#define FA_BRKP S(ALGR(FA_LT)) // ¦ +#define FA_NNBS S(ALGR(FA_SPC)) // (narrow non-breaking space) + From 99aa4f5191ae0e120503385869b3b24baeaf223a Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sat, 22 Jun 2024 09:10:12 +0100 Subject: [PATCH 017/204] Migrate `led_update_kb` implementations to DD (#23980) --- keyboards/aeboards/ext65/rev1/keyboard.json | 5 ++ keyboards/aeboards/ext65/rev1/rev1.c | 19 ++----- keyboards/aeboards/ext65/rev2/keyboard.json | 5 ++ keyboards/aeboards/ext65/rev2/rev2.c | 15 ------ keyboards/heliar/wm1_hotswap/keyboard.json | 6 +++ keyboards/heliar/wm1_hotswap/wm1_hotswap.c | 39 -------------- keyboards/hineybush/h10/h10.c | 34 ------------- keyboards/hineybush/h10/keyboard.json | 4 ++ keyboards/hineybush/h60/h60.c | 31 ----------- keyboards/hineybush/h60/keyboard.json | 4 ++ keyboards/hineybush/h87a/h87a.c | 16 ------ keyboards/hineybush/h87a/keyboard.json | 5 ++ keyboards/hineybush/h88/h88.c | 16 ------ keyboards/hineybush/h88/keyboard.json | 5 ++ keyboards/hineybush/physix/keyboard.json | 4 ++ keyboards/hineybush/physix/physix.c | 49 ------------------ keyboards/kc60se/kc60se.c | 30 ----------- keyboards/kc60se/keyboard.json | 4 ++ .../classy_tkl/rev_a/keyboard.json | 4 ++ .../masterworks/classy_tkl/rev_a/rev_a.c | 42 --------------- keyboards/matrix/cain_re/cain_re.c | 40 --------------- keyboards/matrix/cain_re/config.h | 24 --------- keyboards/matrix/cain_re/keyboard.json | 5 ++ keyboards/matrix/m12og/rev2/keyboard.json | 6 +++ keyboards/matrix/m12og/rev2/rev2.c | 23 --------- keyboards/quad_h/lb75/keyboard.json | 5 ++ keyboards/quad_h/lb75/lb75.c | 39 -------------- keyboards/rmi_kb/wete/v1/keyboard.json | 6 +++ keyboards/rmi_kb/wete/v1/v1.c | 35 ------------- .../switchplate/southpaw_65/keyboard.json | 4 ++ .../switchplate/southpaw_65/southpaw_65.c | 30 ----------- .../southpaw_fullsize/keyboard.json | 6 +++ .../southpaw_fullsize/southpaw_fullsize.c | 51 ------------------- .../westfoxtrot/cypher/rev1/keyboard.json | 5 ++ keyboards/westfoxtrot/cypher/rev1/rev1.c | 31 ----------- .../westfoxtrot/cypher/rev5/keyboard.json | 5 ++ keyboards/westfoxtrot/cypher/rev5/rev5.c | 31 ----------- keyboards/westfoxtrot/prophet/keyboard.json | 3 ++ keyboards/westfoxtrot/prophet/prophet.c | 11 +--- 39 files changed, 96 insertions(+), 601 deletions(-) delete mode 100644 keyboards/heliar/wm1_hotswap/wm1_hotswap.c delete mode 100644 keyboards/hineybush/h10/h10.c delete mode 100644 keyboards/hineybush/h60/h60.c delete mode 100644 keyboards/hineybush/physix/physix.c delete mode 100644 keyboards/kc60se/kc60se.c delete mode 100644 keyboards/masterworks/classy_tkl/rev_a/rev_a.c delete mode 100644 keyboards/matrix/cain_re/cain_re.c delete mode 100644 keyboards/matrix/cain_re/config.h delete mode 100644 keyboards/matrix/m12og/rev2/rev2.c delete mode 100644 keyboards/quad_h/lb75/lb75.c delete mode 100644 keyboards/rmi_kb/wete/v1/v1.c delete mode 100644 keyboards/switchplate/southpaw_65/southpaw_65.c delete mode 100644 keyboards/switchplate/southpaw_fullsize/southpaw_fullsize.c delete mode 100644 keyboards/westfoxtrot/cypher/rev1/rev1.c delete mode 100644 keyboards/westfoxtrot/cypher/rev5/rev5.c diff --git a/keyboards/aeboards/ext65/rev1/keyboard.json b/keyboards/aeboards/ext65/rev1/keyboard.json index c254a671421..1d105505e53 100644 --- a/keyboards/aeboards/ext65/rev1/keyboard.json +++ b/keyboards/aeboards/ext65/rev1/keyboard.json @@ -13,6 +13,11 @@ "extrakey": true, "nkro": true }, + "indicators": { + "caps_lock": "D3", + "num_lock": "D5", + "scroll_lock": "D2" + }, "processor": "atmega32u4", "bootloader": "atmel-dfu", "diode_direction": "COL2ROW", diff --git a/keyboards/aeboards/ext65/rev1/rev1.c b/keyboards/aeboards/ext65/rev1/rev1.c index 344a2bcb322..fc8280a5e4e 100644 --- a/keyboards/aeboards/ext65/rev1/rev1.c +++ b/keyboards/aeboards/ext65/rev1/rev1.c @@ -16,23 +16,10 @@ #include "quantum.h" -void keyboard_pre_init_user(void) { - // Call the keyboard pre init code. - // Set our LED pins as output - gpio_set_pin_output(D5); - gpio_set_pin_output(D3); - gpio_set_pin_output(D2); - gpio_set_pin_output(D1); -} +void keyboard_pre_init_kb(void) { + gpio_set_pin_output(D1); -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(D5, led_state.num_lock); - gpio_write_pin(D3, led_state.caps_lock); - gpio_write_pin(D2, led_state.scroll_lock); - } - return res; + keyboard_pre_init_user(); } layer_state_t layer_state_set_kb(layer_state_t state) { diff --git a/keyboards/aeboards/ext65/rev2/keyboard.json b/keyboards/aeboards/ext65/rev2/keyboard.json index 0ab50f92582..ab7cceeefb3 100644 --- a/keyboards/aeboards/ext65/rev2/keyboard.json +++ b/keyboards/aeboards/ext65/rev2/keyboard.json @@ -22,6 +22,11 @@ "levels": 6, "breathing": true }, + "indicators": { + "caps_lock": "B3", + "num_lock": "B4", + "scroll_lock": "A15" + }, "rgblight": { "led_count": 24, "animations": { diff --git a/keyboards/aeboards/ext65/rev2/rev2.c b/keyboards/aeboards/ext65/rev2/rev2.c index 5922b601cd1..7b8ebb00875 100644 --- a/keyboards/aeboards/ext65/rev2/rev2.c +++ b/keyboards/aeboards/ext65/rev2/rev2.c @@ -69,26 +69,11 @@ bool oled_task_kb(void) { #else void keyboard_pre_init_kb(void) { - // Call the keyboard pre init code. - // Set our LED pins as output - gpio_set_pin_output(B4); - gpio_set_pin_output(B3); - gpio_set_pin_output(A15); gpio_set_pin_output(A14); keyboard_pre_init_user(); } -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if (res) { - gpio_write_pin(B4, led_state.num_lock); - gpio_write_pin(B3, led_state.caps_lock); - gpio_write_pin(A15, led_state.scroll_lock); - } - return res; -} - layer_state_t layer_state_set_kb(layer_state_t state) { switch (get_highest_layer(state)) { case 1: diff --git a/keyboards/heliar/wm1_hotswap/keyboard.json b/keyboards/heliar/wm1_hotswap/keyboard.json index 3fa1a8e6cb8..789a3c7d2b6 100644 --- a/keyboards/heliar/wm1_hotswap/keyboard.json +++ b/keyboards/heliar/wm1_hotswap/keyboard.json @@ -25,6 +25,12 @@ "backlight": { "pin": "B7" }, + "indicators": { + "caps_lock": "D6", + "num_lock": "D7", + "scroll_lock": "D4", + "on_state": 0 + }, "processor": "atmega32u4", "bootloader": "atmel-dfu", "layouts": { diff --git a/keyboards/heliar/wm1_hotswap/wm1_hotswap.c b/keyboards/heliar/wm1_hotswap/wm1_hotswap.c deleted file mode 100644 index d2d10b0b1f1..00000000000 --- a/keyboards/heliar/wm1_hotswap/wm1_hotswap.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright 2019 HELIAR MK - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - - -void keyboard_pre_init_kb(void) -{ - gpio_set_pin_output(D7); - gpio_write_pin_high(D7); - gpio_set_pin_output(D6); - gpio_write_pin_high(D6); - gpio_set_pin_output(D4); - gpio_write_pin_high(D4); -} - -bool led_update_kb(led_t led_state) { - - if (led_update_user(led_state)){ - gpio_write_pin(D7, !led_state.num_lock); - gpio_write_pin(D6, !led_state.caps_lock); - gpio_write_pin(D4, !led_state.scroll_lock); - } - - return true; -} diff --git a/keyboards/hineybush/h10/h10.c b/keyboards/hineybush/h10/h10.c deleted file mode 100644 index 2170a8b2d7b..00000000000 --- a/keyboards/hineybush/h10/h10.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright 2020 hineybush - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -// Optional override functions below. -// You can leave any or all of these undefined. -// These are only required if you want to perform custom actions. - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - gpio_set_pin_output(F7); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - gpio_write_pin(F7, !led_state.num_lock); - } - return true; -} diff --git a/keyboards/hineybush/h10/keyboard.json b/keyboards/hineybush/h10/keyboard.json index 73205f85ffc..63a109f4843 100644 --- a/keyboards/hineybush/h10/keyboard.json +++ b/keyboards/hineybush/h10/keyboard.json @@ -32,6 +32,10 @@ "pin": "B7", "breathing": true }, + "indicators": { + "caps_lock": "F7", + "on_state": 0 + }, "processor": "atmega32u4", "bootloader": "atmel-dfu", "community_layouts": ["ortho_6x4", "numpad_6x4"], diff --git a/keyboards/hineybush/h60/h60.c b/keyboards/hineybush/h60/h60.c deleted file mode 100644 index 472b99d8ba1..00000000000 --- a/keyboards/hineybush/h60/h60.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright 2020 hineybush - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - gpio_set_pin_output(C6); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - gpio_write_pin(C6, !led_state.caps_lock); - } - return true; -} - diff --git a/keyboards/hineybush/h60/keyboard.json b/keyboards/hineybush/h60/keyboard.json index 8a019d42da3..ea058b6d646 100644 --- a/keyboards/hineybush/h60/keyboard.json +++ b/keyboards/hineybush/h60/keyboard.json @@ -34,6 +34,10 @@ "pin": "B7", "levels": 12 }, + "indicators": { + "caps_lock": "C6", + "on_state": 0 + }, "rgblight": { "saturation_steps": 8, "brightness_steps": 8, diff --git a/keyboards/hineybush/h87a/h87a.c b/keyboards/hineybush/h87a/h87a.c index f2d0c62813e..8c10b68ca0e 100644 --- a/keyboards/hineybush/h87a/h87a.c +++ b/keyboards/hineybush/h87a/h87a.c @@ -15,22 +15,6 @@ */ #include "quantum.h" -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - gpio_set_pin_output(D5); - gpio_set_pin_output(E6); - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - gpio_write_pin(D5, !led_state.caps_lock); - gpio_write_pin(E6, !led_state.scroll_lock); - } - return true; -} - void eeconfig_init_kb(void) { // EEPROM is getting reset! rgblight_enable(); // Enable RGB by default rgblight_sethsv(0, 255, 128); // Set default HSV - red hue, full saturation, medium brightness diff --git a/keyboards/hineybush/h87a/keyboard.json b/keyboards/hineybush/h87a/keyboard.json index e9096201d92..987d1a60fdb 100644 --- a/keyboards/hineybush/h87a/keyboard.json +++ b/keyboards/hineybush/h87a/keyboard.json @@ -35,6 +35,11 @@ "backlight": { "pin": "B7" }, + "indicators": { + "caps_lock": "D5", + "scroll_lock": "E6", + "on_state": 0 + }, "ws2812": { "pin": "D3" }, diff --git a/keyboards/hineybush/h88/h88.c b/keyboards/hineybush/h88/h88.c index a916609d75e..7c634467511 100644 --- a/keyboards/hineybush/h88/h88.c +++ b/keyboards/hineybush/h88/h88.c @@ -15,22 +15,6 @@ */ #include "quantum.h" -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - gpio_set_pin_output(D5); - gpio_set_pin_output(E6); - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - gpio_write_pin(D5, !led_state.caps_lock); - gpio_write_pin(E6, !led_state.scroll_lock); - } - return true; -} - void eeconfig_init_kb(void) { // EEPROM is getting reset! rgblight_enable(); // Enable RGB by default rgblight_sethsv(0, 255, 128); // Set default HSV - red hue, full saturation, medium brightness diff --git a/keyboards/hineybush/h88/keyboard.json b/keyboards/hineybush/h88/keyboard.json index e74a3f36234..b1bb8423035 100644 --- a/keyboards/hineybush/h88/keyboard.json +++ b/keyboards/hineybush/h88/keyboard.json @@ -35,6 +35,11 @@ "backlight": { "pin": "B7" }, + "indicators": { + "caps_lock": "D5", + "scroll_lock": "E6", + "on_state": 0 + }, "rgblight": { "saturation_steps": 8, "brightness_steps": 8, diff --git a/keyboards/hineybush/physix/keyboard.json b/keyboards/hineybush/physix/keyboard.json index b7b1c05393e..79a0bea7aba 100644 --- a/keyboards/hineybush/physix/keyboard.json +++ b/keyboards/hineybush/physix/keyboard.json @@ -33,6 +33,10 @@ "pin": "B7", "breathing": true }, + "indicators": { + "caps_lock": "D3", + "scroll_lock": "D5" + }, "rgblight": { "saturation_steps": 8, "brightness_steps": 8, diff --git a/keyboards/hineybush/physix/physix.c b/keyboards/hineybush/physix/physix.c deleted file mode 100644 index cd920a72b30..00000000000 --- a/keyboards/hineybush/physix/physix.c +++ /dev/null @@ -1,49 +0,0 @@ -/* Copyright 2019 hineybush - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -// Optional override functions below. -// You can leave any or all of these undefined. -// These are only required if you want to perform custom actions. - - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - gpio_set_pin_output(D3); - gpio_set_pin_output(D5); - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - bool res = led_update_user(led_state); - if(res) { - // gpio_write_pin sets the pin high for 1 and low for 0. - // In this example the pins are inverted, setting - // it low/0 turns it on, and high/1 turns the LED off. - // This behavior depends on whether the LED is between the pin - // and VCC or the pin and GND. - gpio_write_pin(D3, led_state.caps_lock); - gpio_write_pin(D5, led_state.scroll_lock); - } - return res; - return led_update_user(led_state); -} - - - diff --git a/keyboards/kc60se/kc60se.c b/keyboards/kc60se/kc60se.c deleted file mode 100644 index a7d60079b2e..00000000000 --- a/keyboards/kc60se/kc60se.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright 2017 Blake C. Lewis - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -void matrix_init_kb(void){ - gpio_set_pin_output(B2); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(B2, !led_state.caps_lock); - } - return res; -} - diff --git a/keyboards/kc60se/keyboard.json b/keyboards/kc60se/keyboard.json index b7123b5749d..c8bdf24a4b8 100644 --- a/keyboards/kc60se/keyboard.json +++ b/keyboards/kc60se/keyboard.json @@ -27,6 +27,10 @@ "pin": "F5", "levels": 6 }, + "indicators": { + "caps_lock": "B2", + "on_state": 0 + }, "processor": "atmega32u4", "bootloader": "atmel-dfu", "community_layouts": ["60_ansi", "60_ansi_split_bs_rshift", "60_iso", "60_iso_split_bs_rshift"], diff --git a/keyboards/masterworks/classy_tkl/rev_a/keyboard.json b/keyboards/masterworks/classy_tkl/rev_a/keyboard.json index d3e723d413d..889aa6d3f90 100644 --- a/keyboards/masterworks/classy_tkl/rev_a/keyboard.json +++ b/keyboards/masterworks/classy_tkl/rev_a/keyboard.json @@ -22,6 +22,10 @@ "resync": true } }, + "indicators": { + "caps_lock": "B5", + "scroll_lock": "B6" + }, "matrix_pins": { "cols": ["B4", "D7", "D6", "D4", "C6", "D5", "D3", "D2", "D1", "D0", "B7", "B3", "B2", "B1", "B0", "E6", "F7"], "rows": ["C7", "F0", "F1", "F4", "F5", "F6"] diff --git a/keyboards/masterworks/classy_tkl/rev_a/rev_a.c b/keyboards/masterworks/classy_tkl/rev_a/rev_a.c deleted file mode 100644 index 6e01c217d2d..00000000000 --- a/keyboards/masterworks/classy_tkl/rev_a/rev_a.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright 2020 Mathias Andersson - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "quantum.h" - -#define CAPS_PIN B5 -#define SCROLL_PIN B6 - -// Optional override functions below. -// You can leave any or all of these undefined. -// These are only required if you want to perform custom actions. - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - gpio_set_pin_output(CAPS_PIN); - gpio_set_pin_output(SCROLL_PIN); - - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(CAPS_PIN, led_state.caps_lock); - gpio_write_pin(SCROLL_PIN, led_state.scroll_lock); - } - return res; -} diff --git a/keyboards/matrix/cain_re/cain_re.c b/keyboards/matrix/cain_re/cain_re.c deleted file mode 100644 index 6dc24f22926..00000000000 --- a/keyboards/matrix/cain_re/cain_re.c +++ /dev/null @@ -1,40 +0,0 @@ -/** - * cain_re.c - * - Copyright 2020 astro - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - */ - -#include "quantum.h" - -void matrix_init_kb(void) -{ - gpio_set_pin_output(NUM_PIN); - gpio_set_pin_output(CAPS_PIN); - gpio_set_pin_output(SCROLL_PIN); - - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) -{ - bool res = led_update_user(led_state); - if (res) { - gpio_write_pin(NUM_PIN, led_state.num_lock); - gpio_write_pin(CAPS_PIN, led_state.caps_lock); - gpio_write_pin(SCROLL_PIN, led_state.scroll_lock); - } - return res; -} diff --git a/keyboards/matrix/cain_re/config.h b/keyboards/matrix/cain_re/config.h deleted file mode 100644 index 9469d689d0c..00000000000 --- a/keyboards/matrix/cain_re/config.h +++ /dev/null @@ -1,24 +0,0 @@ -/** - * config.h - * - Copyright 2020 astro - - 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 CAPS_PIN D3 -#define NUM_PIN F7 -#define SCROLL_PIN B0 diff --git a/keyboards/matrix/cain_re/keyboard.json b/keyboards/matrix/cain_re/keyboard.json index 02c6cbbeb56..7d93e806c25 100644 --- a/keyboards/matrix/cain_re/keyboard.json +++ b/keyboards/matrix/cain_re/keyboard.json @@ -8,6 +8,11 @@ "pid": "0x0106", "device_version": "0.0.1" }, + "indicators": { + "caps_lock": "D3", + "num_lock": "F7", + "scroll_lock": "B0" + }, "rgblight": { "saturation_steps": 8, "brightness_steps": 8, diff --git a/keyboards/matrix/m12og/rev2/keyboard.json b/keyboards/matrix/m12og/rev2/keyboard.json index 42df6a75e87..45fcffe9eb6 100644 --- a/keyboards/matrix/m12og/rev2/keyboard.json +++ b/keyboards/matrix/m12og/rev2/keyboard.json @@ -8,6 +8,12 @@ "pid": "0x8712", "device_version": "0.0.1" }, + "indicators": { + "caps_lock": "C6", + "num_lock": "B1", + "scroll_lock": "B2", + "on_state": 0 + }, "rgblight": { "saturation_steps": 8, "brightness_steps": 8, diff --git a/keyboards/matrix/m12og/rev2/rev2.c b/keyboards/matrix/m12og/rev2/rev2.c deleted file mode 100644 index e64640b2d2d..00000000000 --- a/keyboards/matrix/m12og/rev2/rev2.c +++ /dev/null @@ -1,23 +0,0 @@ -/** - * rev2.c - */ - -#include "quantum.h" - -void matrix_init_kb(void) { - gpio_set_pin_output(C6); - gpio_set_pin_output(B2); - gpio_set_pin_output(B1); - - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if (res) { - gpio_write_pin(B1, !led_state.num_lock); - gpio_write_pin(C6, !led_state.caps_lock); - gpio_write_pin(B2, !led_state.scroll_lock); - } - return res; -} diff --git a/keyboards/quad_h/lb75/keyboard.json b/keyboards/quad_h/lb75/keyboard.json index 0a51d4f47f4..e88ba4b3a4e 100644 --- a/keyboards/quad_h/lb75/keyboard.json +++ b/keyboards/quad_h/lb75/keyboard.json @@ -33,6 +33,11 @@ "pin": "B7", "levels": 5 }, + "indicators": { + "caps_lock": "B1", + "scroll_lock": "B2", + "on_state": 0 + }, "ws2812": { "pin": "B0" }, diff --git a/keyboards/quad_h/lb75/lb75.c b/keyboards/quad_h/lb75/lb75.c deleted file mode 100644 index ef716092b9f..00000000000 --- a/keyboards/quad_h/lb75/lb75.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright 2019 Ryota Goto - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "quantum.h" - - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - gpio_set_pin_output(B1); - gpio_set_pin_output(B2); - - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - - if(res) { - gpio_write_pin(B1, !led_state.caps_lock); - gpio_write_pin(B2, !led_state.scroll_lock); - } - - return res; -} - diff --git a/keyboards/rmi_kb/wete/v1/keyboard.json b/keyboards/rmi_kb/wete/v1/keyboard.json index 8e8059c103d..c9a54f76c20 100644 --- a/keyboards/rmi_kb/wete/v1/keyboard.json +++ b/keyboards/rmi_kb/wete/v1/keyboard.json @@ -35,6 +35,12 @@ "levels": 24, "breathing": true }, + "indicators": { + "caps_lock": "B3", + "num_lock": "A14", + "scroll_lock": "A15", + "on_state": 0 + }, "rgblight": { "led_count": 24, "animations": { diff --git a/keyboards/rmi_kb/wete/v1/v1.c b/keyboards/rmi_kb/wete/v1/v1.c deleted file mode 100644 index 34a09174684..00000000000 --- a/keyboards/rmi_kb/wete/v1/v1.c +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright 2020 Ramon Imbao - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -void keyboard_pre_init_user(void) { - // Initialize indicator LED pins - gpio_set_pin_output(A14); // Num Lock - gpio_set_pin_output(A15); // Scroll Lock - gpio_set_pin_output(B3); // Caps Lock -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if (res) { - gpio_write_pin(A14, !led_state.num_lock); - gpio_write_pin(A15, !led_state.scroll_lock); - gpio_write_pin(B3, !led_state.caps_lock); - } - - return res; -} diff --git a/keyboards/switchplate/southpaw_65/keyboard.json b/keyboards/switchplate/southpaw_65/keyboard.json index e4090e49c72..72c4c71097e 100644 --- a/keyboards/switchplate/southpaw_65/keyboard.json +++ b/keyboards/switchplate/southpaw_65/keyboard.json @@ -29,6 +29,10 @@ "pin": "B5", "levels": 10 }, + "indicators": { + "caps_lock": "B6", + "on_state": 0 + }, "rgblight": { "led_count": 9, "animations": { diff --git a/keyboards/switchplate/southpaw_65/southpaw_65.c b/keyboards/switchplate/southpaw_65/southpaw_65.c deleted file mode 100644 index dfe3665928b..00000000000 --- a/keyboards/switchplate/southpaw_65/southpaw_65.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright 2019 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "quantum.h" - -void keyboard_pre_init_kb(void) { - gpio_set_pin_output(B6); - - keyboard_pre_init_user(); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(B6, !led_state.caps_lock); - } - return res; -} diff --git a/keyboards/switchplate/southpaw_fullsize/keyboard.json b/keyboards/switchplate/southpaw_fullsize/keyboard.json index ad897821c35..84942ccfa46 100644 --- a/keyboards/switchplate/southpaw_fullsize/keyboard.json +++ b/keyboards/switchplate/southpaw_fullsize/keyboard.json @@ -31,6 +31,12 @@ "backlight": { "pin": "B7" }, + "indicators": { + "caps_lock": "D4", + "num_lock": "D3", + "scroll_lock": "D5", + "on_state": 0 + }, "processor": "at90usb1286", "bootloader": "atmel-dfu", "layouts": { diff --git a/keyboards/switchplate/southpaw_fullsize/southpaw_fullsize.c b/keyboards/switchplate/southpaw_fullsize/southpaw_fullsize.c deleted file mode 100644 index 3d77e8722e6..00000000000 --- a/keyboards/switchplate/southpaw_fullsize/southpaw_fullsize.c +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright 2020 Ryota Goto - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -// Optional override functions below. -// You can leave any or all of these undefined. -// These are only required if you want to perform custom actions. - -#define INDICATOR_NUM D3 -#define INDICATOR_CAPS D4 -#define INDICATOR_SCR D5 - - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - // D3 Numlock, D4 Capslock, D5 Scrlock - gpio_set_pin_output(INDICATOR_NUM); - gpio_set_pin_output(INDICATOR_CAPS); - gpio_set_pin_output(INDICATOR_SCR); - - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - bool res = led_update_user(led_state); - if (res) - { - gpio_write_pin(INDICATOR_NUM, !led_state.num_lock); - gpio_write_pin(INDICATOR_CAPS, !led_state.caps_lock); - gpio_write_pin(INDICATOR_SCR, !led_state.scroll_lock); - } - return res; -} - diff --git a/keyboards/westfoxtrot/cypher/rev1/keyboard.json b/keyboards/westfoxtrot/cypher/rev1/keyboard.json index 09294d169c2..30dcc625de0 100644 --- a/keyboards/westfoxtrot/cypher/rev1/keyboard.json +++ b/keyboards/westfoxtrot/cypher/rev1/keyboard.json @@ -31,6 +31,11 @@ "levels": 5, "breathing": true }, + "indicators": { + "caps_lock": "F1", + "num_lock": "F4", + "scroll_lock": "F5" + }, "processor": "atmega32u4", "bootloader": "atmel-dfu", "layouts": { diff --git a/keyboards/westfoxtrot/cypher/rev1/rev1.c b/keyboards/westfoxtrot/cypher/rev1/rev1.c deleted file mode 100644 index eeaa7b4a4cf..00000000000 --- a/keyboards/westfoxtrot/cypher/rev1/rev1.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright 2019 westfoxtrot - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "quantum.h" - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - // gpio_write_pin sets the pin high for 1 and low for 0. - // In this example the pins are inverted, setting - // it low/0 turns it on, and high/1 turns the LED off. - // This behavior depends on whether the LED is between the pin - // and VCC or the pin and GND. - gpio_write_pin(F4, led_state.num_lock); - gpio_write_pin(F1, led_state.caps_lock); - gpio_write_pin(F5, led_state.scroll_lock); - } - return res; -} diff --git a/keyboards/westfoxtrot/cypher/rev5/keyboard.json b/keyboards/westfoxtrot/cypher/rev5/keyboard.json index fbb487534d5..278ff94b06e 100644 --- a/keyboards/westfoxtrot/cypher/rev5/keyboard.json +++ b/keyboards/westfoxtrot/cypher/rev5/keyboard.json @@ -33,6 +33,11 @@ "levels": 5, "breathing": true }, + "indicators": { + "caps_lock": "D5", + "num_lock": "D3", + "scroll_lock": "D2" + }, "rgblight": { "hue_steps": 12, "saturation_steps": 25, diff --git a/keyboards/westfoxtrot/cypher/rev5/rev5.c b/keyboards/westfoxtrot/cypher/rev5/rev5.c deleted file mode 100644 index 37ca9cf3c16..00000000000 --- a/keyboards/westfoxtrot/cypher/rev5/rev5.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright 2019 westfoxtrot - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "quantum.h" - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - // gpio_write_pin sets the pin high for 1 and low for 0. - // In this example the pins are inverted, setting - // it low/0 turns it on, and high/1 turns the LED off. - // This behavior depends on whether the LED is between the pin - // and VCC or the pin and GND. - gpio_write_pin(D3, led_state.num_lock); - gpio_write_pin(D5, led_state.caps_lock); - gpio_write_pin(D2, led_state.scroll_lock); - } - return res; -} diff --git a/keyboards/westfoxtrot/prophet/keyboard.json b/keyboards/westfoxtrot/prophet/keyboard.json index 049f5cd7fc5..f82c6da14dd 100644 --- a/keyboards/westfoxtrot/prophet/keyboard.json +++ b/keyboards/westfoxtrot/prophet/keyboard.json @@ -17,6 +17,9 @@ "nkro": true, "sleep_led": true }, + "indicators": { + "caps_lock": "B13" + }, "qmk": { "locking": { "enabled": true, diff --git a/keyboards/westfoxtrot/prophet/prophet.c b/keyboards/westfoxtrot/prophet/prophet.c index 3ef0a3f9288..b33ecf90b41 100644 --- a/keyboards/westfoxtrot/prophet/prophet.c +++ b/keyboards/westfoxtrot/prophet/prophet.c @@ -1,16 +1,9 @@ #include "quantum.h" -void keyboard_pre_init_kb (void) { +void keyboard_pre_init_kb(void) { gpio_set_pin_output(B12); - gpio_set_pin_output(B13); -} -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(B13, led_state.caps_lock); - } - return res; + keyboard_pre_init_user(); } __attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) { From cb39df273de782be1145dc5184bfd47d823531d5 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sat, 22 Jun 2024 09:10:58 +0100 Subject: [PATCH 018/204] Remove deprecated `led_set_user` (#23979) --- docs/features/led_indicators.md | 7 +------ keyboards/converter/usb_usb/custom_matrix.cpp | 1 - keyboards/sirius/unigo66/custom_matrix.cpp | 1 - quantum/led.c | 11 +++-------- quantum/led.h | 3 --- 5 files changed, 4 insertions(+), 19 deletions(-) diff --git a/docs/features/led_indicators.md b/docs/features/led_indicators.md index 8435c69a552..211fda25815 100644 --- a/docs/features/led_indicators.md +++ b/docs/features/led_indicators.md @@ -21,9 +21,8 @@ There are three ways to get the lock LED state: The `host_keyboard_led_state()` may reflect an updated state before `led_update_user()` is called. ::: -Two deprecated functions that provide the LED state as `uint8_t`: +Deprecated functions that provide the LED state as `uint8_t`: -* `uint8_t led_set_user(uint8_t usb_led)` * `uint8_t host_keyboard_leds()` ## Configuration Options @@ -50,10 +49,6 @@ When the configuration options do not provide enough flexibility, the following Both receives LED state as a struct parameter. Returning `true` in `led_update_user()` will allow the keyboard level code in `led_update_kb()` to run as well. Returning `false` will override the keyboard level code, depending on how the keyboard level function is set up. -::: tip -This boolean return type of `led_update_user` allows for overriding keyboard LED controls, and is thus recommended over the void `led_set_user` function. -::: - ### Example of keyboard LED update implementation This is a template indicator function that can be implemented on keyboard level code: diff --git a/keyboards/converter/usb_usb/custom_matrix.cpp b/keyboards/converter/usb_usb/custom_matrix.cpp index ca0855a82b9..e1ef6955707 100644 --- a/keyboards/converter/usb_usb/custom_matrix.cpp +++ b/keyboards/converter/usb_usb/custom_matrix.cpp @@ -229,7 +229,6 @@ extern "C" { if (kbd2.isReady()) kbd2.SetReport(0, 0, 2, 0, 1, &usb_led); if (kbd3.isReady()) kbd3.SetReport(0, 0, 2, 0, 1, &usb_led); if (kbd4.isReady()) kbd4.SetReport(0, 0, 2, 0, 1, &usb_led); - led_set_user(usb_led); led_update_kb((led_t){.raw = usb_led}); } } diff --git a/keyboards/sirius/unigo66/custom_matrix.cpp b/keyboards/sirius/unigo66/custom_matrix.cpp index 25648a5f78e..879a0e7c153 100644 --- a/keyboards/sirius/unigo66/custom_matrix.cpp +++ b/keyboards/sirius/unigo66/custom_matrix.cpp @@ -216,7 +216,6 @@ extern "C" kbd2.SetReport(0, 0, 2, 0, 1, &usb_led); kbd3.SetReport(0, 0, 2, 0, 1, &usb_led); kbd4.SetReport(0, 0, 2, 0, 1, &usb_led); - led_set_user(usb_led); led_update_kb((led_t){.raw = usb_led}); } diff --git a/quantum/led.c b/quantum/led.c index e2b59851099..aec3edc8235 100644 --- a/quantum/led.c +++ b/quantum/led.c @@ -56,19 +56,15 @@ static void handle_backlight_caps_lock(led_t led_state) { #endif static uint32_t last_led_modification_time = 0; -uint32_t last_led_activity_time(void) { + +uint32_t last_led_activity_time(void) { return last_led_modification_time; } + uint32_t last_led_activity_elapsed(void) { return timer_elapsed32(last_led_modification_time); } -/** \brief Lock LED set callback - keymap/user level - * - * \deprecated Use led_update_user() instead. - */ -__attribute__((weak)) void led_set_user(uint8_t usb_led) {} - /** \brief Lock LED update callback - keymap/user level * * \return True if led_update_kb() should run its own code, false otherwise. @@ -146,7 +142,6 @@ __attribute__((weak)) void led_set(uint8_t usb_led) { handle_backlight_caps_lock((led_t)usb_led); #endif - led_set_user(usb_led); led_update_kb((led_t)usb_led); } diff --git a/quantum/led.h b/quantum/led.h index b9fad670aeb..669e93e1944 100644 --- a/quantum/led.h +++ b/quantum/led.h @@ -48,9 +48,6 @@ void led_wakeup(void); void led_task(void); -/* Deprecated callbacks */ -void led_set_user(uint8_t usb_led); - /* Callbacks */ bool led_update_user(led_t led_state); bool led_update_kb(led_t led_state); From 17498fa48a8c5c0ac439e59d0db12a41954d4fb0 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sat, 22 Jun 2024 12:14:07 +0100 Subject: [PATCH 019/204] Migrate `led_update_kb` implementations to DD (#23981) --- keyboards/ai03/vega/keyboard.json | 5 +++ keyboards/ai03/vega/vega.c | 37 ---------------- keyboards/bioi/g60/g60.c | 28 ------------ keyboards/bioi/g60/keyboard.json | 4 ++ keyboards/bioi/morgan65/keyboard.json | 4 ++ keyboards/bioi/morgan65/morgan65.c | 28 ------------ keyboards/bioi/s65/keyboard.json | 4 ++ keyboards/bioi/s65/s65.c | 27 ------------ keyboards/clueboard/2x1800/2019/2019.c | 14 ------ keyboards/clueboard/2x1800/2019/keyboard.json | 6 +++ keyboards/duck/orion/v3/keyboard.json | 6 +++ keyboards/duck/orion/v3/matrix.c | 13 ------ keyboards/duck/orion/v3/v3.c | 39 ----------------- keyboards/ealdin/quadrant/keyboard.json | 3 ++ keyboards/ealdin/quadrant/quadrant.c | 13 ------ .../jtallbean/split_65/keyboard.json | 3 ++ .../handwired/jtallbean/split_65/split_65.c | 43 ------------------- .../handwired/prime_exl_plus/keyboard.json | 4 ++ .../handwired/prime_exl_plus/prime_exl_plus.c | 19 +------- .../ibm/model_m/ashpil_usbc/ashpil_usbc.c | 36 ---------------- .../ibm/model_m/ashpil_usbc/keyboard.json | 6 +++ keyboards/ibm/model_m/teensypp/keyboard.json | 6 +++ keyboards/ibm/model_m/teensypp/teensypp.c | 36 ---------------- keyboards/ibm/model_m/yugo_m/keyboard.json | 6 +++ keyboards/ibm/model_m/yugo_m/yugo_m.c | 35 --------------- keyboards/jels/jels88/jels88.c | 38 ---------------- keyboards/jels/jels88/keyboard.json | 4 ++ .../kbdfans/bella/soldered/keyboard.json | 4 ++ keyboards/kbdfans/bella/soldered/soldered.c | 28 ------------ keyboards/kbdfans/maja_soldered/keyboard.json | 4 ++ .../kbdfans/maja_soldered/maja_soldered.c | 29 ------------- keyboards/kopibeng/mnk88/mnk88.c | 36 ---------------- keyboards/kopibeng/xt8x/xt8x.c | 15 ------- keyboards/mc_76k/keyboard.json | 4 ++ keyboards/mc_76k/mc_76k.c | 34 --------------- keyboards/viktus/sp111/keyboard.json | 5 +++ keyboards/viktus/sp111/sp111.c | 18 -------- keyboards/wilba_tech/wt69_a/keyboard.json | 3 ++ keyboards/wilba_tech/wt69_a/wt69_a.c | 30 ------------- keyboards/wilba_tech/wt70_jb/keyboard.json | 3 ++ keyboards/wilba_tech/wt70_jb/wt70_jb.c | 13 ------ keyboards/wuque/ikki68/ikki68.c | 30 ------------- keyboards/wuque/ikki68/keyboard.json | 4 ++ keyboards/ymdk/yd60mq/info.json | 4 ++ keyboards/ymdk/yd60mq/yd60mq.c | 21 --------- 45 files changed, 94 insertions(+), 658 deletions(-) delete mode 100644 keyboards/ai03/vega/vega.c delete mode 100644 keyboards/bioi/g60/g60.c delete mode 100644 keyboards/bioi/morgan65/morgan65.c delete mode 100644 keyboards/bioi/s65/s65.c delete mode 100644 keyboards/duck/orion/v3/v3.c delete mode 100644 keyboards/handwired/jtallbean/split_65/split_65.c delete mode 100644 keyboards/ibm/model_m/ashpil_usbc/ashpil_usbc.c delete mode 100644 keyboards/ibm/model_m/teensypp/teensypp.c delete mode 100644 keyboards/ibm/model_m/yugo_m/yugo_m.c delete mode 100644 keyboards/jels/jels88/jels88.c delete mode 100755 keyboards/kbdfans/bella/soldered/soldered.c delete mode 100755 keyboards/kbdfans/maja_soldered/maja_soldered.c delete mode 100644 keyboards/kopibeng/mnk88/mnk88.c delete mode 100644 keyboards/mc_76k/mc_76k.c delete mode 100644 keyboards/wilba_tech/wt69_a/wt69_a.c delete mode 100644 keyboards/wuque/ikki68/ikki68.c delete mode 100644 keyboards/ymdk/yd60mq/yd60mq.c diff --git a/keyboards/ai03/vega/keyboard.json b/keyboards/ai03/vega/keyboard.json index a58fa4fcaef..bc220cc7a12 100644 --- a/keyboards/ai03/vega/keyboard.json +++ b/keyboards/ai03/vega/keyboard.json @@ -22,6 +22,11 @@ "resync": true } }, + "indicators": { + "caps_lock": "B7", + "scroll_lock": "A5", + "on_state": 0 + }, "matrix_pins": { "cols": ["B5", "A3", "A9", "A8", "B15", "B14", "B13", "B12", "B11", "B10", "B2", "B1", "B0", "A7", "A6"], "rows": ["A1", "A2", "B3", "A15", "A10"] diff --git a/keyboards/ai03/vega/vega.c b/keyboards/ai03/vega/vega.c deleted file mode 100644 index 44ded2c85c4..00000000000 --- a/keyboards/ai03/vega/vega.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright 2020 ai03 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -void matrix_init_kb(void) { - // Initialize indicator LEDs to output - - gpio_set_pin_output(B7); // Caps - gpio_set_pin_output(A5); // Slck - - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) { - - bool res = led_update_user(led_state); - - if(res) { - gpio_write_pin(B7, !led_state.caps_lock); - gpio_write_pin(A5, !led_state.scroll_lock); - } - return res; -} \ No newline at end of file diff --git a/keyboards/bioi/g60/g60.c b/keyboards/bioi/g60/g60.c deleted file mode 100644 index 3fdfef8897a..00000000000 --- a/keyboards/bioi/g60/g60.c +++ /dev/null @@ -1,28 +0,0 @@ -/* -Copyright 2019 Basic I/O Instruments(Scott Wei) -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "quantum.h" - -void keyboard_pre_init_kb(void) { - gpio_set_pin_output(F0); - gpio_write_pin_high(F0); - keyboard_pre_init_user(); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - gpio_write_pin(F0, !led_state.caps_lock); - } - return true; -} diff --git a/keyboards/bioi/g60/keyboard.json b/keyboards/bioi/g60/keyboard.json index 8d3dd587707..b98aee8273f 100644 --- a/keyboards/bioi/g60/keyboard.json +++ b/keyboards/bioi/g60/keyboard.json @@ -35,6 +35,10 @@ "pin": "B7", "levels": 12 }, + "indicators": { + "caps_lock": "F0", + "on_state": 0 + }, "rgblight": { "saturation_steps": 8, "brightness_steps": 8, diff --git a/keyboards/bioi/morgan65/keyboard.json b/keyboards/bioi/morgan65/keyboard.json index 8f83237f82f..5606233f2ad 100644 --- a/keyboards/bioi/morgan65/keyboard.json +++ b/keyboards/bioi/morgan65/keyboard.json @@ -35,6 +35,10 @@ "pin": "B6", "levels": 12 }, + "indicators": { + "caps_lock": "F0", + "on_state": 0 + }, "rgblight": { "saturation_steps": 8, "brightness_steps": 8, diff --git a/keyboards/bioi/morgan65/morgan65.c b/keyboards/bioi/morgan65/morgan65.c deleted file mode 100644 index 3fdfef8897a..00000000000 --- a/keyboards/bioi/morgan65/morgan65.c +++ /dev/null @@ -1,28 +0,0 @@ -/* -Copyright 2019 Basic I/O Instruments(Scott Wei) -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "quantum.h" - -void keyboard_pre_init_kb(void) { - gpio_set_pin_output(F0); - gpio_write_pin_high(F0); - keyboard_pre_init_user(); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - gpio_write_pin(F0, !led_state.caps_lock); - } - return true; -} diff --git a/keyboards/bioi/s65/keyboard.json b/keyboards/bioi/s65/keyboard.json index c55852f31cc..56d53b54cf5 100644 --- a/keyboards/bioi/s65/keyboard.json +++ b/keyboards/bioi/s65/keyboard.json @@ -35,6 +35,10 @@ "pin": "B6", "levels": 12 }, + "indicators": { + "caps_lock": "F0", + "on_state": 0 + }, "rgblight": { "saturation_steps": 8, "brightness_steps": 8, diff --git a/keyboards/bioi/s65/s65.c b/keyboards/bioi/s65/s65.c deleted file mode 100644 index e632f31eeb6..00000000000 --- a/keyboards/bioi/s65/s65.c +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright 2019 Basic I/O Instruments(Scott Wei) -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "quantum.h" -void keyboard_pre_init_kb(void) { - gpio_set_pin_output(F0); - gpio_write_pin_high(F0); - keyboard_pre_init_user(); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - gpio_write_pin(F0, !led_state.caps_lock); - } - return true; -} diff --git a/keyboards/clueboard/2x1800/2019/2019.c b/keyboards/clueboard/2x1800/2019/2019.c index 8b0ba6a71e1..3fe170af998 100644 --- a/keyboards/clueboard/2x1800/2019/2019.c +++ b/keyboards/clueboard/2x1800/2019/2019.c @@ -18,9 +18,6 @@ void matrix_init_kb(void) { // Set our LED pins as output gpio_set_pin_output(D6); - gpio_set_pin_output(B4); - gpio_set_pin_output(B5); - gpio_set_pin_output(B6); // Set our Tilt Sensor pins as input gpio_set_pin_input_high(SHAKE_PIN_A); @@ -133,17 +130,6 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { return process_record_user(keycode, record); } -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(B4, !led_state.num_lock); - gpio_write_pin(B5, !led_state.caps_lock); - gpio_write_pin(B6, !led_state.scroll_lock); - } - - return res; -} - __attribute__((weak)) bool encoder_update_keymap(uint8_t index, bool clockwise) { return true; } __attribute__((weak)) bool encoder_update_user(uint8_t index, bool clockwise) { return encoder_update_keymap(index, clockwise); } diff --git a/keyboards/clueboard/2x1800/2019/keyboard.json b/keyboards/clueboard/2x1800/2019/keyboard.json index 6f33a11ca75..31ff448d17e 100644 --- a/keyboards/clueboard/2x1800/2019/keyboard.json +++ b/keyboards/clueboard/2x1800/2019/keyboard.json @@ -32,6 +32,12 @@ {"pin_a": "A1", "pin_b": "A0"} ] }, + "indicators": { + "caps_lock": "B5", + "num_lock": "B4", + "scroll_lock": "B6", + "on_state": 0 + }, "layout_aliases": { "LAYOUT": "LAYOUT_all" }, diff --git a/keyboards/duck/orion/v3/keyboard.json b/keyboards/duck/orion/v3/keyboard.json index 280cd8b07f8..ba479aa0a29 100644 --- a/keyboards/duck/orion/v3/keyboard.json +++ b/keyboards/duck/orion/v3/keyboard.json @@ -16,6 +16,12 @@ "bootmagic": { "matrix": [4, 10] }, + "indicators": { + "caps_lock": "B0", + "num_lock": "B4", + "scroll_lock": "D7", + "on_state": 0 + }, "rgblight": { "led_count": 18, "animations": { diff --git a/keyboards/duck/orion/v3/matrix.c b/keyboards/duck/orion/v3/matrix.c index 1dd07a65670..acd4fe0349a 100644 --- a/keyboards/duck/orion/v3/matrix.c +++ b/keyboards/duck/orion/v3/matrix.c @@ -53,20 +53,7 @@ __attribute__ ((weak)) void matrix_scan_user(void) { } -void indicator_init_ports(void) { - - // Num LED - gpio_set_pin_output(B4); - - // Caps Lock - gpio_set_pin_output(B0); - - // Scroll Lock - gpio_set_pin_output(D7); -} - void matrix_init(void) { - indicator_init_ports(); unselect_cols(); init_rows(); diff --git a/keyboards/duck/orion/v3/v3.c b/keyboards/duck/orion/v3/v3.c deleted file mode 100644 index c0ca9ddd06a..00000000000 --- a/keyboards/duck/orion/v3/v3.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright 2019 MechMerlin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "quantum.h" -#include "indicator_leds.h" - -// Alphas PB1 -// Navigation Cluster: PB2 -// Number Row, Mods: PB3 -// Function Row: PE6 - -// Other than using RGB or LED matrix, QMK cannot turn on specific zones -// of backlight LEDs. Unfortunately, Duck PCBs do not follow this design -// and instead use multiple pins connected to each of these zones. QMK is -// only able to control them ALL with the current default mechanisms. - -// Locking indicator LEDs -// The Duck Orion V3 has 3 locking indicator LEDs and are located to the right -// of the Escape key. -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - gpio_write_pin(B0, !led_state.caps_lock); - gpio_write_pin(B4, !led_state.num_lock); - gpio_write_pin(D7, !led_state.scroll_lock); - } - return true; -} diff --git a/keyboards/ealdin/quadrant/keyboard.json b/keyboards/ealdin/quadrant/keyboard.json index 9f7a6143d2f..7a8bcf0db23 100644 --- a/keyboards/ealdin/quadrant/keyboard.json +++ b/keyboards/ealdin/quadrant/keyboard.json @@ -34,6 +34,9 @@ {"pin_a": "D5", "pin_b": "F1"} ] }, + "indicators": { + "caps_lock": "F0" + }, "rgblight": { "saturation_steps": 8, "brightness_steps": 8, diff --git a/keyboards/ealdin/quadrant/quadrant.c b/keyboards/ealdin/quadrant/quadrant.c index 23be00b96f0..328c92e02e3 100644 --- a/keyboards/ealdin/quadrant/quadrant.c +++ b/keyboards/ealdin/quadrant/quadrant.c @@ -52,16 +52,3 @@ bool encoder_update_kb(uint8_t index, bool clockwise) { } return true; } - -void keyboard_pre_init_kb(void) { - gpio_set_pin_output(F0); - - keyboard_pre_init_user(); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - gpio_write_pin(F0, led_state.caps_lock); - } - return true; -} diff --git a/keyboards/handwired/jtallbean/split_65/keyboard.json b/keyboards/handwired/jtallbean/split_65/keyboard.json index c8be82da8d4..b6560fb03a1 100644 --- a/keyboards/handwired/jtallbean/split_65/keyboard.json +++ b/keyboards/handwired/jtallbean/split_65/keyboard.json @@ -27,6 +27,9 @@ "rows": ["F4", "F1", "F0", "C7", "B6"] }, "diode_direction": "COL2ROW", + "indicators": { + "caps_lock": "B0" + }, "split": { "enabled": true, "soft_serial_pin": "D0", diff --git a/keyboards/handwired/jtallbean/split_65/split_65.c b/keyboards/handwired/jtallbean/split_65/split_65.c deleted file mode 100644 index b75b12137f9..00000000000 --- a/keyboards/handwired/jtallbean/split_65/split_65.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright 2020 jtallbean - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -// Optional override functions below. -// You can leave any or all of these undefined. -// These are only required if you want to perform custom actions. - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - // Set our LED pins as output - gpio_set_pin_output(B0); - gpio_write_pin_low(B0); - - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - bool res = led_update_user(led_state); - if(res) { - // gpio_write_pin sets the pin high for 1 and low for 0. - gpio_write_pin(B0, led_state.caps_lock); - } - return res; -} diff --git a/keyboards/handwired/prime_exl_plus/keyboard.json b/keyboards/handwired/prime_exl_plus/keyboard.json index 43825a0ad88..a234bceb02a 100644 --- a/keyboards/handwired/prime_exl_plus/keyboard.json +++ b/keyboards/handwired/prime_exl_plus/keyboard.json @@ -8,6 +8,10 @@ "pid": "0x6579", "device_version": "0.0.1" }, + "indicators": { + "caps_lock": "B0", + "num_lock": "B1" + }, "rgblight": { "led_count": 10, "animations": { diff --git a/keyboards/handwired/prime_exl_plus/prime_exl_plus.c b/keyboards/handwired/prime_exl_plus/prime_exl_plus.c index 1865b6c5025..164c954b8bd 100644 --- a/keyboards/handwired/prime_exl_plus/prime_exl_plus.c +++ b/keyboards/handwired/prime_exl_plus/prime_exl_plus.c @@ -16,32 +16,17 @@ #include "quantum.h" void matrix_init_kb(void) { - // set CapsLock LED to output and low - gpio_set_pin_output(B0); - gpio_write_pin_low(B0); - // set NumLock LED to output and low - gpio_set_pin_output(B1); - gpio_write_pin_low(B1); - // set ScrollLock LED to output and low gpio_set_pin_output(B2); gpio_write_pin_low(B2); -} -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(B1, led_state.num_lock); - gpio_write_pin(B0, led_state.caps_lock); - //gpio_write_pin(B2, led_state.scroll_lock); - } - return res; + matrix_init_user(); } //function for layer indicator LED layer_state_t layer_state_set_kb(layer_state_t state) { if (get_highest_layer(state) == 1) { - gpio_write_pin_high(B2); + gpio_write_pin_high(B2); } else { gpio_write_pin_low(B2); } diff --git a/keyboards/ibm/model_m/ashpil_usbc/ashpil_usbc.c b/keyboards/ibm/model_m/ashpil_usbc/ashpil_usbc.c deleted file mode 100644 index 8bdcfe070ae..00000000000 --- a/keyboards/ibm/model_m/ashpil_usbc/ashpil_usbc.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright 2019 ashpil - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -void keyboard_pre_init_kb(void) { - /* Setting status LEDs pins to output and +5V (off) */ - gpio_set_pin_output(D5); - gpio_set_pin_output(D6); - gpio_set_pin_output(D7); - gpio_write_pin_high(D5); - gpio_write_pin_high(D6); - gpio_write_pin_high(D7); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - gpio_write_pin(D5, !led_state.num_lock); - gpio_write_pin(D6, !led_state.caps_lock); - gpio_write_pin(D7, !led_state.scroll_lock); - } - return true; -} diff --git a/keyboards/ibm/model_m/ashpil_usbc/keyboard.json b/keyboards/ibm/model_m/ashpil_usbc/keyboard.json index 451589017e4..a43e16a04c3 100644 --- a/keyboards/ibm/model_m/ashpil_usbc/keyboard.json +++ b/keyboards/ibm/model_m/ashpil_usbc/keyboard.json @@ -16,6 +16,12 @@ "mousekey": false, "nkro": false }, + "indicators": { + "caps_lock": "D6", + "num_lock": "D5", + "scroll_lock": "D7", + "on_state": 0 + }, "matrix_pins": { "cols": ["E6", "E7", "F0", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "A0", "A1", "A2", "A3", "A4", "A5"], "rows": ["C7", "C6", "C5", "C4", "C3", "C2", "C1", "C0"] diff --git a/keyboards/ibm/model_m/teensypp/keyboard.json b/keyboards/ibm/model_m/teensypp/keyboard.json index 4464a299f6d..e77c43483b0 100644 --- a/keyboards/ibm/model_m/teensypp/keyboard.json +++ b/keyboards/ibm/model_m/teensypp/keyboard.json @@ -8,6 +8,12 @@ "pid": "0x0000", "device_version": "0.0.1" }, + "indicators": { + "caps_lock": "B6", + "num_lock": "B4", + "scroll_lock": "B5", + "on_state": 0 + }, "matrix_pins": { "cols": ["C7", "C6", "C5", "C4", "C3", "C2", "C1", "C0", "E1", "E0", "D7", "D6", "D5", "D4", "D3", "D2"], "rows": ["F7", "F6", "F5", "F4", "F3", "F2", "F1", "F0"] diff --git a/keyboards/ibm/model_m/teensypp/teensypp.c b/keyboards/ibm/model_m/teensypp/teensypp.c deleted file mode 100644 index aac85424bf7..00000000000 --- a/keyboards/ibm/model_m/teensypp/teensypp.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright 2019 iw0rm3r - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "quantum.h" - -void led_init_ports(void) { - /* Setting status LEDs pins to output and +5V (off) */ - gpio_set_pin_output(B4); - gpio_set_pin_output(B5); - gpio_set_pin_output(B6); - gpio_write_pin_high(B4); - gpio_write_pin_high(B5); - gpio_write_pin_high(B6); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(B4, !led_state.num_lock); - gpio_write_pin(B6, !led_state.caps_lock); - gpio_write_pin(B5, !led_state.scroll_lock); - } - return res; -} diff --git a/keyboards/ibm/model_m/yugo_m/keyboard.json b/keyboards/ibm/model_m/yugo_m/keyboard.json index 968c637b783..10fe637f03a 100644 --- a/keyboards/ibm/model_m/yugo_m/keyboard.json +++ b/keyboards/ibm/model_m/yugo_m/keyboard.json @@ -16,6 +16,12 @@ "mousekey": true, "nkro": false }, + "indicators": { + "caps_lock": "A1", + "num_lock": "A2", + "scroll_lock": "A0", + "on_state": 0 + }, "matrix_pins": { "cols": ["A9", "A8", "B15", "B14", "B13", "B12", "B11", "B10", "B2", "B1", "B0", "A7", "A6", "A5", "A4", "A3"], "rows": ["B8", "B7", "B6", "B5", "B4", "B3", "A15", "A14"] diff --git a/keyboards/ibm/model_m/yugo_m/yugo_m.c b/keyboards/ibm/model_m/yugo_m/yugo_m.c deleted file mode 100644 index a725a3657bc..00000000000 --- a/keyboards/ibm/model_m/yugo_m/yugo_m.c +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright 2020 Nidzo Tomic - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "quantum.h" - -void keyboard_pre_init_kb(void) { - // Set our LED pins as output - gpio_set_pin_output(A2); - gpio_set_pin_output(A1); - gpio_set_pin_output(A0); - - keyboard_pre_init_user(); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(A2, !led_state.num_lock); - gpio_write_pin(A1, !led_state.caps_lock); - gpio_write_pin(A0, !led_state.scroll_lock); - } - return res; -} diff --git a/keyboards/jels/jels88/jels88.c b/keyboards/jels/jels88/jels88.c deleted file mode 100644 index ceb187ab176..00000000000 --- a/keyboards/jels/jels88/jels88.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright 2021 Joah Nelson (Jels) - * - * 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 . - */ - -// not much here ... just indicator LEDs - -#include "quantum.h" - -// LED indicator pins -#define CAPS_LED D5 -#define SCROLL_LED D4 - -void keyboard_pre_init_kb(void) { - gpio_set_pin_output(CAPS_LED); - gpio_set_pin_output(SCROLL_LED); - keyboard_pre_init_user(); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if (res) { - gpio_write_pin(CAPS_LED, led_state.caps_lock); - gpio_write_pin(SCROLL_LED, led_state.scroll_lock); - } - return res; -} diff --git a/keyboards/jels/jels88/keyboard.json b/keyboards/jels/jels88/keyboard.json index ee9b64ed6ae..e4d2c6e2737 100644 --- a/keyboards/jels/jels88/keyboard.json +++ b/keyboards/jels/jels88/keyboard.json @@ -23,6 +23,10 @@ "resync": true } }, + "indicators": { + "caps_lock": "D5", + "scroll_lock": "D4" + }, "matrix_pins": { "cols": ["C7", "C6", "F7", "F6", "F5", "F4", "B1", "D2", "D3"], "rows": ["B3", "B2", "D1", "D0", "E6", "B0", "F0", "F1", "B5", "B4", "D7", "D6"] diff --git a/keyboards/kbdfans/bella/soldered/keyboard.json b/keyboards/kbdfans/bella/soldered/keyboard.json index 31d8e9ffb7a..aa5d9159800 100644 --- a/keyboards/kbdfans/bella/soldered/keyboard.json +++ b/keyboards/kbdfans/bella/soldered/keyboard.json @@ -31,6 +31,10 @@ "backlight": { "pin": "B7" }, + "indicators": { + "caps_lock": "E6", + "on_state": 0 + }, "processor": "atmega32u4", "bootloader": "atmel-dfu", "layouts": { diff --git a/keyboards/kbdfans/bella/soldered/soldered.c b/keyboards/kbdfans/bella/soldered/soldered.c deleted file mode 100755 index bfe9f8f5d44..00000000000 --- a/keyboards/kbdfans/bella/soldered/soldered.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright 2020 dztech - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "quantum.h" -void matrix_init_kb(void) { - gpio_set_pin_output(E6); - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(E6, !led_state.caps_lock); - } - return res; -} diff --git a/keyboards/kbdfans/maja_soldered/keyboard.json b/keyboards/kbdfans/maja_soldered/keyboard.json index bf73f04d8a4..f182ef97d13 100644 --- a/keyboards/kbdfans/maja_soldered/keyboard.json +++ b/keyboards/kbdfans/maja_soldered/keyboard.json @@ -31,6 +31,10 @@ "backlight": { "pin": "B5" }, + "indicators": { + "caps_lock": "D4", + "on_state": 0 + }, "processor": "atmega32u4", "bootloader": "atmel-dfu", "debounce": 3, diff --git a/keyboards/kbdfans/maja_soldered/maja_soldered.c b/keyboards/kbdfans/maja_soldered/maja_soldered.c deleted file mode 100755 index 41d80e2cc8c..00000000000 --- a/keyboards/kbdfans/maja_soldered/maja_soldered.c +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright 2020 dztech kbdfans - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "quantum.h" - -void matrix_init_kb(void) { - gpio_set_pin_output(D4); - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(D4, !led_state.caps_lock); - } - return res; -} diff --git a/keyboards/kopibeng/mnk88/mnk88.c b/keyboards/kopibeng/mnk88/mnk88.c deleted file mode 100644 index efe32f8bfd5..00000000000 --- a/keyboards/kopibeng/mnk88/mnk88.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright 2021 Samuel Lu - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -void matrix_init_kb(void) { - - gpio_set_pin_output(LED_CAPS_LOCK_PIN); - gpio_set_pin_output(LED_SCROLL_LOCK_PIN); - - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) { - - bool res = led_update_user(led_state); - - if(res) { - gpio_write_pin(LED_CAPS_LOCK_PIN, led_state.caps_lock); - gpio_write_pin(LED_SCROLL_LOCK_PIN, led_state.scroll_lock); - } - return res; -} diff --git a/keyboards/kopibeng/xt8x/xt8x.c b/keyboards/kopibeng/xt8x/xt8x.c index 2c4f246b6a2..03342c40af3 100644 --- a/keyboards/kopibeng/xt8x/xt8x.c +++ b/keyboards/kopibeng/xt8x/xt8x.c @@ -17,26 +17,11 @@ #include "quantum.h" void matrix_init_kb(void) { - // Initialize indicator LEDs to output - - gpio_set_pin_output(LED_CAPS_LOCK_PIN); // Caps - gpio_set_pin_output(LED_SCROLL_LOCK_PIN); // Scroll lock gpio_set_pin_output(INDICATOR_PIN_0); // Layer indicator on F13 matrix_init_user(); } -bool led_update_kb(led_t led_state) { - - bool res = led_update_user(led_state); - - if(res) { - gpio_write_pin(LED_CAPS_LOCK_PIN, led_state.caps_lock); - gpio_write_pin(LED_SCROLL_LOCK_PIN, led_state.scroll_lock); - } - return res; -} - __attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) { gpio_write_pin(INDICATOR_PIN_0, layer_state_cmp(state, 1)); return state; diff --git a/keyboards/mc_76k/keyboard.json b/keyboards/mc_76k/keyboard.json index 049483bed99..18aef48d01c 100644 --- a/keyboards/mc_76k/keyboard.json +++ b/keyboards/mc_76k/keyboard.json @@ -22,6 +22,10 @@ "resync": true } }, + "indicators": { + "caps_lock": "D2", + "on_state": 0 + }, "matrix_pins": { "cols": ["D5", "D3", "D4", "B1", "D6", "D7", "B4", "B5", "F7", "F6", "F5", "F4", "F1", "F0"], "rows": ["C7", "C6", "B6", "B0", "D1", "D0"] diff --git a/keyboards/mc_76k/mc_76k.c b/keyboards/mc_76k/mc_76k.c deleted file mode 100644 index 44d2374b1c2..00000000000 --- a/keyboards/mc_76k/mc_76k.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright 2020 Yiancar-Designs - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -void keyboard_pre_init_kb (void) { - gpio_set_pin_output(D2); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - // gpio_write_pin sets the pin high for 1 and low for 0. - // In this example the pins are inverted, setting - // it low/0 turns it on, and high/1 turns the LED off. - // This behavior depends on whether the LED is between the pin - // and VCC or the pin and GND. - gpio_write_pin(D2, !led_state.caps_lock); - } - return res; -} diff --git a/keyboards/viktus/sp111/keyboard.json b/keyboards/viktus/sp111/keyboard.json index 8cf65a5522a..91a70c284be 100644 --- a/keyboards/viktus/sp111/keyboard.json +++ b/keyboards/viktus/sp111/keyboard.json @@ -17,6 +17,11 @@ "mousekey": true, "nkro": true }, + "indicators": { + "caps_lock": "F1", + "num_lock": "F0", + "scroll_lock": "F4" + }, "qmk": { "locking": { "enabled": true, diff --git a/keyboards/viktus/sp111/sp111.c b/keyboards/viktus/sp111/sp111.c index 1626683804f..c2162429c13 100644 --- a/keyboards/viktus/sp111/sp111.c +++ b/keyboards/viktus/sp111/sp111.c @@ -22,21 +22,3 @@ void keyboard_pre_init_kb(void) { keyboard_pre_init_user(); } - -void matrix_init_kb(void) { - gpio_set_pin_output(F0); - gpio_set_pin_output(F1); - gpio_set_pin_output(F4); - - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if (res) { - gpio_write_pin(F0, led_state.num_lock); - gpio_write_pin(F1, led_state.caps_lock); - gpio_write_pin(F4, led_state.scroll_lock); - } - return res; -} diff --git a/keyboards/wilba_tech/wt69_a/keyboard.json b/keyboards/wilba_tech/wt69_a/keyboard.json index bbe65178506..d41f8fc90e0 100644 --- a/keyboards/wilba_tech/wt69_a/keyboard.json +++ b/keyboards/wilba_tech/wt69_a/keyboard.json @@ -20,6 +20,9 @@ "resync": true } }, + "indicators": { + "caps_lock": "F1" + }, "matrix_pins": { "cols": ["B7", "B0", "F5", "D5", "B1", "B2", "B3", "D3", "D2", "C7", "C6", "B6", "B5", "B4", "D7", "D6", "D4"], "rows": ["F0", "E6", "F4", "F6", "F7"] diff --git a/keyboards/wilba_tech/wt69_a/wt69_a.c b/keyboards/wilba_tech/wt69_a/wt69_a.c deleted file mode 100644 index 842b62a4d12..00000000000 --- a/keyboards/wilba_tech/wt69_a/wt69_a.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright 2018 Jason Williams (Wilba) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -void keyboard_pre_init_kb(void) { - gpio_set_pin_output(F1); - - keyboard_pre_init_user(); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - gpio_write_pin(F1, led_state.caps_lock); - } - return true; -} diff --git a/keyboards/wilba_tech/wt70_jb/keyboard.json b/keyboards/wilba_tech/wt70_jb/keyboard.json index bfa27f225be..f9228106009 100644 --- a/keyboards/wilba_tech/wt70_jb/keyboard.json +++ b/keyboards/wilba_tech/wt70_jb/keyboard.json @@ -8,6 +8,9 @@ "pid": "0x001F", "device_version": "0.0.1" }, + "indicators": { + "caps_lock": "F1" + }, "rgblight": { "saturation_steps": 8, "brightness_steps": 8, diff --git a/keyboards/wilba_tech/wt70_jb/wt70_jb.c b/keyboards/wilba_tech/wt70_jb/wt70_jb.c index ae9b5dcbec0..ad480ece227 100644 --- a/keyboards/wilba_tech/wt70_jb/wt70_jb.c +++ b/keyboards/wilba_tech/wt70_jb/wt70_jb.c @@ -17,19 +17,6 @@ bool g_first_execution = false; -void keyboard_pre_init_kb(void) { - gpio_set_pin_output(F1); - - keyboard_pre_init_user(); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - gpio_write_pin(F1, led_state.caps_lock); - } - return true; -} - // This is some magic so that PCBs flashed with VIA firmware at the factory // will start with an RGB test pattern. Not relevant for non-VIA firmware. #ifdef VIA_ENABLE diff --git a/keyboards/wuque/ikki68/ikki68.c b/keyboards/wuque/ikki68/ikki68.c deleted file mode 100644 index 382ec00251b..00000000000 --- a/keyboards/wuque/ikki68/ikki68.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright 2020 wuquestudio - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -void matrix_init_kb(void) { - gpio_set_pin_output(C6); - - matrix_init_user(); -} -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(C6, !led_state.caps_lock); - } - return res; -} diff --git a/keyboards/wuque/ikki68/keyboard.json b/keyboards/wuque/ikki68/keyboard.json index c6070e74fa5..d666b0b5dec 100644 --- a/keyboards/wuque/ikki68/keyboard.json +++ b/keyboards/wuque/ikki68/keyboard.json @@ -8,6 +8,10 @@ "pid": "0x0003", "device_version": "0.0.1" }, + "indicators": { + "caps_lock": "C6", + "on_state": 0 + }, "ws2812": { "pin": "E2" }, diff --git a/keyboards/ymdk/yd60mq/info.json b/keyboards/ymdk/yd60mq/info.json index 4152ed6e077..1af04be687d 100644 --- a/keyboards/ymdk/yd60mq/info.json +++ b/keyboards/ymdk/yd60mq/info.json @@ -32,6 +32,10 @@ "pin": "B7", "levels": 5 }, + "indicators": { + "caps_lock": "F4", + "on_state": 0 + }, "ws2812": { "pin": "E2" }, diff --git a/keyboards/ymdk/yd60mq/yd60mq.c b/keyboards/ymdk/yd60mq/yd60mq.c deleted file mode 100644 index 40c899c46f8..00000000000 --- a/keyboards/ymdk/yd60mq/yd60mq.c +++ /dev/null @@ -1,21 +0,0 @@ -#include "quantum.h" - -__attribute__((weak)) -void matrix_init_kb(void){ - gpio_set_pin_output(F4); - gpio_write_pin_high(F4); -} - -__attribute__((weak)) -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if (res) { - // gpio_write_pin sets the pin high for 1 and low for 0. - // In this example the pins are inverted, setting - // it low/0 turns it on, and high/1 turns the LED off. - // This behavior depends on whether the LED is between the pin - // and VCC or the pin and GND. - gpio_write_pin(F4, !led_state.caps_lock); - } - return res; -} From 7824e7ed9ba3e79103625b6f038033eb3f5c5320 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sat, 22 Jun 2024 12:14:17 +0100 Subject: [PATCH 020/204] Migrate `led_update_kb` implementations to DD (#23983) --- keyboards/acheron/austin/austin.c | 18 --------- keyboards/acheron/austin/keyboard.json | 5 +++ keyboards/cheshire/curiosity/curiosity.c | 17 -------- keyboards/cheshire/curiosity/keyboard.json | 6 +++ keyboards/doppelganger/doppelganger.c | 14 +------ keyboards/doppelganger/keyboard.json | 4 ++ .../exclusive/e85/soldered/keyboard.json | 4 ++ keyboards/exclusive/e85/soldered/soldered.c | 32 --------------- keyboards/ghs/rar/keyboard.json | 4 ++ keyboards/ghs/rar/rar.c | 36 ----------------- .../gray_studio/think65/solder/keyboard.json | 4 ++ keyboards/gray_studio/think65/solder/solder.c | 36 ----------------- keyboards/ilumkb/volcano660/keyboard.json | 6 +++ keyboards/ilumkb/volcano660/volcano660.c | 34 ---------------- keyboards/jae/j01/j01.c | 38 ------------------ keyboards/jae/j01/keyboard.json | 4 ++ keyboards/kkatano/wallaby/keyboard.json | 4 ++ keyboards/kkatano/wallaby/wallaby.c | 25 ------------ keyboards/kkatano/yurei/keyboard.json | 4 ++ keyboards/kkatano/yurei/yurei.c | 25 ------------ keyboards/marksard/leftover30/keyboard.json | 4 ++ keyboards/marksard/leftover30/leftover30.c | 37 ------------------ keyboards/noxary/220/220.c | 34 ---------------- keyboards/noxary/220/keyboard.json | 3 ++ keyboards/noxary/268_2/268_2.c | 30 -------------- keyboards/noxary/268_2/keyboard.json | 3 ++ keyboards/noxary/280/280.c | 37 ------------------ keyboards/noxary/280/keyboard.json | 4 ++ keyboards/ortho5by12/keyboard.json | 4 ++ keyboards/ortho5by12/ortho5by12.c | 30 -------------- keyboards/percent/canoe_gen2/canoe_gen2.c | 15 ------- keyboards/percent/canoe_gen2/keyboard.json | 4 ++ keyboards/pom_keyboards/tnln95/keyboard.json | 4 ++ keyboards/pom_keyboards/tnln95/tnln95.c | 35 ----------------- keyboards/projectkb/alice/alice.c | 20 ---------- keyboards/projectkb/alice/rev1/config.h | 4 -- keyboards/projectkb/alice/rev1/keyboard.json | 5 +++ keyboards/projectkb/alice/rev2/config.h | 4 -- keyboards/projectkb/alice/rev2/keyboard.json | 5 +++ keyboards/rubi/keyboard.json | 3 ++ keyboards/rubi/rubi.c | 9 ----- keyboards/team0110/p1800fl/keyboard.json | 5 +++ keyboards/team0110/p1800fl/p1800fl.c | 28 ------------- keyboards/tkc/osav2/keyboard.json | 5 +++ keyboards/tkc/osav2/osav2.c | 33 ---------------- keyboards/tr60w/keyboard.json | 6 +++ keyboards/tr60w/tr60w.c | 11 ------ keyboards/wolfmarkclub/wm1/keyboard.json | 5 +++ keyboards/wolfmarkclub/wm1/wm1.c | 16 -------- keyboards/wsk/g4m3ralpha/g4m3ralpha.c | 39 ------------------- keyboards/wsk/g4m3ralpha/keyboard.json | 5 +++ keyboards/yushakobo/navpad/navpad_prefs.c | 4 -- 52 files changed, 111 insertions(+), 660 deletions(-) delete mode 100644 keyboards/acheron/austin/austin.c delete mode 100644 keyboards/cheshire/curiosity/curiosity.c delete mode 100644 keyboards/exclusive/e85/soldered/soldered.c delete mode 100644 keyboards/ghs/rar/rar.c delete mode 100644 keyboards/gray_studio/think65/solder/solder.c delete mode 100644 keyboards/ilumkb/volcano660/volcano660.c delete mode 100644 keyboards/jae/j01/j01.c delete mode 100644 keyboards/kkatano/wallaby/wallaby.c delete mode 100644 keyboards/kkatano/yurei/yurei.c delete mode 100644 keyboards/marksard/leftover30/leftover30.c delete mode 100644 keyboards/noxary/220/220.c delete mode 100644 keyboards/noxary/268_2/268_2.c delete mode 100644 keyboards/noxary/280/280.c delete mode 100644 keyboards/ortho5by12/ortho5by12.c delete mode 100644 keyboards/pom_keyboards/tnln95/tnln95.c delete mode 100644 keyboards/projectkb/alice/alice.c delete mode 100644 keyboards/team0110/p1800fl/p1800fl.c delete mode 100644 keyboards/tkc/osav2/osav2.c delete mode 100644 keyboards/tr60w/tr60w.c delete mode 100644 keyboards/wsk/g4m3ralpha/g4m3ralpha.c diff --git a/keyboards/acheron/austin/austin.c b/keyboards/acheron/austin/austin.c deleted file mode 100644 index 9a69d1c0865..00000000000 --- a/keyboards/acheron/austin/austin.c +++ /dev/null @@ -1,18 +0,0 @@ -#include "quantum.h" - -void keyboard_pre_init_kb(void) { - gpio_set_pin_output(A0); - gpio_set_pin_output(A1); - gpio_set_pin_output(A2); - - keyboard_pre_init_user(); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - gpio_write_pin(A2, led_state.num_lock); - gpio_write_pin(A0, led_state.caps_lock); - gpio_write_pin(A1, led_state.scroll_lock); - } - return true; -} diff --git a/keyboards/acheron/austin/keyboard.json b/keyboards/acheron/austin/keyboard.json index bee675472c9..a3df5dd75d3 100755 --- a/keyboards/acheron/austin/keyboard.json +++ b/keyboards/acheron/austin/keyboard.json @@ -33,6 +33,11 @@ "levels": 6, "breathing": true }, + "indicators": { + "caps_lock": "A0", + "num_lock": "A2", + "scroll_lock": "A1" + }, "processor": "STM32F072", "bootloader": "stm32-dfu", "layouts": { diff --git a/keyboards/cheshire/curiosity/curiosity.c b/keyboards/cheshire/curiosity/curiosity.c deleted file mode 100644 index 2813cff9b4a..00000000000 --- a/keyboards/cheshire/curiosity/curiosity.c +++ /dev/null @@ -1,17 +0,0 @@ -#include "quantum.h" - -void matrix_init_board(void){ - gpio_set_pin_output(A8); - gpio_set_pin_output(A9); - gpio_set_pin_output(A10); -} - -bool led_update_kb(led_t led_state) { - bool runDefault = led_update_user(led_state); - if (runDefault) { - gpio_write_pin(A8, !led_state.num_lock); - gpio_write_pin(A9, !led_state.caps_lock); - gpio_write_pin(A10, !led_state.scroll_lock); - } - return runDefault; -} diff --git a/keyboards/cheshire/curiosity/keyboard.json b/keyboards/cheshire/curiosity/keyboard.json index 679f2a45d1a..b408a5b6e95 100644 --- a/keyboards/cheshire/curiosity/keyboard.json +++ b/keyboards/cheshire/curiosity/keyboard.json @@ -7,6 +7,12 @@ "pid": "0x0FAD", "device_version": "0.0.1" }, + "indicators": { + "caps_lock": "A9", + "num_lock": "A8", + "scroll_lock": "A10", + "on_state": 0 + }, "rgblight": { "led_count": 14, "animations": { diff --git a/keyboards/doppelganger/doppelganger.c b/keyboards/doppelganger/doppelganger.c index 4a62fdf45f1..de0e2cc7556 100644 --- a/keyboards/doppelganger/doppelganger.c +++ b/keyboards/doppelganger/doppelganger.c @@ -16,21 +16,9 @@ #include "quantum.h" void keyboard_pre_init_kb(void) { - gpio_set_pin_output(C6); gpio_set_pin_output(B0); -} -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if (res) { - // gpio_write_pin sets the pin high for 1 and low for 0. - // In this example the pins are inverted, setting - // it low/0 turns it on, and high/1 turns the LED off. - // This behavior depends on whether the LED is between the pin - // and VCC or the pin and GND. - gpio_write_pin(C6, !led_state.caps_lock); - } - return res; + keyboard_pre_init_user(); } __attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) { diff --git a/keyboards/doppelganger/keyboard.json b/keyboards/doppelganger/keyboard.json index 9ea2241a807..ccba77fdfa5 100644 --- a/keyboards/doppelganger/keyboard.json +++ b/keyboards/doppelganger/keyboard.json @@ -8,6 +8,10 @@ "pid": "0x4447", "device_version": "0.0.1" }, + "indicators": { + "caps_lock": "C6", + "on_state": 0 + }, "matrix_pins": { "cols": ["F4", "F0", "B7", "B3", "B2", "B1", "D5", "D3", "D2"], "rows": ["E6", "F1", "C7", "F7", "F6"] diff --git a/keyboards/exclusive/e85/soldered/keyboard.json b/keyboards/exclusive/e85/soldered/keyboard.json index 8b4ebbfc575..dfd6d18826b 100644 --- a/keyboards/exclusive/e85/soldered/keyboard.json +++ b/keyboards/exclusive/e85/soldered/keyboard.json @@ -18,6 +18,10 @@ "levels": 6, "breathing": true }, + "indicators": { + "caps_lock": "C7", + "scroll_lock": "B5" + }, "rgblight": { "saturation_steps": 8, "brightness_steps": 8, diff --git a/keyboards/exclusive/e85/soldered/soldered.c b/keyboards/exclusive/e85/soldered/soldered.c deleted file mode 100644 index bdee95c26c6..00000000000 --- a/keyboards/exclusive/e85/soldered/soldered.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright 2020 VashtaNerada - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -void keyboard_pre_init_kb(void) { - gpio_set_pin_output(C7); - gpio_set_pin_output(B5); - - keyboard_pre_init_user(); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - gpio_write_pin(C7, led_state.caps_lock); - gpio_write_pin(B5, led_state.scroll_lock); - } - return true; -} diff --git a/keyboards/ghs/rar/keyboard.json b/keyboards/ghs/rar/keyboard.json index 22b133c8f99..96184abe6a6 100644 --- a/keyboards/ghs/rar/keyboard.json +++ b/keyboards/ghs/rar/keyboard.json @@ -8,6 +8,10 @@ "pid": "0x0001", "device_version": "0.0.1" }, + "indicators": { + "caps_lock": "B1", + "scroll_lock": "B3" + }, "rgblight": { "led_count": 17, "animations": { diff --git a/keyboards/ghs/rar/rar.c b/keyboards/ghs/rar/rar.c deleted file mode 100644 index 591932c99c2..00000000000 --- a/keyboards/ghs/rar/rar.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright 2020 Gone Hacking Studio - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -void keyboard_pre_init_kb(void) { - // Set our LED pins as output. - gpio_set_pin_output(B1); - gpio_set_pin_output(B3); - - keyboard_pre_init_user(); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - - if (res) { - gpio_write_pin(B1, led_state.caps_lock); - gpio_write_pin(B3, led_state.scroll_lock); - } - - return res; -} diff --git a/keyboards/gray_studio/think65/solder/keyboard.json b/keyboards/gray_studio/think65/solder/keyboard.json index 9706e8b4b49..09096a854e5 100644 --- a/keyboards/gray_studio/think65/solder/keyboard.json +++ b/keyboards/gray_studio/think65/solder/keyboard.json @@ -41,6 +41,10 @@ "nkro": false, "rgblight": true }, + "indicators": { + "caps_lock": "C7", + "on_state": 0 + }, "matrix_pins": { "cols": ["D1", "D0", "D2", "D3", "D5", "D4", "D6", "D7", "B4", "B5", "F0", "F1", "B6", "F4", "F5", "F6"], "rows": ["B0", "B1", "B2", "B3", "E6"] diff --git a/keyboards/gray_studio/think65/solder/solder.c b/keyboards/gray_studio/think65/solder/solder.c deleted file mode 100644 index 84267b9db07..00000000000 --- a/keyboards/gray_studio/think65/solder/solder.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright 2019 MechMerlin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "quantum.h" - -// Optional override functions below. -// You can leave any or all of these undefined. -// These are only required if you want to perform custom actions. - - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - gpio_set_pin_output(C7); - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - gpio_write_pin(C7, !led_state.caps_lock); - } - return true; -} diff --git a/keyboards/ilumkb/volcano660/keyboard.json b/keyboards/ilumkb/volcano660/keyboard.json index 297b28a5f92..fa74e46fedb 100644 --- a/keyboards/ilumkb/volcano660/keyboard.json +++ b/keyboards/ilumkb/volcano660/keyboard.json @@ -32,6 +32,12 @@ "pin": "B7", "levels": 5 }, + "indicators": { + "caps_lock": "D2", + "num_lock": "D0", + "scroll_lock": "D1", + "on_state": 0 + }, "processor": "atmega32u4", "bootloader": "atmel-dfu", "community_layouts": [ diff --git a/keyboards/ilumkb/volcano660/volcano660.c b/keyboards/ilumkb/volcano660/volcano660.c deleted file mode 100644 index 5e6d67c9ba9..00000000000 --- a/keyboards/ilumkb/volcano660/volcano660.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright 2020 dztech - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "quantum.h" - -void matrix_init_kb(void) { - gpio_set_pin_output(D0); - gpio_set_pin_output(D1); - gpio_set_pin_output(D2); - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(D0, !led_state.num_lock); - gpio_write_pin(D2, !led_state.caps_lock); - gpio_write_pin(D1, !led_state.scroll_lock); - - } - return res; -} diff --git a/keyboards/jae/j01/j01.c b/keyboards/jae/j01/j01.c deleted file mode 100644 index 4d3f8ced46c..00000000000 --- a/keyboards/jae/j01/j01.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright Evy Dekkers - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -// Optional override functions below. -// You can leave any or all of these undefined. -// These are only required if you want to perform custom actions. - - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); - gpio_set_pin_output(E6); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - gpio_write_pin(E6, !led_state.caps_lock); - } - - return true; -} diff --git a/keyboards/jae/j01/keyboard.json b/keyboards/jae/j01/keyboard.json index 56a5062c94c..fd16f2a46e7 100644 --- a/keyboards/jae/j01/keyboard.json +++ b/keyboards/jae/j01/keyboard.json @@ -33,6 +33,10 @@ "levels": 4, "breathing": true }, + "indicators": { + "caps_lock": "E6", + "on_state": 0 + }, "bootmagic": { "matrix": [0, 2] }, diff --git a/keyboards/kkatano/wallaby/keyboard.json b/keyboards/kkatano/wallaby/keyboard.json index ee475a54bc0..636fdba0422 100644 --- a/keyboards/kkatano/wallaby/keyboard.json +++ b/keyboards/kkatano/wallaby/keyboard.json @@ -22,6 +22,10 @@ "resync": true } }, + "indicators": { + "caps_lock": "B6", + "scroll_lock": "B7" + }, "matrix_pins": { "cols": ["D5", "C7", "C6", "D4", "D0", "E6", "F0", "F1", "F4", "F5", "F6", "F7", "D7", "D6", "D1", "D2", "D3"], "rows": ["B5", "B4", "B3", "B2", "B1", "B0"] diff --git a/keyboards/kkatano/wallaby/wallaby.c b/keyboards/kkatano/wallaby/wallaby.c deleted file mode 100644 index de2583903bb..00000000000 --- a/keyboards/kkatano/wallaby/wallaby.c +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright 2020 Koichi Katano - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - gpio_write_pin(B6, led_state.caps_lock); - gpio_write_pin(B7, led_state.scroll_lock); - } - return true; -} diff --git a/keyboards/kkatano/yurei/keyboard.json b/keyboards/kkatano/yurei/keyboard.json index 7bf08957872..59084920da6 100644 --- a/keyboards/kkatano/yurei/keyboard.json +++ b/keyboards/kkatano/yurei/keyboard.json @@ -22,6 +22,10 @@ "resync": true } }, + "indicators": { + "caps_lock": "B6", + "scroll_lock": "B7" + }, "matrix_pins": { "cols": ["D5", "C7", "C6", "D4", "D0", "E6", "F0", "F1", "F4", "F5", "F6", "F7", "D7", "D6", "D1", "D2", "D3"], "rows": ["B5", "B4", "B3", "B2", "B1", "B0"] diff --git a/keyboards/kkatano/yurei/yurei.c b/keyboards/kkatano/yurei/yurei.c deleted file mode 100644 index 283726a884f..00000000000 --- a/keyboards/kkatano/yurei/yurei.c +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright 2019 Koichi Katano - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - gpio_write_pin(B6, led_state.caps_lock); - gpio_write_pin(B7, led_state.scroll_lock); - } - return true; -} diff --git a/keyboards/marksard/leftover30/keyboard.json b/keyboards/marksard/leftover30/keyboard.json index 546b3dbdd33..ae2250a5f2c 100644 --- a/keyboards/marksard/leftover30/keyboard.json +++ b/keyboards/marksard/leftover30/keyboard.json @@ -33,6 +33,10 @@ {"pin_a": "F4", "pin_b": "F5"} ] }, + "indicators": { + "caps_lock": "D1", + "num_lock": "D2" + }, "rgblight": { "saturation_steps": 8, "brightness_steps": 8, diff --git a/keyboards/marksard/leftover30/leftover30.c b/keyboards/marksard/leftover30/leftover30.c deleted file mode 100644 index cea0de703ab..00000000000 --- a/keyboards/marksard/leftover30/leftover30.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright 2020 marksard - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -// Optional override functions below. -// You can leave any or all of these undefined. -// These are only required if you want to perform custom actions. - -void keyboard_pre_init_user(void) { - /* Set CAPSLOCK indicator pin as output */ - gpio_set_pin_output(D1); - /* Set NUMLOCK indicator pin as output */ - gpio_set_pin_output(D2); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(D2, led_state.num_lock); - gpio_write_pin(D1, led_state.caps_lock); - } - return res; -} diff --git a/keyboards/noxary/220/220.c b/keyboards/noxary/220/220.c deleted file mode 100644 index c5affa4344d..00000000000 --- a/keyboards/noxary/220/220.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright 2020 Rozakiin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "quantum.h" - -// Optional override functions below. -// You can leave any or all of these undefined. -// These are only required if you want to perform custom actions. - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - gpio_set_pin_output(C6); - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - gpio_write_pin(C6, led_state.num_lock); - } - return true; -} \ No newline at end of file diff --git a/keyboards/noxary/220/keyboard.json b/keyboards/noxary/220/keyboard.json index 75d71aac8a3..35653169998 100644 --- a/keyboards/noxary/220/keyboard.json +++ b/keyboards/noxary/220/keyboard.json @@ -32,6 +32,9 @@ "pin": "B7", "breathing": true }, + "indicators": { + "num_lock": "C6" + }, "processor": "atmega32u2", "bootloader": "atmel-dfu", "community_layouts": ["ortho_6x4"], diff --git a/keyboards/noxary/268_2/268_2.c b/keyboards/noxary/268_2/268_2.c deleted file mode 100644 index 56b42d2343d..00000000000 --- a/keyboards/noxary/268_2/268_2.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright 2018 Rozakiin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "quantum.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - gpio_set_pin_output(B0); - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - gpio_write_pin(B0, led_state.caps_lock); - } - return true; -} diff --git a/keyboards/noxary/268_2/keyboard.json b/keyboards/noxary/268_2/keyboard.json index c724d07a493..08daee6d639 100644 --- a/keyboards/noxary/268_2/keyboard.json +++ b/keyboards/noxary/268_2/keyboard.json @@ -31,6 +31,9 @@ "backlight": { "pin": "B7" }, + "indicators": { + "caps_lock": "B0" + }, "processor": "atmega32u4", "bootloader": "atmel-dfu", "community_layouts": ["65_ansi_blocker"], diff --git a/keyboards/noxary/280/280.c b/keyboards/noxary/280/280.c deleted file mode 100644 index 0f29df178f4..00000000000 --- a/keyboards/noxary/280/280.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright 2019 %YOUR_NAME% - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "quantum.h" - -// Optional override functions below. -// You can leave any or all of these undefined. -// These are only required if you want to perform custom actions. - - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - gpio_set_pin_output(D5); - gpio_set_pin_output(D0); - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - gpio_write_pin(D5, led_state.caps_lock); - gpio_write_pin(D0, led_state.scroll_lock); - } - return true; -} \ No newline at end of file diff --git a/keyboards/noxary/280/keyboard.json b/keyboards/noxary/280/keyboard.json index 17acb96cdf4..4bd9257152f 100644 --- a/keyboards/noxary/280/keyboard.json +++ b/keyboards/noxary/280/keyboard.json @@ -32,6 +32,10 @@ "pin": "B7", "breathing": true }, + "indicators": { + "caps_lock": "D5", + "scroll_lock": "D0" + }, "processor": "atmega32u4", "bootloader": "atmel-dfu", "layouts": { diff --git a/keyboards/ortho5by12/keyboard.json b/keyboards/ortho5by12/keyboard.json index 49ce4944175..5bcd1e00fcd 100644 --- a/keyboards/ortho5by12/keyboard.json +++ b/keyboards/ortho5by12/keyboard.json @@ -22,6 +22,10 @@ "resync": true } }, + "indicators": { + "caps_lock": "C5", + "num_lock": "C4" + }, "matrix_pins": { "cols": ["C2", "D0", "D1", "D4", "C3", "C1"], "rows": ["B5", "B1", "B2", "B3", "B4", "C0", "D5", "D6", "D7", "B0"] diff --git a/keyboards/ortho5by12/ortho5by12.c b/keyboards/ortho5by12/ortho5by12.c deleted file mode 100644 index d0d9ce9102d..00000000000 --- a/keyboards/ortho5by12/ortho5by12.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright 2019 Takuya Urakawa (dm9records.com) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "quantum.h" - -void matrix_init_kb(void) { - gpio_set_pin_output(C4); - gpio_set_pin_output(C5); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(C4, led_state.num_lock); - gpio_write_pin(C5, led_state.caps_lock); - } - return res; -} diff --git a/keyboards/percent/canoe_gen2/canoe_gen2.c b/keyboards/percent/canoe_gen2/canoe_gen2.c index ea091c34744..435083a269d 100644 --- a/keyboards/percent/canoe_gen2/canoe_gen2.c +++ b/keyboards/percent/canoe_gen2/canoe_gen2.c @@ -17,21 +17,6 @@ along with this program. If not, see . #include "quantum.h" -void keyboard_pre_init_kb(void) { - gpio_set_pin_output(E6); - gpio_write_pin_high(E6); - - keyboard_pre_init_user(); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - gpio_write_pin(E6, !led_state.caps_lock); - } - - return true; -} - #ifdef RGB_MATRIX_ENABLE void suspend_power_down_kb(void) { rgb_matrix_set_suspend_state(true); diff --git a/keyboards/percent/canoe_gen2/keyboard.json b/keyboards/percent/canoe_gen2/keyboard.json index 0b6ece2613c..85fbfd28b9d 100644 --- a/keyboards/percent/canoe_gen2/keyboard.json +++ b/keyboards/percent/canoe_gen2/keyboard.json @@ -22,6 +22,10 @@ "resync": true } }, + "indicators": { + "caps_lock": "E6", + "on_state": 0 + }, "ws2812": { "pin": "B7" }, diff --git a/keyboards/pom_keyboards/tnln95/keyboard.json b/keyboards/pom_keyboards/tnln95/keyboard.json index c92ac5b38f1..09b3f71f7c0 100644 --- a/keyboards/pom_keyboards/tnln95/keyboard.json +++ b/keyboards/pom_keyboards/tnln95/keyboard.json @@ -37,6 +37,10 @@ "levels": 10, "breathing": true }, + "indicators": { + "caps_lock": "B2", + "num_lock": "B1" + }, "rgblight": { "saturation_steps": 8, "brightness_steps": 8, diff --git a/keyboards/pom_keyboards/tnln95/tnln95.c b/keyboards/pom_keyboards/tnln95/tnln95.c deleted file mode 100644 index b8ab8ff7a7e..00000000000 --- a/keyboards/pom_keyboards/tnln95/tnln95.c +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright 2020 Nguyen Minh Hoang - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "quantum.h" - -void keyboard_pre_init_kb(void) { - gpio_set_pin_output(B1); - gpio_set_pin_output(B2); - /* I will add function to these later */ - // gpio_set_pin_output(B3); - // gpio_set_pin_output(E2); - - keyboard_pre_init_user(); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(B1, led_state.num_lock); - gpio_write_pin(B2, led_state.caps_lock); - } - return res; -} diff --git a/keyboards/projectkb/alice/alice.c b/keyboards/projectkb/alice/alice.c deleted file mode 100644 index 8ec5f16736f..00000000000 --- a/keyboards/projectkb/alice/alice.c +++ /dev/null @@ -1,20 +0,0 @@ -#include "quantum.h" - -void keyboard_pre_init_kb(void) { - gpio_set_pin_output(INDICATOR_PIN_0); - gpio_set_pin_output(INDICATOR_PIN_1); - gpio_set_pin_output(INDICATOR_PIN_2); - - keyboard_pre_init_user(); -} - - -bool led_update_kb(led_t led_state) { - bool runDefault = led_update_user(led_state); - if (runDefault) { - gpio_write_pin(INDICATOR_PIN_0, !led_state.num_lock); - gpio_write_pin(INDICATOR_PIN_1, !led_state.caps_lock); - gpio_write_pin(INDICATOR_PIN_2, !led_state.scroll_lock); - } - return runDefault; -} diff --git a/keyboards/projectkb/alice/rev1/config.h b/keyboards/projectkb/alice/rev1/config.h index 66d3b75731b..b8c68bc65d4 100644 --- a/keyboards/projectkb/alice/rev1/config.h +++ b/keyboards/projectkb/alice/rev1/config.h @@ -26,10 +26,6 @@ along with this program. If not, see . #define WS2812_SPI_SCK_PAL_MODE 0 #define WS2812_SPI_SCK_PIN B13 -#define INDICATOR_PIN_0 A0 -#define INDICATOR_PIN_1 A1 -#define INDICATOR_PIN_2 A2 - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/projectkb/alice/rev1/keyboard.json b/keyboards/projectkb/alice/rev1/keyboard.json index 7e957d7ff41..01eee1300be 100644 --- a/keyboards/projectkb/alice/rev1/keyboard.json +++ b/keyboards/projectkb/alice/rev1/keyboard.json @@ -15,6 +15,11 @@ "resync": true } }, + "indicators": { + "caps_lock": "A1", + "num_lock": "A0", + "scroll_lock": "A2" + }, "rgblight": { "led_count": 14, "animations": { diff --git a/keyboards/projectkb/alice/rev2/config.h b/keyboards/projectkb/alice/rev2/config.h index 3e786c18056..b8c68bc65d4 100644 --- a/keyboards/projectkb/alice/rev2/config.h +++ b/keyboards/projectkb/alice/rev2/config.h @@ -26,10 +26,6 @@ along with this program. If not, see . #define WS2812_SPI_SCK_PAL_MODE 0 #define WS2812_SPI_SCK_PIN B13 -#define INDICATOR_PIN_0 A9 -#define INDICATOR_PIN_1 A8 -#define INDICATOR_PIN_2 B12 - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/projectkb/alice/rev2/keyboard.json b/keyboards/projectkb/alice/rev2/keyboard.json index 639fc268779..0e34b7104f9 100644 --- a/keyboards/projectkb/alice/rev2/keyboard.json +++ b/keyboards/projectkb/alice/rev2/keyboard.json @@ -15,6 +15,11 @@ "resync": true } }, + "indicators": { + "caps_lock": "A8", + "num_lock": "A9", + "scroll_lock": "B12" + }, "rgblight": { "led_count": 14, "animations": { diff --git a/keyboards/rubi/keyboard.json b/keyboards/rubi/keyboard.json index cb94b586156..555376b533b 100644 --- a/keyboards/rubi/keyboard.json +++ b/keyboards/rubi/keyboard.json @@ -22,6 +22,9 @@ "resync": true } }, + "indicators": { + "caps_lock": "C6" + }, "matrix_pins": { "cols": ["B3", "B2", "B1", "F7"], "rows": ["F0", "F1", "F4", "F5", "F6"] diff --git a/keyboards/rubi/rubi.c b/keyboards/rubi/rubi.c index 89bf9caa6d4..4f0536397f0 100644 --- a/keyboards/rubi/rubi.c +++ b/keyboards/rubi/rubi.c @@ -63,12 +63,3 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { return process_record_user_oled(keycode, record); } - - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if (res) { - gpio_write_pin(C6, led_state.num_lock); - } - return true; -} diff --git a/keyboards/team0110/p1800fl/keyboard.json b/keyboards/team0110/p1800fl/keyboard.json index a56864cd36a..681482db5bc 100644 --- a/keyboards/team0110/p1800fl/keyboard.json +++ b/keyboards/team0110/p1800fl/keyboard.json @@ -34,6 +34,11 @@ "levels": 5, "breathing": true }, + "indicators": { + "caps_lock": "D5", + "num_lock": "D3", + "scroll_lock": "C6" + }, "rgblight": { "saturation_steps": 8, "brightness_steps": 8, diff --git a/keyboards/team0110/p1800fl/p1800fl.c b/keyboards/team0110/p1800fl/p1800fl.c deleted file mode 100644 index 9f47b8a5c44..00000000000 --- a/keyboards/team0110/p1800fl/p1800fl.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright 2020 marhalloweenvt - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(D3, led_state.num_lock); - gpio_write_pin(D5, led_state.caps_lock); - gpio_write_pin(C6, led_state.scroll_lock); - } - return res; -} - diff --git a/keyboards/tkc/osav2/keyboard.json b/keyboards/tkc/osav2/keyboard.json index 118eedfc850..ef4c7897978 100644 --- a/keyboards/tkc/osav2/keyboard.json +++ b/keyboards/tkc/osav2/keyboard.json @@ -50,6 +50,11 @@ "pin": "D6", "breathing": true }, + "indicators": { + "caps_lock": "C6", + "num_lock": "C7", + "scroll_lock": "B6" + }, "processor": "atmega32u4", "bootloader": "atmel-dfu", "community_layouts": ["alice", "alice_split_bs"], diff --git a/keyboards/tkc/osav2/osav2.c b/keyboards/tkc/osav2/osav2.c deleted file mode 100644 index 99660464865..00000000000 --- a/keyboards/tkc/osav2/osav2.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright 2019 jrfhoutx - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "quantum.h" - -void keyboard_pre_init_kb(void) { - gpio_set_pin_output(C7); - gpio_set_pin_output(C6); - gpio_set_pin_output(B6); - - keyboard_pre_init_user(); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - gpio_write_pin(C7, led_state.num_lock); - gpio_write_pin(C6, led_state.caps_lock); - gpio_write_pin(B6, led_state.scroll_lock); - } - return true; -} diff --git a/keyboards/tr60w/keyboard.json b/keyboards/tr60w/keyboard.json index 60c01bdcfc6..dc71e3ad7aa 100644 --- a/keyboards/tr60w/keyboard.json +++ b/keyboards/tr60w/keyboard.json @@ -32,6 +32,12 @@ "backlight": { "pin": "B7" }, + "indicators": { + "caps_lock": "B2", + "num_lock": "B1", + "scroll_lock": "B3", + "on_state": 0 + }, "rgblight": { "saturation_steps": 8, "brightness_steps": 8, diff --git a/keyboards/tr60w/tr60w.c b/keyboards/tr60w/tr60w.c deleted file mode 100644 index ebf48cb1c7b..00000000000 --- a/keyboards/tr60w/tr60w.c +++ /dev/null @@ -1,11 +0,0 @@ -#include "quantum.h" - -bool led_update_kb(led_t led_state) { - bool runDefault = led_update_user(led_state); - if (runDefault) { - gpio_write_pin(B1, !led_state.num_lock); - gpio_write_pin(B2, !led_state.caps_lock); - gpio_write_pin(B3, !led_state.scroll_lock); - } - return runDefault; -} diff --git a/keyboards/wolfmarkclub/wm1/keyboard.json b/keyboards/wolfmarkclub/wm1/keyboard.json index 56c062e1024..0cea5546c8a 100644 --- a/keyboards/wolfmarkclub/wm1/keyboard.json +++ b/keyboards/wolfmarkclub/wm1/keyboard.json @@ -27,6 +27,11 @@ "resync": true } }, + "indicators": { + "caps_lock": "B1", + "num_lock": "B0", + "scroll_lock": "C5" + }, "rgblight": { "saturation_steps": 8, "brightness_steps": 8, diff --git a/keyboards/wolfmarkclub/wm1/wm1.c b/keyboards/wolfmarkclub/wm1/wm1.c index 9c4fb090c88..83c4c8bb458 100644 --- a/keyboards/wolfmarkclub/wm1/wm1.c +++ b/keyboards/wolfmarkclub/wm1/wm1.c @@ -4,19 +4,3 @@ void bootloader_jump(void) { // This board doesn't use the "standard" stm32duino bootloader, and no information is available regarding how to enter bootloader mode. All we can do here is reset. NVIC_SystemReset(); } - -void matrix_init_kb(void) { - gpio_set_pin_output(B1); // Top Indicator LED - gpio_set_pin_output(B0); // Middle Indicator LED - gpio_set_pin_output(C5); // Bottom Indicator LED - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - gpio_write_pin(B1, led_state.caps_lock); - gpio_write_pin(B0, led_state.num_lock); - gpio_write_pin(C5, led_state.scroll_lock); - } - return true; -} diff --git a/keyboards/wsk/g4m3ralpha/g4m3ralpha.c b/keyboards/wsk/g4m3ralpha/g4m3ralpha.c deleted file mode 100644 index 3c039a173fe..00000000000 --- a/keyboards/wsk/g4m3ralpha/g4m3ralpha.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright 2020 Worldspawn - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - - -void matrix_init_kb(void) { - gpio_set_pin_output(D3); - gpio_write_pin_low(D3); - gpio_set_pin_output(D2); - gpio_write_pin_low(D2); - gpio_set_pin_output(D0); - gpio_write_pin_low(D0); - - matrix_init_user(); -}; - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(D3, led_state.num_lock); - gpio_write_pin(D0, led_state.caps_lock); - gpio_write_pin(D2, led_state.scroll_lock); - } - return res; -} diff --git a/keyboards/wsk/g4m3ralpha/keyboard.json b/keyboards/wsk/g4m3ralpha/keyboard.json index fcb2f26f5fd..b5cdb7ce101 100644 --- a/keyboards/wsk/g4m3ralpha/keyboard.json +++ b/keyboards/wsk/g4m3ralpha/keyboard.json @@ -8,6 +8,11 @@ "pid": "0x56D9", "device_version": "0.0.1" }, + "indicators": { + "caps_lock": "D0", + "num_lock": "D3", + "scroll_lock": "D2" + }, "rgblight": { "saturation_steps": 8, "brightness_steps": 8, diff --git a/keyboards/yushakobo/navpad/navpad_prefs.c b/keyboards/yushakobo/navpad/navpad_prefs.c index 08b7464cf95..c7b3881621a 100644 --- a/keyboards/yushakobo/navpad/navpad_prefs.c +++ b/keyboards/yushakobo/navpad/navpad_prefs.c @@ -37,10 +37,6 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { return true; } -bool led_update_kb(led_t led_state) { - return led_update_user(led_state); -} - #ifdef ENCODER_ENABLE bool encoder_update_kb(uint8_t index, bool clockwise) { if (!encoder_update_user(index, clockwise)) { return false; } From e96d6d9bd43a83c5d9ada75014bc9ef90abc8f40 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 23 Jun 2024 13:08:57 +1000 Subject: [PATCH 021/204] Migrate RGB Matrix layout for two boards (#23963) --- keyboards/doio/kb30/kb30.c | 28 ---------- keyboards/doio/kb30/keyboard.json | 45 ++++++++++++++- keyboards/work_louder/work_board/info.json | 56 ++++++++++++++++++- keyboards/work_louder/work_board/work_board.c | 19 ------- 4 files changed, 99 insertions(+), 49 deletions(-) diff --git a/keyboards/doio/kb30/kb30.c b/keyboards/doio/kb30/kb30.c index 53a4546e062..671f49e8aba 100644 --- a/keyboards/doio/kb30/kb30.c +++ b/keyboards/doio/kb30/kb30.c @@ -17,34 +17,6 @@ #include "quantum.h" - -#ifdef RGB_MATRIX_ENABLE - - led_config_t g_led_config = { { - // Key Matrix to LED Index - { 0, 1, 2, 3, 4, 5, 6}, - { 7, 8, 9, 10, 11, 12, 13}, - { 14, 15, 16, 17, 18, 19, NO_LED }, - { 20, 21, 22, 23, NO_LED, 24, NO_LED}, - { 25, 26, 27, 28, 29, NO_LED, NO_LED}, - { 30, 31, 32, 33, 34, 35} -}, { -{0,0}, {37,0}, {75,0}, {112,0}, {149,0}, {187,0}, {224,0}, -{0,16}, {37,16}, {75,16}, {112,16}, {149,16}, {187,16}, {224,16}, -{0,32}, {37,32}, {75,32}, {112,32}, {149,32}, {187,32}, -{0,48}, {37,48}, {75,48}, {112,48}, {187,48}, -{0,64}, {37,64}, {65,64}, {112,64}, {149,64}, -{187,64}, {173,64}, {186,64}, {198,64}, {211,64},{224,64}, -}, { - 4,4,4,4,4,4,4, - 4,4,4,4,4,4,4, - 4,4,4,4,4,4, - 4,4,4,4,4, - 4,4,4,4,4, - 4,4,4,4,4,4 -} }; -#endif - /* OLED */ #ifdef OLED_ENABLE uint16_t startup_timer = 0; diff --git a/keyboards/doio/kb30/keyboard.json b/keyboards/doio/kb30/keyboard.json index b14eab1c33a..388df2d9e36 100644 --- a/keyboards/doio/kb30/keyboard.json +++ b/keyboards/doio/kb30/keyboard.json @@ -46,7 +46,50 @@ }, "driver": "ws2812", "max_brightness": 200, - "sleep": true + "sleep": true, + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0, "flags": 4}, + {"matrix": [0, 1], "x": 37, "y": 0, "flags": 4}, + {"matrix": [0, 2], "x": 75, "y": 0, "flags": 4}, + {"matrix": [0, 3], "x": 112, "y": 0, "flags": 4}, + {"matrix": [0, 4], "x": 149, "y": 0, "flags": 4}, + {"matrix": [0, 5], "x": 187, "y": 0, "flags": 4}, + {"matrix": [0, 6], "x": 224, "y": 0, "flags": 4}, + + {"matrix": [1, 0], "x": 0, "y": 16, "flags": 4}, + {"matrix": [1, 1], "x": 37, "y": 16, "flags": 4}, + {"matrix": [1, 2], "x": 75, "y": 16, "flags": 4}, + {"matrix": [1, 3], "x": 112, "y": 16, "flags": 4}, + {"matrix": [1, 4], "x": 149, "y": 16, "flags": 4}, + {"matrix": [1, 5], "x": 187, "y": 16, "flags": 4}, + {"matrix": [1, 6], "x": 224, "y": 16, "flags": 4}, + + {"matrix": [2, 0], "x": 0, "y": 32, "flags": 4}, + {"matrix": [2, 1], "x": 37, "y": 32, "flags": 4}, + {"matrix": [2, 2], "x": 75, "y": 32, "flags": 4}, + {"matrix": [2, 3], "x": 112, "y": 32, "flags": 4}, + {"matrix": [2, 4], "x": 149, "y": 32, "flags": 4}, + {"matrix": [2, 5], "x": 187, "y": 32, "flags": 4}, + + {"matrix": [3, 0], "x": 0, "y": 48, "flags": 4}, + {"matrix": [3, 1], "x": 37, "y": 48, "flags": 4}, + {"matrix": [3, 2], "x": 75, "y": 48, "flags": 4}, + {"matrix": [3, 3], "x": 112, "y": 48, "flags": 4}, + {"matrix": [3, 5], "x": 187, "y": 48, "flags": 4}, + + {"matrix": [4, 0], "x": 18, "y": 64, "flags": 4}, + {"matrix": [4, 1], "x": 75, "y": 64, "flags": 4}, + {"matrix": [4, 2], "x": 149, "y": 64, "flags": 4}, + {"matrix": [4, 3], "x": 187, "y": 64, "flags": 4}, + {"matrix": [4, 4], "x": 224, "y": 64, "flags": 4}, + + {"x": 224, "y": 56, "flags": 2}, + {"x": 112, "y": 56, "flags": 2}, + {"x": 0, "y": 56, "flags": 2}, + {"x": 0, "y": 8, "flags": 2}, + {"x": 112, "y": 8, "flags": 2}, + {"x": 224, "y": 8, "flags": 2} + ] }, "features": { "bootmagic": true, diff --git a/keyboards/work_louder/work_board/info.json b/keyboards/work_louder/work_board/info.json index dc412fdabd1..0e97efa9a47 100644 --- a/keyboards/work_louder/work_board/info.json +++ b/keyboards/work_louder/work_board/info.json @@ -58,7 +58,61 @@ }, "driver": "ws2812", "max_brightness": 120, - "sleep": true + "sleep": true, + "layout": [ + {"matrix": [3, 11], "x": 223, "y": 63, "flags": 1}, + {"matrix": [3, 10], "x": 203, "y": 63, "flags": 1}, + {"matrix": [3, 9], "x": 183, "y": 63, "flags": 1}, + {"matrix": [3, 8], "x": 162, "y": 63, "flags": 1}, + {"matrix": [3, 7], "x": 142, "y": 63, "flags": 1}, + {"matrix": [3, 6], "x": 122, "y": 63, "flags": 4}, + {"x": 112, "y": 63, "flags": 4}, + {"matrix": [3, 5], "x": 101, "y": 63, "flags": 4}, + {"matrix": [3, 4], "x": 81, "y": 63, "flags": 1}, + {"matrix": [3, 3], "x": 61, "y": 63, "flags": 1}, + {"matrix": [3, 2], "x": 40, "y": 63, "flags": 1}, + {"matrix": [3, 1], "x": 20, "y": 63, "flags": 1}, + {"matrix": [3, 0], "x": 0, "y": 63, "flags": 1}, + + {"matrix": [2, 0], "x": 0, "y": 42, "flags": 1}, + {"matrix": [2, 1], "x": 20, "y": 42, "flags": 4}, + {"matrix": [2, 2], "x": 40, "y": 42, "flags": 4}, + {"matrix": [2, 3], "x": 61, "y": 42, "flags": 4}, + {"matrix": [2, 4], "x": 81, "y": 42, "flags": 4}, + {"matrix": [2, 5], "x": 101, "y": 42, "flags": 4}, + {"matrix": [2, 6], "x": 122, "y": 42, "flags": 4}, + {"matrix": [2, 7], "x": 142, "y": 42, "flags": 4}, + {"matrix": [2, 8], "x": 162, "y": 42, "flags": 4}, + {"matrix": [2, 9], "x": 183, "y": 42, "flags": 4}, + {"matrix": [2, 10], "x": 203, "y": 42, "flags": 4}, + {"matrix": [2, 11], "x": 223, "y": 42, "flags": 1}, + + {"matrix": [1, 11], "x": 223, "y": 21, "flags": 1}, + {"matrix": [1, 10], "x": 203, "y": 21, "flags": 4}, + {"matrix": [1, 9], "x": 183, "y": 21, "flags": 4}, + {"matrix": [1, 8], "x": 162, "y": 21, "flags": 4}, + {"matrix": [1, 7], "x": 142, "y": 21, "flags": 4}, + {"matrix": [1, 6], "x": 122, "y": 21, "flags": 4}, + {"matrix": [1, 5], "x": 101, "y": 21, "flags": 4}, + {"matrix": [1, 4], "x": 81, "y": 21, "flags": 4}, + {"matrix": [1, 3], "x": 61, "y": 21, "flags": 4}, + {"matrix": [1, 2], "x": 40, "y": 21, "flags": 4}, + {"matrix": [1, 1], "x": 20, "y": 21, "flags": 4}, + {"matrix": [1, 0], "x": 0, "y": 21, "flags": 1}, + + {"matrix": [0, 0], "x": 0, "y": 0, "flags": 1}, + {"matrix": [0, 1], "x": 20, "y": 0, "flags": 4}, + {"matrix": [0, 2], "x": 40, "y": 0, "flags": 4}, + {"matrix": [0, 3], "x": 61, "y": 0, "flags": 4}, + {"matrix": [0, 4], "x": 81, "y": 0, "flags": 4}, + {"matrix": [0, 5], "x": 101, "y": 0, "flags": 4}, + {"matrix": [0, 6], "x": 122, "y": 0, "flags": 4}, + {"matrix": [0, 7], "x": 142, "y": 0, "flags": 4}, + {"matrix": [0, 8], "x": 162, "y": 0, "flags": 4}, + {"matrix": [0, 9], "x": 183, "y": 0, "flags": 4}, + {"matrix": [0, 10], "x": 203, "y": 0, "flags": 4}, + {"matrix": [0, 11], "x": 223, "y": 0, "flags": 1}, + ] }, "matrix_pins": { "cols": ["D3", "D5", "D4", "D6", "D7", "B4", "B5", "B6", "C6", "C7", "F7", "F6", "E6"], diff --git a/keyboards/work_louder/work_board/work_board.c b/keyboards/work_louder/work_board/work_board.c index 975c7aa794c..ef36b3171f2 100644 --- a/keyboards/work_louder/work_board/work_board.c +++ b/keyboards/work_louder/work_board/work_board.c @@ -67,25 +67,6 @@ bool oled_task_kb(void) { #endif #ifdef RGB_MATRIX_ENABLE -// clang-format off -led_config_t g_led_config = { { - { 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48 }, - { 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25 }, - { 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 }, - { 12, 11, 10, 9, 8, 7, 5, 4, 3, 2, 1, 0} -}, { - { 223, 63 }, { 203, 63 }, { 183, 63 }, { 162, 63 }, { 142, 63 }, { 122, 63 }, { 112, 63 }, { 101, 63 }, { 81, 63 }, { 61, 63 }, { 40, 63 }, { 20, 63 }, { 0, 63 }, - { 0, 42 }, { 20, 42 }, { 40, 42 }, { 61, 42 }, { 81, 42 }, { 101, 42 }, { 122, 42 }, { 142, 42 }, { 162, 42 }, { 183, 42 }, { 203, 42 }, { 223, 42 }, - { 223, 21 }, { 203, 21 }, { 183, 21 }, { 162, 21 }, { 142, 21 }, { 122, 21 }, { 101, 21 }, { 81, 21 }, { 61, 21 }, { 40, 21 }, { 20, 21 }, { 0, 21 }, - { 0, 0 }, { 20, 0 }, { 40, 0 }, { 61, 0 }, { 81, 0 }, { 101, 0 }, { 122, 0 }, { 142, 0 }, { 162, 0 }, { 183, 0 }, { 203, 0 }, { 223, 0 } -}, { - 1, 1, 1, 1, 1, 4,4,4, 1, 1, 1, 1, 1, - 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, - 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, - 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1 -} }; -// clang-format on - # ifdef VIA_ENABLE bool via_layout_2u = false; From f0471dd5b4e737726540d5e86f2666726808a1ba Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sun, 23 Jun 2024 09:02:13 +0100 Subject: [PATCH 022/204] Remove skipped schema files (#23987) --- data/schemas/false.jsonschema | 1 - data/schemas/true.jsonschema | 1 - 2 files changed, 2 deletions(-) delete mode 100644 data/schemas/false.jsonschema delete mode 100644 data/schemas/true.jsonschema diff --git a/data/schemas/false.jsonschema b/data/schemas/false.jsonschema deleted file mode 100644 index c508d5366f7..00000000000 --- a/data/schemas/false.jsonschema +++ /dev/null @@ -1 +0,0 @@ -false diff --git a/data/schemas/true.jsonschema b/data/schemas/true.jsonschema deleted file mode 100644 index 27ba77ddaf6..00000000000 --- a/data/schemas/true.jsonschema +++ /dev/null @@ -1 +0,0 @@ -true From a2176f6a039b5f92ba4cb473f7a2de560b57dd86 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Tue, 25 Jun 2024 03:25:05 +0100 Subject: [PATCH 023/204] Migrate `led_update_kb` implementations to DD (#23985) --- keyboards/bear_face/info.json | 3 ++ keyboards/bear_face/v1/v1.c | 34 ---------------- keyboards/bear_face/v2/v2.c | 34 ---------------- keyboards/dztech/bocc/bocc.c | 29 -------------- keyboards/dztech/bocc/keyboard.json | 4 ++ keyboards/evyd13/gh80_3700/gh80_3700.c | 14 ++----- keyboards/evyd13/gh80_3700/keyboard.json | 4 ++ keyboards/exclusive/e85/hotswap/hotswap.c | 32 --------------- keyboards/exclusive/e85/hotswap/keyboard.json | 4 ++ keyboards/fjlabs/bolsa65/bolsa65.c | 28 ------------- keyboards/fjlabs/bolsa65/keyboard.json | 3 ++ keyboards/flx/virgo/keyboard.json | 5 +++ keyboards/flx/virgo/virgo.c | 34 ---------------- keyboards/handwired/colorlice/colorlice.c | 15 ------- keyboards/handwired/colorlice/keyboard.json | 6 +++ keyboards/handwired/evk/v1_3/v1_3.c | 9 ----- keyboards/handwired/retro_refit/keyboard.json | 6 +++ keyboards/handwired/retro_refit/retro_refit.c | 12 ------ keyboards/handwired/selene/keyboard.json | 5 +++ keyboards/handwired/selene/selene.c | 18 +-------- keyboards/handwired/selene/selene.h | 23 ----------- keyboards/handwired/z150/config.h | 38 ------------------ keyboards/handwired/z150/keyboard.json | 6 +++ keyboards/handwired/z150/z150.c | 39 ------------------- keyboards/kabedon/kabedon980/kabedon980.c | 8 ---- keyboards/kabedon/kabedon980/keyboard.json | 4 ++ keyboards/noxary/x268/keyboard.json | 3 ++ keyboards/noxary/x268/x268.c | 34 ---------------- keyboards/punk75/config.h | 20 ---------- keyboards/punk75/keyboard.json | 4 ++ keyboards/punk75/keymaps/default/keymap.c | 2 +- keyboards/punk75/keymaps/via/keymap.c | 2 +- keyboards/punk75/punk75.c | 32 --------------- keyboards/redscarf_i/keyboard.json | 4 ++ keyboards/redscarf_i/redscarf_i.c | 10 +---- keyboards/sneakbox/aliceclone/aliceclone.c | 36 ----------------- keyboards/sneakbox/aliceclone/keyboard.json | 5 +++ .../yiancardesigns/barleycorn/barleycorn.c | 37 ------------------ .../yiancardesigns/barleycorn/keyboard.json | 4 ++ 39 files changed, 77 insertions(+), 533 deletions(-) delete mode 100644 keyboards/bear_face/v1/v1.c delete mode 100644 keyboards/bear_face/v2/v2.c delete mode 100644 keyboards/dztech/bocc/bocc.c delete mode 100644 keyboards/exclusive/e85/hotswap/hotswap.c delete mode 100644 keyboards/fjlabs/bolsa65/bolsa65.c delete mode 100644 keyboards/flx/virgo/virgo.c delete mode 100644 keyboards/handwired/selene/selene.h delete mode 100644 keyboards/handwired/z150/config.h delete mode 100644 keyboards/handwired/z150/z150.c delete mode 100644 keyboards/kabedon/kabedon980/kabedon980.c delete mode 100644 keyboards/noxary/x268/x268.c delete mode 100644 keyboards/punk75/config.h delete mode 100644 keyboards/punk75/punk75.c delete mode 100644 keyboards/sneakbox/aliceclone/aliceclone.c delete mode 100644 keyboards/yiancardesigns/barleycorn/barleycorn.c diff --git a/keyboards/bear_face/info.json b/keyboards/bear_face/info.json index ad12468d56f..ad5b1dd7d9d 100644 --- a/keyboards/bear_face/info.json +++ b/keyboards/bear_face/info.json @@ -24,6 +24,9 @@ "resync": true } }, + "indicators": { + "caps_lock": "F7" + }, "matrix_pins": { "cols": ["B5", "C7", "C6", "F0", "E6", "B7", "D0", "D1", "D2", "D3", "D5", "D4", "D6", "D7", "B4"], "rows": ["F5", "F6", "F4", "F1", "B0", "B6"] diff --git a/keyboards/bear_face/v1/v1.c b/keyboards/bear_face/v1/v1.c deleted file mode 100644 index b64a63f0b43..00000000000 --- a/keyboards/bear_face/v1/v1.c +++ /dev/null @@ -1,34 +0,0 @@ -/* -Copyright 2020 chemicalwill - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "quantum.h" - -void keyboard_pre_init_kb(void) { - //Sets LED pin as output - gpio_set_pin_output(F7); - - keyboard_pre_init_user(); -} - -bool led_update_kb(led_t led_state) { - // Caps Lock LED indicator toggling code here - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(F7, led_state.caps_lock); - } - return res; -} diff --git a/keyboards/bear_face/v2/v2.c b/keyboards/bear_face/v2/v2.c deleted file mode 100644 index b64a63f0b43..00000000000 --- a/keyboards/bear_face/v2/v2.c +++ /dev/null @@ -1,34 +0,0 @@ -/* -Copyright 2020 chemicalwill - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "quantum.h" - -void keyboard_pre_init_kb(void) { - //Sets LED pin as output - gpio_set_pin_output(F7); - - keyboard_pre_init_user(); -} - -bool led_update_kb(led_t led_state) { - // Caps Lock LED indicator toggling code here - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(F7, led_state.caps_lock); - } - return res; -} diff --git a/keyboards/dztech/bocc/bocc.c b/keyboards/dztech/bocc/bocc.c deleted file mode 100644 index 646a7861f83..00000000000 --- a/keyboards/dztech/bocc/bocc.c +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright 2020 dztech - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "quantum.h" - -void matrix_init_kb(void) { - gpio_set_pin_output(E6); - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(E6, !led_state.caps_lock); - } - return res; -} diff --git a/keyboards/dztech/bocc/keyboard.json b/keyboards/dztech/bocc/keyboard.json index 7e40fde49cb..a6208b2bf7c 100644 --- a/keyboards/dztech/bocc/keyboard.json +++ b/keyboards/dztech/bocc/keyboard.json @@ -33,6 +33,10 @@ "pin": "B7", "levels": 5 }, + "indicators": { + "caps_lock": "E6", + "on_state": 0 + }, "rgblight": { "saturation_steps": 8, "brightness_steps": 8, diff --git a/keyboards/evyd13/gh80_3700/gh80_3700.c b/keyboards/evyd13/gh80_3700/gh80_3700.c index 6d903e48e1c..8c4c81fe643 100644 --- a/keyboards/evyd13/gh80_3700/gh80_3700.c +++ b/keyboards/evyd13/gh80_3700/gh80_3700.c @@ -15,24 +15,16 @@ */ #include "quantum.h" -void led_init_ports(void) { - gpio_set_pin_output(E6); +void keyboard_pre_init_kb(void) { gpio_set_pin_output(B1); gpio_set_pin_output(D0); gpio_set_pin_output(D1); gpio_set_pin_output(F0); - gpio_write_pin_high(E6); gpio_write_pin_high(B1); gpio_write_pin_high(D0); gpio_write_pin_high(D1); gpio_write_pin_high(F0); + + keyboard_pre_init_user(); } - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - gpio_write_pin(E6, !led_state.num_lock); - } - - return true; -} \ No newline at end of file diff --git a/keyboards/evyd13/gh80_3700/keyboard.json b/keyboards/evyd13/gh80_3700/keyboard.json index fa11a482df0..a647f461188 100644 --- a/keyboards/evyd13/gh80_3700/keyboard.json +++ b/keyboards/evyd13/gh80_3700/keyboard.json @@ -23,6 +23,10 @@ "resync": true } }, + "indicators": { + "num_lock": "E6", + "on_state": 0 + }, "matrix_pins": { "cols": ["B0", "D7", "D6", "D4"], "rows": ["B3", "C7", "C6", "B6", "B5", "B4"] diff --git a/keyboards/exclusive/e85/hotswap/hotswap.c b/keyboards/exclusive/e85/hotswap/hotswap.c deleted file mode 100644 index 18ca30b44cd..00000000000 --- a/keyboards/exclusive/e85/hotswap/hotswap.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright 2020 MechMerlin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -void keyboard_pre_init_kb(void) { - gpio_set_pin_output(C7); - gpio_set_pin_output(B5); - - keyboard_pre_init_user(); -} - -bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - gpio_write_pin(C7, led_state.caps_lock); - gpio_write_pin(B5, led_state.scroll_lock); - } - return true; -} diff --git a/keyboards/exclusive/e85/hotswap/keyboard.json b/keyboards/exclusive/e85/hotswap/keyboard.json index 4bd8e738829..7fcd61c8433 100644 --- a/keyboards/exclusive/e85/hotswap/keyboard.json +++ b/keyboards/exclusive/e85/hotswap/keyboard.json @@ -18,6 +18,10 @@ "levels": 6, "breathing": true }, + "indicators": { + "caps_lock": "C7", + "scroll_lock": "B5" + }, "rgblight": { "saturation_steps": 8, "brightness_steps": 8, diff --git a/keyboards/fjlabs/bolsa65/bolsa65.c b/keyboards/fjlabs/bolsa65/bolsa65.c deleted file mode 100644 index 669404192c0..00000000000 --- a/keyboards/fjlabs/bolsa65/bolsa65.c +++ /dev/null @@ -1,28 +0,0 @@ -/* -Copyright 2020 -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#include "quantum.h" - -void matrix_init_kb(void) { - // Initialize indicator LEDs to output - gpio_set_pin_output(F7); // Caps - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(F7, led_state.caps_lock); - } - return res; -} diff --git a/keyboards/fjlabs/bolsa65/keyboard.json b/keyboards/fjlabs/bolsa65/keyboard.json index dfa47e90bb5..63281ae9f6d 100644 --- a/keyboards/fjlabs/bolsa65/keyboard.json +++ b/keyboards/fjlabs/bolsa65/keyboard.json @@ -8,6 +8,9 @@ "pid": "0x0001", "device_version": "0.0.1" }, + "indicators": { + "caps_lock": "F7" + }, "matrix_pins": { "cols": ["C7", "B1", "B2", "B3", "B7", "D0", "D1", "D2", "D3", "D5", "D4", "D6", "D7", "B4", "B5"], "rows": ["F1", "F0", "F6", "F5", "F4"] diff --git a/keyboards/flx/virgo/keyboard.json b/keyboards/flx/virgo/keyboard.json index 8396ce51daa..996425282d7 100644 --- a/keyboards/flx/virgo/keyboard.json +++ b/keyboards/flx/virgo/keyboard.json @@ -30,6 +30,11 @@ "pin": "B7", "levels": 5 }, + "indicators": { + "caps_lock": "E6", + "scroll_lock": "B2", + "on_state": 0 + }, "rgblight": { "saturation_steps": 8, "brightness_steps": 8, diff --git a/keyboards/flx/virgo/virgo.c b/keyboards/flx/virgo/virgo.c deleted file mode 100644 index 2f875531d0f..00000000000 --- a/keyboards/flx/virgo/virgo.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright 2019 MechMerlin - * Edits etc 2020 Flexerm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "quantum.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - gpio_set_pin_output(E6); - gpio_set_pin_output(B2); - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - gpio_write_pin(E6, !led_state.caps_lock); - gpio_write_pin(B2, !led_state.scroll_lock); - } - return true; -} diff --git a/keyboards/handwired/colorlice/colorlice.c b/keyboards/handwired/colorlice/colorlice.c index ede3fba82fb..92914b79bc6 100644 --- a/keyboards/handwired/colorlice/colorlice.c +++ b/keyboards/handwired/colorlice/colorlice.c @@ -51,18 +51,3 @@ void suspend_wakeup_init_kb(void) suspend_wakeup_init_user(); } #endif - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - // gpio_write_pin sets the pin high for 1 and low for 0. - // In this example the pins are inverted, setting - // it low/0 turns it on, and high/1 turns the LED off. - // This behavior depends on whether the LED is between the pin - // and VCC or the pin and GND. - gpio_write_pin(B2, !led_state.num_lock); - gpio_write_pin(C6, !led_state.caps_lock); - gpio_write_pin(B7, !led_state.scroll_lock); - } - return res; -} diff --git a/keyboards/handwired/colorlice/keyboard.json b/keyboards/handwired/colorlice/keyboard.json index 77f5ded0970..4ccc10527c1 100644 --- a/keyboards/handwired/colorlice/keyboard.json +++ b/keyboards/handwired/colorlice/keyboard.json @@ -65,6 +65,12 @@ "build": { "lto": true }, + "indicators": { + "caps_lock": "C6", + "num_lock": "B2", + "scroll_lock": "B7", + "on_state": 0 + }, "features": { "bootmagic": true, "command": false, diff --git a/keyboards/handwired/evk/v1_3/v1_3.c b/keyboards/handwired/evk/v1_3/v1_3.c index a568ba3f866..575bf337591 100644 --- a/keyboards/handwired/evk/v1_3/v1_3.c +++ b/keyboards/handwired/evk/v1_3/v1_3.c @@ -33,12 +33,3 @@ __attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) { gpio_write_pin(D5, layer_state_cmp(state, 1)); return state; } - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if (res) { - // gpio_write_pin sets the pin high for 1 and low for 0. - gpio_write_pin(D4, led_state.caps_lock); - } - return res; -} diff --git a/keyboards/handwired/retro_refit/keyboard.json b/keyboards/handwired/retro_refit/keyboard.json index 1e7812d578f..7acdb48b44d 100644 --- a/keyboards/handwired/retro_refit/keyboard.json +++ b/keyboards/handwired/retro_refit/keyboard.json @@ -23,6 +23,12 @@ "resync": true } }, + "indicators": { + "caps_lock": "D0", + "num_lock": "D1", + "scroll_lock": "C6", + "on_state": 0 + }, "matrix_pins": { "cols": ["B0", "B1", "B2", "B3", "D2", "D3", "C7", "D5"], "rows": ["D4", "D7", "B4", "B5", "B6", "F7", "F6", "F5", "F4", "F1", "F0"] diff --git a/keyboards/handwired/retro_refit/retro_refit.c b/keyboards/handwired/retro_refit/retro_refit.c index b62d94d7418..08e8e1d528e 100644 --- a/keyboards/handwired/retro_refit/retro_refit.c +++ b/keyboards/handwired/retro_refit/retro_refit.c @@ -1,5 +1,4 @@ #include "quantum.h" -#include "led.h" void matrix_init_kb(void) { // put your keyboard start-up code here @@ -11,14 +10,3 @@ void matrix_init_kb(void) { matrix_init_user(); }; - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(D0, !led_state.caps_lock); - gpio_write_pin(D1, !led_state.num_lock); - gpio_write_pin(C6, !led_state.scroll_lock); - - } - return res; -} \ No newline at end of file diff --git a/keyboards/handwired/selene/keyboard.json b/keyboards/handwired/selene/keyboard.json index 592b51aaf40..34eec11664e 100644 --- a/keyboards/handwired/selene/keyboard.json +++ b/keyboards/handwired/selene/keyboard.json @@ -8,6 +8,11 @@ "pid": "0x0001", "device_version": "0.0.1" }, + "indicators": { + "caps_lock": "A2", + "num_lock": "A0", + "scroll_lock": "A1" + }, "rgblight": { "led_count": 50 }, diff --git a/keyboards/handwired/selene/selene.c b/keyboards/handwired/selene/selene.c index b0924c06f49..3d0ef667cf1 100644 --- a/keyboards/handwired/selene/selene.c +++ b/keyboards/handwired/selene/selene.c @@ -15,24 +15,8 @@ */ -#include "selene.h" - -void matrix_init_kb(void){ - gpio_set_pin_output(NUM_LOCK_PIN); - gpio_set_pin_output(CAPS_LOCK_PIN); - gpio_set_pin_output(SCROLL_LOCK_PIN); -} +#include "quantum.h" void keyboard_post_init_user(void) { rgblight_setrgb(0xff, 0xff, 0xff); } - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(NUM_LOCK_PIN, led_state.num_lock); - gpio_write_pin(CAPS_LOCK_PIN, led_state.caps_lock); - gpio_write_pin(SCROLL_LOCK_PIN, led_state.scroll_lock); - } - return res; -} diff --git a/keyboards/handwired/selene/selene.h b/keyboards/handwired/selene/selene.h deleted file mode 100644 index bcd4215e366..00000000000 --- a/keyboards/handwired/selene/selene.h +++ /dev/null @@ -1,23 +0,0 @@ -/* Copyright 2020 Bpendragon - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include "quantum.h" - -#define NUM_LOCK_PIN A0 -#define CAPS_LOCK_PIN A2 -#define SCROLL_LOCK_PIN A1 diff --git a/keyboards/handwired/z150/config.h b/keyboards/handwired/z150/config.h deleted file mode 100644 index 7a054266ea4..00000000000 --- a/keyboards/handwired/z150/config.h +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 2020 DmNosachev - -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 NUM_LOCK_LED_PIN B5 -#define SCROLL_LOCK_LED_PIN B4 -#define CAPS_LOCK_LED_PIN B3 - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT diff --git a/keyboards/handwired/z150/keyboard.json b/keyboards/handwired/z150/keyboard.json index 0658bb52339..38c92a6537d 100644 --- a/keyboards/handwired/z150/keyboard.json +++ b/keyboards/handwired/z150/keyboard.json @@ -16,6 +16,12 @@ "mousekey": true, "nkro": false }, + "indicators": { + "caps_lock": "B3", + "num_lock": "B5", + "scroll_lock": "B4", + "on_state": 0 + }, "matrix_pins": { "cols": ["B11", "B10", "B1", "B0", "A7", "A6", "A5", "A4"], "rows": ["B13", "B14", "B15", "A8", "A9", "A3", "A10", "A1", "A2", "A15", "A0"] diff --git a/keyboards/handwired/z150/z150.c b/keyboards/handwired/z150/z150.c deleted file mode 100644 index ab6709eed75..00000000000 --- a/keyboards/handwired/z150/z150.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright 2020 DmNosachev - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -void matrix_init_kb(void) { - gpio_set_pin_output(NUM_LOCK_LED_PIN); - gpio_set_pin_output(CAPS_LOCK_LED_PIN); - gpio_set_pin_output(SCROLL_LOCK_LED_PIN); - - gpio_write_pin_low(NUM_LOCK_LED_PIN); - gpio_write_pin_low(CAPS_LOCK_LED_PIN); - gpio_write_pin_low(SCROLL_LOCK_LED_PIN); - - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(NUM_LOCK_LED_PIN, !led_state.num_lock); - gpio_write_pin(CAPS_LOCK_LED_PIN, !led_state.caps_lock); - gpio_write_pin(SCROLL_LOCK_LED_PIN, !led_state.scroll_lock); - } - return res; -} diff --git a/keyboards/kabedon/kabedon980/kabedon980.c b/keyboards/kabedon/kabedon980/kabedon980.c deleted file mode 100644 index 7024a2eaa99..00000000000 --- a/keyboards/kabedon/kabedon980/kabedon980.c +++ /dev/null @@ -1,8 +0,0 @@ -#include "quantum.h" - - bool led_update_kb(led_t led_state) { - if (led_update_user(led_state)) { - gpio_write_pin(E6, !led_state.caps_lock); - } - return true; -} diff --git a/keyboards/kabedon/kabedon980/keyboard.json b/keyboards/kabedon/kabedon980/keyboard.json index cf9def2b8fe..b8e100ceac0 100644 --- a/keyboards/kabedon/kabedon980/keyboard.json +++ b/keyboards/kabedon/kabedon980/keyboard.json @@ -8,6 +8,10 @@ "pid": "0x3938", "device_version": "0.0.1" }, + "indicators": { + "caps_lock": "E6", + "on_state": 0 + }, "rgblight": { "saturation_steps": 8, "brightness_steps": 8, diff --git a/keyboards/noxary/x268/keyboard.json b/keyboards/noxary/x268/keyboard.json index f5a991deff5..7ca5799de24 100644 --- a/keyboards/noxary/x268/keyboard.json +++ b/keyboards/noxary/x268/keyboard.json @@ -32,6 +32,9 @@ "backlight": { "pin": "B7" }, + "indicators": { + "caps_lock": "B0" + }, "rgblight": { "hue_steps": 16, "saturation_steps": 16, diff --git a/keyboards/noxary/x268/x268.c b/keyboards/noxary/x268/x268.c deleted file mode 100644 index 67d6dff89df..00000000000 --- a/keyboards/noxary/x268/x268.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright 2020 Rozakiin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "quantum.h" - -// Optional override functions below. -// You can leave any or all of these undefined. -// These are only required if you want to perform custom actions. - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - gpio_set_pin_output(B0); - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) { - if(led_update_user(led_state)) { - gpio_write_pin(B0, led_state.caps_lock); - } - return true; -} diff --git a/keyboards/punk75/config.h b/keyboards/punk75/config.h deleted file mode 100644 index 321865330c7..00000000000 --- a/keyboards/punk75/config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 2020 dsanchezseco - -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 LED A0 diff --git a/keyboards/punk75/keyboard.json b/keyboards/punk75/keyboard.json index dd084a147c4..c7082e564fb 100644 --- a/keyboards/punk75/keyboard.json +++ b/keyboards/punk75/keyboard.json @@ -32,6 +32,10 @@ {"pin_a": "B1", "pin_b": "B0"} ] }, + "indicators": { + "caps_lock": "A0", + "on_state": 0 + }, "processor": "atmega32a", "bootloader": "usbasploader", "community_layouts": ["ortho_5x15"], diff --git a/keyboards/punk75/keymaps/default/keymap.c b/keyboards/punk75/keymaps/default/keymap.c index 9a6ef29307e..57f00e1e615 100644 --- a/keyboards/punk75/keymaps/default/keymap.c +++ b/keyboards/punk75/keymaps/default/keymap.c @@ -74,7 +74,7 @@ void led_keypress_update(pin_t led_pin, uint16_t keycode, keyrecord_t *record) { bool process_record_user(uint16_t keycode, keyrecord_t *record) { // Update LED state - led_keypress_update(LED, keycode, record); + led_keypress_update(LED_CAPS_LOCK_PIN, keycode, record); return true; } diff --git a/keyboards/punk75/keymaps/via/keymap.c b/keyboards/punk75/keymaps/via/keymap.c index 72ef91fd370..214135b55de 100644 --- a/keyboards/punk75/keymaps/via/keymap.c +++ b/keyboards/punk75/keymaps/via/keymap.c @@ -69,7 +69,7 @@ void led_keypress_update(pin_t led_pin, uint16_t keycode, keyrecord_t *record) { bool process_record_user(uint16_t keycode, keyrecord_t *record) { // Update LED state - led_keypress_update(LED, keycode, record); + led_keypress_update(LED_CAPS_LOCK_PIN, keycode, record); return true; } diff --git a/keyboards/punk75/punk75.c b/keyboards/punk75/punk75.c deleted file mode 100644 index 8d9d09d43c4..00000000000 --- a/keyboards/punk75/punk75.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright 2020 dsanchezseco - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -void matrix_init_kb(void) { - // Set our LED pin as output - gpio_set_pin_output(LED); - - matrix_init_user(); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(LED, !led_state.caps_lock); - } - return res; -} diff --git a/keyboards/redscarf_i/keyboard.json b/keyboards/redscarf_i/keyboard.json index 0a268169ef1..6a186dff0bb 100644 --- a/keyboards/redscarf_i/keyboard.json +++ b/keyboards/redscarf_i/keyboard.json @@ -25,6 +25,10 @@ "backlight": { "pin": "B5" }, + "indicators": { + "num_lock": "F7", + "on_state": 0 + }, "processor": "atmega32u4", "bootloader": "atmel-dfu", "community_layouts": ["ortho_5x4", "ortho_6x4", "numpad_5x4", "numpad_6x4"], diff --git a/keyboards/redscarf_i/redscarf_i.c b/keyboards/redscarf_i/redscarf_i.c index 949bc362ad2..7544b89d176 100644 --- a/keyboards/redscarf_i/redscarf_i.c +++ b/keyboards/redscarf_i/redscarf_i.c @@ -18,21 +18,13 @@ void keyboard_pre_init_kb(void) { // initialize top row leds - gpio_set_pin_output(F7); gpio_set_pin_output(F6); gpio_set_pin_output(F5); // and then turn them off - gpio_write_pin_high(F7); gpio_write_pin_high(F6); gpio_write_pin_high(F5); -} -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(F7, !led_state.num_lock); - } - return res; + keyboard_pre_init_user(); } layer_state_t layer_state_set_kb(layer_state_t state) { diff --git a/keyboards/sneakbox/aliceclone/aliceclone.c b/keyboards/sneakbox/aliceclone/aliceclone.c deleted file mode 100644 index 74d19e515c1..00000000000 --- a/keyboards/sneakbox/aliceclone/aliceclone.c +++ /dev/null @@ -1,36 +0,0 @@ -/* -Copyright 2020 Bryan Ong - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "quantum.h" - -void keyboard_pre_init_kb(void) { - gpio_set_pin_output(D7); - gpio_set_pin_output(D6); - gpio_set_pin_output(D4); - - keyboard_pre_init_user(); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - gpio_write_pin(D7, led_state.num_lock); - gpio_write_pin(D6, led_state.caps_lock); - gpio_write_pin(D4, led_state.scroll_lock); - } - return res; -} diff --git a/keyboards/sneakbox/aliceclone/keyboard.json b/keyboards/sneakbox/aliceclone/keyboard.json index 869b8bd20b6..bb0cd8e4b85 100644 --- a/keyboards/sneakbox/aliceclone/keyboard.json +++ b/keyboards/sneakbox/aliceclone/keyboard.json @@ -36,6 +36,11 @@ "bootmagic": { "matrix": [2, 0] }, + "indicators": { + "caps_lock": "D6", + "num_lock": "D7", + "scroll_lock": "D4" + }, "processor": "atmega32u4", "bootloader": "atmel-dfu", "community_layouts": ["alice", "alice_split_bs"], diff --git a/keyboards/yiancardesigns/barleycorn/barleycorn.c b/keyboards/yiancardesigns/barleycorn/barleycorn.c deleted file mode 100644 index c73c1559c20..00000000000 --- a/keyboards/yiancardesigns/barleycorn/barleycorn.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright 2020 Yiancar - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "quantum.h" - -void keyboard_pre_init_kb(void) { - // Set our LED pins as output - gpio_set_pin_output(B5); - gpio_set_pin_output(C0); - keyboard_pre_init_user(); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if(res) { - // gpio_write_pin sets the pin high for 1 and low for 0. - // In this example the pins are inverted, setting - // it low/0 turns it on, and high/1 turns the LED off. - // This behavior depends on whether the LED is between the pin - // and VCC or the pin and GND. - gpio_write_pin(B5, led_state.caps_lock); - gpio_write_pin(C0, led_state.num_lock); - } - return res; -} diff --git a/keyboards/yiancardesigns/barleycorn/keyboard.json b/keyboards/yiancardesigns/barleycorn/keyboard.json index a1676840a55..cf041b96c57 100644 --- a/keyboards/yiancardesigns/barleycorn/keyboard.json +++ b/keyboards/yiancardesigns/barleycorn/keyboard.json @@ -19,6 +19,10 @@ "resync": true } }, + "indicators": { + "caps_lock": "B5", + "num_lock": "C0" + }, "processor": "atmega328p", "bootloader": "usbasploader", "layouts": { From a7aa58cc8130b9c59bc39f41e33d9387a46b1e8c Mon Sep 17 00:00:00 2001 From: Dasky <32983009+daskygit@users.noreply.github.com> Date: Thu, 27 Jun 2024 05:10:13 +0100 Subject: [PATCH 024/204] Change ADNS9800 and PMW33XX SROM uploads to opt in. (#24001) Make SROM upload optional --- drivers/sensors/adns9800.c | 11 +++++++++++ drivers/sensors/pmw33xx_common.c | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/sensors/adns9800.c b/drivers/sensors/adns9800.c index f34529ee90d..0ba26a365ad 100644 --- a/drivers/sensors/adns9800.c +++ b/drivers/sensors/adns9800.c @@ -115,6 +115,7 @@ void adns9800_init(void) { adns9800_read(REG_Delta_Y_L); adns9800_read(REG_Delta_Y_H); +#ifdef ADNS9800_UPLOAD_SROM // upload firmware // 3k firmware mode @@ -145,6 +146,16 @@ void adns9800_init(void) { spi_stop(); wait_ms(10); +#else + // write reset value to REG_Configuration_IV + adns9800_write(REG_Configuration_IV, 0x0); + + // write reset value to REG_SROM_Enable + adns9800_write(REG_SROM_Enable, 0x0); + + // wait a frame + wait_ms(10); +#endif // enable laser uint8_t laser_ctrl0 = adns9800_read(REG_LASER_CTRL0); diff --git a/drivers/sensors/pmw33xx_common.c b/drivers/sensors/pmw33xx_common.c index 82a7ec32973..f1f2d0e8653 100644 --- a/drivers/sensors/pmw33xx_common.c +++ b/drivers/sensors/pmw33xx_common.c @@ -154,10 +154,12 @@ bool pmw33xx_init(uint8_t sensor) { pmw33xx_read(sensor, REG_Delta_Y_L); pmw33xx_read(sensor, REG_Delta_Y_H); +#ifdef PMW33XX_UPLOAD_SROM if (!pmw33xx_upload_firmware(sensor)) { pd_dprintf("PMW33XX (%d): firmware upload failed!\n", sensor); return false; } +#endif spi_stop(); @@ -200,7 +202,7 @@ pmw33xx_report_t pmw33xx_read_burst(uint8_t sensor) { spi_write(REG_Motion_Burst); wait_us(35); // waits for tSRAD_MOTBR - spi_receive((uint8_t*)&report, sizeof(report)); + spi_receive((uint8_t *)&report, sizeof(report)); // panic recovery, sometimes burst mode works weird. if (report.motion.w & 0b111) { From be7728ae581aa59c6a8ba5ef370601edfd9f799a Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sat, 29 Jun 2024 03:36:28 +0100 Subject: [PATCH 025/204] Relocate m256wh VIA logic (#24006) --- keyboards/mode/m256wh/config.h | 2 - keyboards/mode/m256wh/keymaps/via/config.h | 20 +++ keyboards/mode/m256wh/keymaps/via/keymap.c | 132 ++++++++++++++++++ keyboards/mode/m256wh/m256wh.c | 154 --------------------- 4 files changed, 152 insertions(+), 156 deletions(-) create mode 100644 keyboards/mode/m256wh/keymaps/via/config.h delete mode 100644 keyboards/mode/m256wh/m256wh.c diff --git a/keyboards/mode/m256wh/config.h b/keyboards/mode/m256wh/config.h index 06f1658ea52..5bb3d6d1f38 100644 --- a/keyboards/mode/m256wh/config.h +++ b/keyboards/mode/m256wh/config.h @@ -23,5 +23,3 @@ along with this program. If not, see . #define WS2812_PWM_PAL_MODE 1 #define WS2812_PWM_DMA_STREAM STM32_DMA2_STREAM5 #define WS2812_PWM_DMA_CHANNEL 6 - -#define EECONFIG_KB_DATA_SIZE (1) diff --git a/keyboards/mode/m256wh/keymaps/via/config.h b/keyboards/mode/m256wh/keymaps/via/config.h new file mode 100644 index 00000000000..31dfebf49af --- /dev/null +++ b/keyboards/mode/m256wh/keymaps/via/config.h @@ -0,0 +1,20 @@ +/* +Copyright 2022 Gondolindrim + +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 EECONFIG_USER_DATA_SIZE (1) diff --git a/keyboards/mode/m256wh/keymaps/via/keymap.c b/keyboards/mode/m256wh/keymaps/via/keymap.c index a81d6634506..6adb5cfffa4 100644 --- a/keyboards/mode/m256wh/keymaps/via/keymap.c +++ b/keyboards/mode/m256wh/keymaps/via/keymap.c @@ -31,3 +31,135 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ) }; + +bool is_second_rgb_row_active; + +enum via_secondrow_enable { + id_is_second_rgb_row_active = 0 +}; + +// Sets the second RGB row on or off; done by setting effect range. +void set_second_rgb_row(bool is_active) { + rgblight_disable_noeeprom(); + switch (is_active) + { + case true: + { + rgblight_set_effect_range(0,30); + break; + } + case false: + { + rgblight_set_effect_range(0,15); + break; + } + } + rgblight_enable_noeeprom(); +} + +// At the keyboard start, retrieves PMEM stored configs +void keyboard_post_init_user(void) { + rgblight_disable_noeeprom(); + wait_ms(20); + eeconfig_read_user_datablock(&is_second_rgb_row_active); + set_second_rgb_row(is_second_rgb_row_active); + rgblight_reload_from_eeprom(); + rgblight_set(); +} + +void eeconfig_init_user(void) { // EEPROM is getting reset! + // rgblight_disable(); // Enable RGB by default + // Define the defualt value and write it to EEPROM + is_second_rgb_row_active = true; + set_second_rgb_row(is_second_rgb_row_active); + eeconfig_update_user_datablock(&is_second_rgb_row_active); + + // Disable rgblight by default on EEPROM initialization + rgblight_disable(); +} + +void secondrow_config_set_value( uint8_t *data ) +{ + // data = [ value_id, value_data ] + uint8_t *value_id = &(data[0]); + uint8_t *value_data = &(data[1]); + + switch ( *value_id ) + { + case id_is_second_rgb_row_active: + { + is_second_rgb_row_active = (bool) *value_data; + break; + } + default: + { + is_second_rgb_row_active = true; + } + } + set_second_rgb_row(is_second_rgb_row_active); +} + +void secondrow_config_get_value( uint8_t *data ) +{ + // data = [ value_id, value_data ] + uint8_t *value_id = &(data[0]); + uint8_t *value_data = &(data[1]); + + switch ( *value_id ) + { + case id_is_second_rgb_row_active: + { + *value_data = is_second_rgb_row_active; + break; + } + default: + { + *value_data = false; + } + } +} + +void secondrow_config_save(void) +{ + eeconfig_update_user_datablock(&is_second_rgb_row_active); +} + +void via_custom_value_command_kb(uint8_t *data, uint8_t length) { + // data = [ command_id, channel_id, value_id, value_data ] + uint8_t *command_id = &(data[0]); + uint8_t *channel_id = &(data[1]); + uint8_t *value_id_and_data = &(data[2]); + + if ( *channel_id == id_custom_channel ) { + switch ( *command_id ) + { + case id_custom_set_value: + { + secondrow_config_set_value(value_id_and_data); + break; + } + case id_custom_get_value: + { + secondrow_config_get_value(value_id_and_data); + break; + } + case id_custom_save: + { + secondrow_config_save(); + break; + } + default: + { + // Unhandled message. + *command_id = id_unhandled; + break; + } + } + return; + } + + // Return the unhandled state + *command_id = id_unhandled; + + // DO NOT call raw_hid_send(data,length) here, let caller do this +} diff --git a/keyboards/mode/m256wh/m256wh.c b/keyboards/mode/m256wh/m256wh.c deleted file mode 100644 index cec427f329c..00000000000 --- a/keyboards/mode/m256wh/m256wh.c +++ /dev/null @@ -1,154 +0,0 @@ -/* Copyright 2022 Gondolindrim - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -#ifdef VIA_ENABLE -bool is_second_rgb_row_active; -enum via_secondrow_enable { - id_is_second_rgb_row_active = 0 -}; - -// Sets the second RGB row on or off; done by setting effect range. -void set_second_rgb_row(bool is_active) { - rgblight_disable_noeeprom(); - switch (is_active) - { - case true: - { - rgblight_set_effect_range(0,30); - break; - } - case false: - { - rgblight_set_effect_range(0,15); - break; - } - } - rgblight_enable_noeeprom(); -} - -// At the keyboard start, retrieves PMEM stored configs -void keyboard_post_init_kb(void) { - rgblight_disable_noeeprom(); - wait_ms(20); - eeconfig_read_kb_datablock(&is_second_rgb_row_active); - set_second_rgb_row(is_second_rgb_row_active); - rgblight_reload_from_eeprom(); - rgblight_set(); -} - -void eeconfig_init_kb(void) { // EEPROM is getting reset! - // rgblight_disable(); // Enable RGB by default - // Define the defualt value and write it to EEPROM - is_second_rgb_row_active = true; - set_second_rgb_row(is_second_rgb_row_active); - eeconfig_update_kb_datablock(&is_second_rgb_row_active); - - // Disable rgblight by default on EEPROM initialization - rgblight_disable(); - - // Run user code if any - eeconfig_init_user(); -} - -void secondrow_config_set_value( uint8_t *data ) -{ - // data = [ value_id, value_data ] - uint8_t *value_id = &(data[0]); - uint8_t *value_data = &(data[1]); - - switch ( *value_id ) - { - case id_is_second_rgb_row_active: - { - is_second_rgb_row_active = (bool) *value_data; - break; - } - default: - { - is_second_rgb_row_active = true; - } - } - set_second_rgb_row(is_second_rgb_row_active); -} - -void secondrow_config_get_value( uint8_t *data ) -{ - // data = [ value_id, value_data ] - uint8_t *value_id = &(data[0]); - uint8_t *value_data = &(data[1]); - - switch ( *value_id ) - { - case id_is_second_rgb_row_active: - { - *value_data = is_second_rgb_row_active; - break; - } - default: - { - *value_data = false; - } - } -} - -void secondrow_config_save(void) -{ - - eeconfig_update_kb_datablock(&is_second_rgb_row_active); -} - -void via_custom_value_command_kb(uint8_t *data, uint8_t length) { - // data = [ command_id, channel_id, value_id, value_data ] - uint8_t *command_id = &(data[0]); - uint8_t *channel_id = &(data[1]); - uint8_t *value_id_and_data = &(data[2]); - - if ( *channel_id == id_custom_channel ) { - switch ( *command_id ) - { - case id_custom_set_value: - { - secondrow_config_set_value(value_id_and_data); - break; - } - case id_custom_get_value: - { - secondrow_config_get_value(value_id_and_data); - break; - } - case id_custom_save: - { - secondrow_config_save(); - break; - } - default: - { - // Unhandled message. - *command_id = id_unhandled; - break; - } - } - return; - } - - // Return the unhandled state - *command_id = id_unhandled; - - // DO NOT call raw_hid_send(data,length) here, let caller do this -} -#endif From 9ca1f35333e3fef675096c3ba6d149f9164af2e0 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sat, 29 Jun 2024 04:16:52 +0100 Subject: [PATCH 026/204] Relocate winry315 VIA logic (#24008) --- keyboards/winry/winry315/keymaps/via/keymap.c | 5 +++++ keyboards/winry/winry315/winry315.c | 12 ++---------- keyboards/winry/winry315/winry315.h | 14 ++++++-------- 3 files changed, 13 insertions(+), 18 deletions(-) diff --git a/keyboards/winry/winry315/keymaps/via/keymap.c b/keyboards/winry/winry315/keymaps/via/keymap.c index 0641fbfd03e..4585f46fb6c 100644 --- a/keyboards/winry/winry315/keymaps/via/keymap.c +++ b/keyboards/winry/winry315/keymaps/via/keymap.c @@ -37,3 +37,8 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { [2 ... 7] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) } }; #endif + +// The enum values are assumed to match the layout option values used by VIA. +void via_set_layout_options_kb(uint32_t value) { + winry315_set_orientation(value & 0x03); +} diff --git a/keyboards/winry/winry315/winry315.c b/keyboards/winry/winry315/winry315.c index e7901a2e004..03621d3e3fd 100644 --- a/keyboards/winry/winry315/winry315.c +++ b/keyboards/winry/winry315/winry315.c @@ -3,13 +3,11 @@ #include "winry315.h" -#include "via.h" - #if !defined(WINRY315_DEFAULT_ORIENTATION) # define WINRY315_DEFAULT_ORIENTATION WINRY315_ORIENTATION_TOP #endif -#if !defined(VIA_ENABLE) && defined(ENCODER_ENABLE) +#if defined(ENCODER_ENABLE) && !defined(ENCODER_MAP_ENABLE) # ifndef MEDIA_KEY_DELAY # define MEDIA_KEY_DELAY 10 # endif @@ -41,7 +39,7 @@ bool encoder_update_kb(uint8_t index, bool clockwise) { } return true; } -#endif // !defined(VIA_ENABLE) && defined(ENCODER_ENABLE) +#endif // defined(ENCODER_ENABLE) && !defined(ENCODER_MAP_ENABLE) #if defined(RGB_MATRIX_ENABLE) @@ -200,9 +198,3 @@ void winry315_set_orientation(uint8_t orientation) { } #endif // defined(RGB_MATRIX_ENABLE) } - -#if defined(VIA_ENABLE) -void via_set_layout_options_kb(uint32_t value) { - winry315_set_orientation(value & 0x03); -} -#endif // defined(VIA_ENABLE) diff --git a/keyboards/winry/winry315/winry315.h b/keyboards/winry/winry315/winry315.h index 8129c9d6e0f..ea7b4120e24 100644 --- a/keyboards/winry/winry315/winry315.h +++ b/keyboards/winry/winry315/winry315.h @@ -5,8 +5,7 @@ #include "quantum.h" -// Supported orientations of the board. The enum values must match the layout -// option values used by VIA. +// Supported orientations of the board. enum winry315_orientation { WINRY315_ORIENTATION_TOP, // Encoders at the top side (default) WINRY315_ORIENTATION_LEFT, // Encoders at the left side @@ -17,10 +16,9 @@ enum winry315_orientation { // Set the orientation of the board (changes the RGB Matrix effect behavior to // match the new orientation). // -// This function is intended to be used in the `via` keymap, where the board -// orientation is configured dynamically using a VIA layout option. If you are -// making a custom keymap for one specific orientation, it is better to set the -// orientation in config.h (e.g., `#define WINRY315_DEFAULT_ORIENTATION -// WINRY315_ORIENTATION_LEFT`) instead of adding custom code that calls this -// function. +// This function is intended to be used to configure the orientation +// dynamically. If you are making a custom keymap for one specific orientation, +// it is better to set the orientation in config.h +// (e.g., `#define WINRY315_DEFAULT_ORIENTATION WINRY315_ORIENTATION_LEFT`) +// instead of adding custom code that calls this function. void winry315_set_orientation(uint8_t orientation); From 7bc53b8baad73c05d9587eefd3a215c06d4de9a5 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sat, 29 Jun 2024 04:20:08 +0100 Subject: [PATCH 027/204] Relocate m256ws VIA logic (#24009) --- keyboards/mode/m256ws/config.h | 2 - keyboards/mode/m256ws/keymaps/via/config.h | 20 +++ keyboards/mode/m256ws/keymaps/via/keymap.c | 132 ++++++++++++++++++ keyboards/mode/m256ws/m256ws.c | 153 --------------------- 4 files changed, 152 insertions(+), 155 deletions(-) create mode 100644 keyboards/mode/m256ws/keymaps/via/config.h delete mode 100644 keyboards/mode/m256ws/m256ws.c diff --git a/keyboards/mode/m256ws/config.h b/keyboards/mode/m256ws/config.h index 06f1658ea52..5bb3d6d1f38 100644 --- a/keyboards/mode/m256ws/config.h +++ b/keyboards/mode/m256ws/config.h @@ -23,5 +23,3 @@ along with this program. If not, see . #define WS2812_PWM_PAL_MODE 1 #define WS2812_PWM_DMA_STREAM STM32_DMA2_STREAM5 #define WS2812_PWM_DMA_CHANNEL 6 - -#define EECONFIG_KB_DATA_SIZE (1) diff --git a/keyboards/mode/m256ws/keymaps/via/config.h b/keyboards/mode/m256ws/keymaps/via/config.h new file mode 100644 index 00000000000..31dfebf49af --- /dev/null +++ b/keyboards/mode/m256ws/keymaps/via/config.h @@ -0,0 +1,20 @@ +/* +Copyright 2022 Gondolindrim + +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 EECONFIG_USER_DATA_SIZE (1) diff --git a/keyboards/mode/m256ws/keymaps/via/keymap.c b/keyboards/mode/m256ws/keymaps/via/keymap.c index ab77f7af20e..6766852f78d 100644 --- a/keyboards/mode/m256ws/keymaps/via/keymap.c +++ b/keyboards/mode/m256ws/keymaps/via/keymap.c @@ -31,3 +31,135 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, KC_TRNS ) }; + +bool is_second_rgb_row_active; + +enum via_secondrow_enable { + id_is_second_rgb_row_active = 0 +}; + +// Sets the second RGB row on or off; done by setting effect range. +void set_second_rgb_row(bool is_active) { + rgblight_disable_noeeprom(); + switch (is_active) + { + case true: + { + rgblight_set_effect_range(0,30); + break; + } + case false: + { + rgblight_set_effect_range(0,15); + break; + } + } + rgblight_enable_noeeprom(); +} + +// At the keyboard start, retrieves PMEM stored configs +void keyboard_post_init_user(void) { + rgblight_disable_noeeprom(); + wait_ms(20); + eeconfig_read_user_datablock(&is_second_rgb_row_active); + set_second_rgb_row(is_second_rgb_row_active); + rgblight_reload_from_eeprom(); + rgblight_set(); +} + +void eeconfig_init_user(void) { // EEPROM is getting reset! + // rgblight_disable(); // Enable RGB by default + // Define the defualt value and write it to EEPROM + is_second_rgb_row_active = true; + set_second_rgb_row(is_second_rgb_row_active); + eeconfig_update_user_datablock(&is_second_rgb_row_active); + + // Disable rgblight by default on EEPROM initialization + rgblight_disable(); +} + +void secondrow_config_set_value( uint8_t *data ) +{ + // data = [ value_id, value_data ] + uint8_t *value_id = &(data[0]); + uint8_t *value_data = &(data[1]); + + switch ( *value_id ) + { + case id_is_second_rgb_row_active: + { + is_second_rgb_row_active = (bool) *value_data; + break; + } + default: + { + is_second_rgb_row_active = true; + } + } + set_second_rgb_row(is_second_rgb_row_active); +} + +void secondrow_config_get_value( uint8_t *data ) +{ + // data = [ value_id, value_data ] + uint8_t *value_id = &(data[0]); + uint8_t *value_data = &(data[1]); + + switch ( *value_id ) + { + case id_is_second_rgb_row_active: + { + *value_data = is_second_rgb_row_active; + break; + } + default: + { + *value_data = false; + } + } +} + +void secondrow_config_save(void) +{ + eeconfig_update_user_datablock(&is_second_rgb_row_active); +} + +void via_custom_value_command_kb(uint8_t *data, uint8_t length) { + // data = [ command_id, channel_id, value_id, value_data ] + uint8_t *command_id = &(data[0]); + uint8_t *channel_id = &(data[1]); + uint8_t *value_id_and_data = &(data[2]); + + if ( *channel_id == id_custom_channel ) { + switch ( *command_id ) + { + case id_custom_set_value: + { + secondrow_config_set_value(value_id_and_data); + break; + } + case id_custom_get_value: + { + secondrow_config_get_value(value_id_and_data); + break; + } + case id_custom_save: + { + secondrow_config_save(); + break; + } + default: + { + // Unhandled message. + *command_id = id_unhandled; + break; + } + } + return; + } + + // Return the unhandled state + *command_id = id_unhandled; + + // DO NOT call raw_hid_send(data,length) here, let caller do this +} diff --git a/keyboards/mode/m256ws/m256ws.c b/keyboards/mode/m256ws/m256ws.c deleted file mode 100644 index 5603de7b01b..00000000000 --- a/keyboards/mode/m256ws/m256ws.c +++ /dev/null @@ -1,153 +0,0 @@ -/* Copyright 2022 Gondolindrim - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -#ifdef VIA_ENABLE -bool is_second_rgb_row_active; -enum via_secondrow_enable { - id_is_second_rgb_row_active = 0 -}; - -// Sets the second RGB row on or off; done by setting effect range. -void set_second_rgb_row(bool is_active) { - rgblight_disable_noeeprom(); - switch (is_active) - { - case true: - { - rgblight_set_effect_range(0,30); - break; - } - case false: - { - rgblight_set_effect_range(0,15); - break; - } - } - rgblight_enable_noeeprom(); -} - -// At the keyboard start, retrieves PMEM stored configs -void keyboard_post_init_kb(void) { - rgblight_disable_noeeprom(); - wait_ms(20); - eeconfig_read_kb_datablock(&is_second_rgb_row_active); - set_second_rgb_row(is_second_rgb_row_active); - rgblight_reload_from_eeprom(); - rgblight_set(); -} - -void eeconfig_init_kb(void) { // EEPROM is getting reset! - // rgblight_disable(); // Enable RGB by default - // Define the defualt value and write it to EEPROM - is_second_rgb_row_active = true; - set_second_rgb_row(is_second_rgb_row_active); - eeconfig_update_kb_datablock(&is_second_rgb_row_active); - - // Disable rgblight by default on EEPROM initialization - rgblight_disable(); - - // Run user code, if any - eeconfig_init_user(); -} - -void secondrow_config_set_value( uint8_t *data ) -{ - // data = [ value_id, value_data ] - uint8_t *value_id = &(data[0]); - uint8_t *value_data = &(data[1]); - - switch ( *value_id ) - { - case id_is_second_rgb_row_active: - { - is_second_rgb_row_active = (bool) *value_data; - break; - } - default: - { - is_second_rgb_row_active = true; - } - } - set_second_rgb_row(is_second_rgb_row_active); -} - -void secondrow_config_get_value( uint8_t *data ) -{ - // data = [ value_id, value_data ] - uint8_t *value_id = &(data[0]); - uint8_t *value_data = &(data[1]); - - switch ( *value_id ) - { - case id_is_second_rgb_row_active: - { - *value_data = is_second_rgb_row_active; - break; - } - default: - { - *value_data = false; - } - } -} - -void secondrow_config_save(void) -{ - - eeconfig_update_kb_datablock(&is_second_rgb_row_active); -} - -void via_custom_value_command_kb(uint8_t *data, uint8_t length) { - // data = [ command_id, channel_id, value_id, value_data ] - uint8_t *command_id = &(data[0]); - uint8_t *channel_id = &(data[1]); - uint8_t *value_id_and_data = &(data[2]); - - if ( *channel_id == id_custom_channel ) { - switch ( *command_id ) - { - case id_custom_set_value: - { - secondrow_config_set_value(value_id_and_data); - break; - } - case id_custom_get_value: - { - secondrow_config_get_value(value_id_and_data); - break; - } - case id_custom_save: - { - secondrow_config_save(); - break; - } - default: - { - // Unhandled message. - *command_id = id_unhandled; - break; - } - } - return; - } - - // Return the unhandled state - *command_id = id_unhandled; - -} -#endif // VIA ENABLE From af8fe44e0fc3dc461a9fdf85c601c012b5a517eb Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 29 Jun 2024 14:50:08 +1000 Subject: [PATCH 028/204] `atreus`: misc cleanups (#24010) --- keyboards/atreus/astar_mirrored/config.h | 19 --- keyboards/atreus/atreus.h | 51 -------- keyboards/atreus/feather/config.h | 19 --- keyboards/atreus/info.json | 142 +++++++++++++++------- keyboards/atreus/keymaps/default/keymap.c | 6 +- keyboards/atreus/keymaps/via/keymap.c | 8 +- keyboards/atreus/keymaps/workman/config.h | 1 - keyboards/atreus/keymaps/workman/keymap.c | 6 +- keyboards/atreus/promicro/keyboard.json | 3 +- 9 files changed, 110 insertions(+), 145 deletions(-) delete mode 100644 keyboards/atreus/astar_mirrored/config.h delete mode 100644 keyboards/atreus/atreus.h delete mode 100644 keyboards/atreus/feather/config.h diff --git a/keyboards/atreus/astar_mirrored/config.h b/keyboards/atreus/astar_mirrored/config.h deleted file mode 100644 index 3bd163dec35..00000000000 --- a/keyboards/atreus/astar_mirrored/config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* Copyright 2019 - * - * 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 PCBDOWN 1 diff --git a/keyboards/atreus/atreus.h b/keyboards/atreus/atreus.h deleted file mode 100644 index 2a966b86414..00000000000 --- a/keyboards/atreus/atreus.h +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright 2019 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#include "quantum.h" -#define ___ KC_NO - -// This a shortcut to help you visually see your layout. -// The first section contains all of the arguments. -// The second converts the arguments into a two-dimensional array. -// In the PCBDOWN case we need to swap the middle two keys: k35 and k36. -#if defined(PCBDOWN) -#define LAYOUT( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ -) \ -{ \ - { k00, k01, k02, k03, k04, KC_NO, k05, k06, k07, k08, k09 }, \ - { k10, k11, k12, k13, k14, KC_NO, k15, k16, k17, k18, k19 }, \ - { k20, k21, k22, k23, k24, k36, k25, k26, k27, k28, k29 }, \ - { k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b } \ -} -#else -#define LAYOUT( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ -) \ -{ \ - { k00, k01, k02, k03, k04, ___, k05, k06, k07, k08, k09 }, \ - { k10, k11, k12, k13, k14, ___, k15, k16, k17, k18, k19 }, \ - { k20, k21, k22, k23, k24, k35, k25, k26, k27, k28, k29 }, \ - { k30, k31, k32, k33, k34, k36, k37, k38, k39, k3a, k3b } \ -} -#endif diff --git a/keyboards/atreus/feather/config.h b/keyboards/atreus/feather/config.h deleted file mode 100644 index 505296a5056..00000000000 --- a/keyboards/atreus/feather/config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* Copyright 2019 - * - * 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 OUTPUT_AUTO_ENABLE diff --git a/keyboards/atreus/info.json b/keyboards/atreus/info.json index a0f592105f1..1a33591ab56 100644 --- a/keyboards/atreus/info.json +++ b/keyboards/atreus/info.json @@ -23,58 +23,114 @@ "resync": true } }, + "layout_aliases": { + "LAYOUT": "LAYOUT_pcb_up" + }, "layouts": { - "LAYOUT": { + "LAYOUT_pcb_up": { "layout": [ - {"x": 0, "y": 0.6}, - {"x": 1, "y": 0.35}, - {"x": 2, "y": 0}, - {"x": 3, "y": 0.35}, - {"x": 4, "y": 0.7}, + {"matrix": [0, 0], "x": 0, "y": 0.6}, + {"matrix": [0, 1], "x": 1, "y": 0.35}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0.35}, + {"matrix": [0, 4], "x": 4, "y": 0.7}, - {"x": 8, "y": 0.7}, - {"x": 9, "y": 0.35}, - {"x": 10, "y": 0}, - {"x": 11, "y": 0.35}, - {"x": 12, "y": 0.6}, + {"matrix": [0, 6], "x": 8, "y": 0.7}, + {"matrix": [0, 7], "x": 9, "y": 0.35}, + {"matrix": [0, 8], "x": 10, "y": 0}, + {"matrix": [0, 9], "x": 11, "y": 0.35}, + {"matrix": [0, 10], "x": 12, "y": 0.6}, - {"x": 0, "y": 1.6}, - {"x": 1, "y": 1.35}, - {"x": 2, "y": 1}, - {"x": 3, "y": 1.35}, - {"x": 4, "y": 1.7}, + {"matrix": [1, 0], "x": 0, "y": 1.6}, + {"matrix": [1, 1], "x": 1, "y": 1.35}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1.35}, + {"matrix": [1, 4], "x": 4, "y": 1.7}, - {"x": 8, "y": 1.7}, - {"x": 9, "y": 1.35}, - {"x": 10, "y": 1}, - {"x": 11, "y": 1.35}, - {"x": 12, "y": 1.6}, + {"matrix": [1, 6], "x": 8, "y": 1.7}, + {"matrix": [1, 7], "x": 9, "y": 1.35}, + {"matrix": [1, 8], "x": 10, "y": 1}, + {"matrix": [1, 9], "x": 11, "y": 1.35}, + {"matrix": [1, 10], "x": 12, "y": 1.6}, - {"x": 0, "y": 2.6}, - {"x": 1, "y": 2.35}, - {"x": 2, "y": 2}, - {"x": 3, "y": 2.35}, - {"x": 4, "y": 2.7}, + {"matrix": [2, 0], "x": 0, "y": 2.6}, + {"matrix": [2, 1], "x": 1, "y": 2.35}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2.35}, + {"matrix": [2, 4], "x": 4, "y": 2.7}, - {"x": 8, "y": 2.7}, - {"x": 9, "y": 2.35}, - {"x": 10, "y": 2}, - {"x": 11, "y": 2.35}, - {"x": 12, "y": 2.6}, + {"matrix": [2, 6], "x": 8, "y": 2.7}, + {"matrix": [2, 7], "x": 9, "y": 2.35}, + {"matrix": [2, 8], "x": 10, "y": 2}, + {"matrix": [2, 9], "x": 11, "y": 2.35}, + {"matrix": [2, 10], "x": 12, "y": 2.6}, - {"x": 0, "y": 3.6}, - {"x": 1, "y": 3.35}, - {"x": 2, "y": 3}, - {"x": 3, "y": 3.35}, - {"x": 4, "y": 3.7}, - {"x": 5, "y": 2.95, "h": 1.5}, + {"matrix": [3, 0], "x": 0, "y": 3.6}, + {"matrix": [3, 1], "x": 1, "y": 3.35}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [3, 3], "x": 3, "y": 3.35}, + {"matrix": [3, 4], "x": 4, "y": 3.7}, + {"matrix": [2, 5], "x": 5, "y": 2.95, "h": 1.5}, - {"x": 7, "y": 2.95, "h": 1.5}, - {"x": 8, "y": 3.7}, - {"x": 9, "y": 3.35}, - {"x": 10, "y": 3}, - {"x": 11, "y": 3.35}, - {"x": 12, "y": 3.6} + {"matrix": [3, 5], "x": 7, "y": 2.95, "h": 1.5}, + {"matrix": [3, 6], "x": 8, "y": 3.7}, + {"matrix": [3, 7], "x": 9, "y": 3.35}, + {"matrix": [3, 8], "x": 10, "y": 3}, + {"matrix": [3, 9], "x": 11, "y": 3.35}, + {"matrix": [3, 10], "x": 12, "y": 3.6} + ] + }, + "LAYOUT_pcb_down": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0.6}, + {"matrix": [0, 1], "x": 1, "y": 0.35}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0.35}, + {"matrix": [0, 4], "x": 4, "y": 0.7}, + + {"matrix": [0, 6], "x": 8, "y": 0.7}, + {"matrix": [0, 7], "x": 9, "y": 0.35}, + {"matrix": [0, 8], "x": 10, "y": 0}, + {"matrix": [0, 9], "x": 11, "y": 0.35}, + {"matrix": [0, 10], "x": 12, "y": 0.6}, + + {"matrix": [1, 0], "x": 0, "y": 1.6}, + {"matrix": [1, 1], "x": 1, "y": 1.35}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1.35}, + {"matrix": [1, 4], "x": 4, "y": 1.7}, + + {"matrix": [1, 6], "x": 8, "y": 1.7}, + {"matrix": [1, 7], "x": 9, "y": 1.35}, + {"matrix": [1, 8], "x": 10, "y": 1}, + {"matrix": [1, 9], "x": 11, "y": 1.35}, + {"matrix": [1, 10], "x": 12, "y": 1.6}, + + {"matrix": [2, 0], "x": 0, "y": 2.6}, + {"matrix": [2, 1], "x": 1, "y": 2.35}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2.35}, + {"matrix": [2, 4], "x": 4, "y": 2.7}, + + {"matrix": [2, 6], "x": 8, "y": 2.7}, + {"matrix": [2, 7], "x": 9, "y": 2.35}, + {"matrix": [2, 8], "x": 10, "y": 2}, + {"matrix": [2, 9], "x": 11, "y": 2.35}, + {"matrix": [2, 10], "x": 12, "y": 2.6}, + + {"matrix": [3, 0], "x": 0, "y": 3.6}, + {"matrix": [3, 1], "x": 1, "y": 3.35}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [3, 3], "x": 3, "y": 3.35}, + {"matrix": [3, 4], "x": 4, "y": 3.7}, + {"matrix": [3, 5], "x": 5, "y": 2.95, "h": 1.5}, + + {"matrix": [2, 5], "x": 7, "y": 2.95, "h": 1.5}, + {"matrix": [3, 6], "x": 8, "y": 3.7}, + {"matrix": [3, 7], "x": 9, "y": 3.35}, + {"matrix": [3, 8], "x": 10, "y": 3}, + {"matrix": [3, 9], "x": 11, "y": 3.35}, + {"matrix": [3, 10], "x": 12, "y": 3.6} ] } } diff --git a/keyboards/atreus/keymaps/default/keymap.c b/keyboards/atreus/keymaps/default/keymap.c index ca1333230c9..e4588105372 100644 --- a/keyboards/atreus/keymaps/default/keymap.c +++ b/keyboards/atreus/keymaps/default/keymap.c @@ -12,7 +12,7 @@ #define _LW 2 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QW] = LAYOUT( /* Qwerty */ + [_QW] = LAYOUT_pcb_up( /* Qwerty */ KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P , KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH , @@ -25,7 +25,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * [ ] ( ) & || ` 1 2 3 \ * lower insert super shift bksp ctrl || alt space fn . 0 = */ - [_RS] = LAYOUT( /* [> RAISE <] */ + [_RS] = LAYOUT_pcb_up( /* [> RAISE <] */ KC_EXLM, KC_AT, KC_UP, KC_LCBR, KC_RCBR, KC_PGUP, KC_7, KC_8, KC_9, KC_ASTR , KC_HASH, KC_LEFT, KC_DOWN, KC_RGHT, KC_DLR, KC_PGDN, KC_4, KC_5, KC_6, KC_PLUS , KC_LBRC, KC_RBRC, KC_LPRN, KC_RPRN, KC_AMPR, KC_GRV, KC_1, KC_2, KC_3, KC_BSLS , @@ -36,7 +36,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * volup reset || F1 F2 F3 F12 * voldn super shift bksp ctrl || alt space L0 prtsc scroll pause */ - [_LW] = LAYOUT( /* [> LOWER <] */ + [_LW] = LAYOUT_pcb_up( /* [> LOWER <] */ KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_UP, KC_F7, KC_F8, KC_F9, KC_F10 , KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_DOWN, KC_F4, KC_F5, KC_F6, KC_F11 , KC_NO, KC_VOLU, KC_NO, KC_NO, QK_BOOT, KC_NO, KC_F1, KC_F2, KC_F3, KC_F12 , diff --git a/keyboards/atreus/keymaps/via/keymap.c b/keyboards/atreus/keymaps/via/keymap.c index 52740c5bad9..e6093d7ac10 100644 --- a/keyboards/atreus/keymaps/via/keymap.c +++ b/keyboards/atreus/keymaps/via/keymap.c @@ -27,7 +27,7 @@ enum custom_layers { }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QW] = LAYOUT( /* Qwerty */ + [_QW] = LAYOUT_pcb_up( /* Qwerty */ KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P , KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH , @@ -40,7 +40,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * [ ] ( ) & || ` 1 2 3 \ * lower insert super shift bksp ctrl || alt space fn . 0 = */ - [_RS] = LAYOUT( /* [> RAISE <] */ + [_RS] = LAYOUT_pcb_up( /* [> RAISE <] */ KC_EXLM, KC_AT, KC_UP, KC_LCBR, KC_RCBR, KC_PGUP, KC_7, KC_8, KC_9, KC_ASTR , KC_HASH, KC_LEFT, KC_DOWN, KC_RGHT, KC_DLR, KC_PGDN, KC_4, KC_5, KC_6, KC_PLUS , KC_LBRC, KC_RBRC, KC_LPRN, KC_RPRN, KC_AMPR, KC_GRV, KC_1, KC_2, KC_3, KC_BSLS , @@ -51,13 +51,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * volup reset || F1 F2 F3 F12 * voldn super shift bksp ctrl || alt space L0 prtsc scroll pause */ - [_LW] = LAYOUT( /* [> LOWER <] */ + [_LW] = LAYOUT_pcb_up( /* [> LOWER <] */ KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_UP, KC_F7, KC_F8, KC_F9, KC_F10 , KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_DOWN, KC_F4, KC_F5, KC_F6, KC_F11 , KC_NO, KC_VOLU, KC_NO, KC_NO, QK_BOOT, KC_NO, KC_F1, KC_F2, KC_F3, KC_F12 , KC_NO, KC_VOLD, KC_LGUI, KC_LSFT, KC_BSPC, KC_LCTL, KC_LALT, KC_SPC, TO(_QW), KC_PSCR, KC_SCRL, KC_PAUS ), - [_EM] = LAYOUT( /* [> EMPTY <] */ + [_EM] = LAYOUT_pcb_up( /* [> EMPTY <] */ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS , diff --git a/keyboards/atreus/keymaps/workman/config.h b/keyboards/atreus/keymaps/workman/config.h index cf0b5e2ac51..f75e442456b 100644 --- a/keyboards/atreus/keymaps/workman/config.h +++ b/keyboards/atreus/keymaps/workman/config.h @@ -1,3 +1,2 @@ #define TAPPING_TOGGLE 1 #define ONESHOT_TAP_TOGGLE 1 -#define PCBDOWN 1 diff --git a/keyboards/atreus/keymaps/workman/keymap.c b/keyboards/atreus/keymaps/workman/keymap.c index c0633f6362b..e8b5b6b4e36 100644 --- a/keyboards/atreus/keymaps/workman/keymap.c +++ b/keyboards/atreus/keymaps/workman/keymap.c @@ -25,7 +25,7 @@ enum custom_keycodes { */ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QW] = LAYOUT( /* Workman */ + [_QW] = LAYOUT_pcb_down( /* Workman */ KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, @@ -39,7 +39,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * menu caps < > del || _ 0 = */ - [_RS] = LAYOUT( /* [> RAISE <] */ + [_RS] = LAYOUT_pcb_down( /* [> RAISE <] */ KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_MINS, KC_7, KC_8, KC_9, KC_ASTR, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, KC_DOT, KC_4, KC_5, KC_6, KC_PLUS, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, @@ -52,7 +52,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * || – ¨ reset */ - [_LW] = LAYOUT( /* [> LOWER <] */ + [_LW] = LAYOUT_pcb_down( /* [> LOWER <] */ KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_VOLU, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_VOLD, KC_F4, KC_F5, KC_F6, KC_F11, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_F1, KC_F2, KC_F3, KC_F12, diff --git a/keyboards/atreus/promicro/keyboard.json b/keyboards/atreus/promicro/keyboard.json index e614b4e2a0a..10c0ca1b22a 100644 --- a/keyboards/atreus/promicro/keyboard.json +++ b/keyboards/atreus/promicro/keyboard.json @@ -4,6 +4,5 @@ "rows": ["F4", "B2", "B4", "B5"] }, "diode_direction": "COL2ROW", - "processor": "atmega32u4", - "bootloader": "caterina" + "development_board": "promicro" } From 07253bfe4aa2e7a59c6dd88a0d0db951ac0c7add Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sat, 29 Jun 2024 09:33:20 +0100 Subject: [PATCH 029/204] Relocate work_louder VIA logic (#24011) --- keyboards/work_louder/rgb_functions.h | 82 ++++++------------- keyboards/work_louder/work_board/config.h | 2 - .../work_board/keymaps/via/config.h | 4 + .../work_board/keymaps/via/keymap.c | 18 ++++ keyboards/work_louder/work_board/work_board.c | 15 ---- 5 files changed, 48 insertions(+), 73 deletions(-) diff --git a/keyboards/work_louder/rgb_functions.h b/keyboards/work_louder/rgb_functions.h index eaef787a222..20c99021fb0 100644 --- a/keyboards/work_louder/rgb_functions.h +++ b/keyboards/work_louder/rgb_functions.h @@ -18,62 +18,32 @@ #include "keycodes.h" -#ifndef VIA_ENABLE -# ifndef RGB_MATRIX_TOGGLE -# define RGB_MATRIX_TOGGLE KC_F15 -# endif -# ifndef RGB_MATRIX_MODE_INC -# define RGB_MATRIX_MODE_INC KC_F16 -# endif -# ifndef RGB_MATRIX_MODE_DEC -# define RGB_MATRIX_MODE_DEC KC_F17 -# endif -# ifndef RGB_MATRIX_HUE_INC -# define RGB_MATRIX_HUE_INC KC_F18 -# endif -# ifndef RGB_MATRIX_HUE_DEC -# define RGB_MATRIX_HUE_DEC KC_F19 -# endif -# ifndef RGB_MATRIX_SAT_INC -# define RGB_MATRIX_SAT_INC KC_F20 -# endif -# ifndef RGB_MATRIX_SAT_DEC -# define RGB_MATRIX_SAT_DEC KC_F21 -# endif -# ifndef RGB_MATRIX_VAL_INC -# define RGB_MATRIX_VAL_INC KC_F22 -# endif -# ifndef RGB_MATRIX_VAL_DEC -# define RGB_MATRIX_VAL_DEC KC_F23 -# endif -#else -# ifndef RGB_MATRIX_TOGGLE -# define RGB_MATRIX_TOGGLE QK_KB_0 -# endif -# ifndef RGB_MATRIX_MODE_INC -# define RGB_MATRIX_MODE_INC QK_KB_1 -# endif -# ifndef RGB_MATRIX_MODE_DEC -# define RGB_MATRIX_MODE_DEC QK_KB_2 -# endif -# ifndef RGB_MATRIX_HUE_INC -# define RGB_MATRIX_HUE_INC QK_KB_3 -# endif -# ifndef RGB_MATRIX_HUE_DEC -# define RGB_MATRIX_HUE_DEC QK_KB_4 -# endif -# ifndef RGB_MATRIX_SAT_INC -# define RGB_MATRIX_SAT_INC QK_KB_5 -# endif -# ifndef RGB_MATRIX_SAT_DEC -# define RGB_MATRIX_SAT_DEC QK_KB_6 -# endif -# ifndef RGB_MATRIX_VAL_INC -# define RGB_MATRIX_VAL_INC QK_KB_7 -# endif -# ifndef RGB_MATRIX_VAL_DEC -# define RGB_MATRIX_VAL_DEC QK_KB_8 -# endif +#ifndef RGB_MATRIX_TOGGLE +# define RGB_MATRIX_TOGGLE QK_KB_0 +#endif +#ifndef RGB_MATRIX_MODE_INC +# define RGB_MATRIX_MODE_INC QK_KB_1 +#endif +#ifndef RGB_MATRIX_MODE_DEC +# define RGB_MATRIX_MODE_DEC QK_KB_2 +#endif +#ifndef RGB_MATRIX_HUE_INC +# define RGB_MATRIX_HUE_INC QK_KB_3 +#endif +#ifndef RGB_MATRIX_HUE_DEC +# define RGB_MATRIX_HUE_DEC QK_KB_4 +#endif +#ifndef RGB_MATRIX_SAT_INC +# define RGB_MATRIX_SAT_INC QK_KB_5 +#endif +#ifndef RGB_MATRIX_SAT_DEC +# define RGB_MATRIX_SAT_DEC QK_KB_6 +#endif +#ifndef RGB_MATRIX_VAL_INC +# define RGB_MATRIX_VAL_INC QK_KB_7 +#endif +#ifndef RGB_MATRIX_VAL_DEC +# define RGB_MATRIX_VAL_DEC QK_KB_8 #endif #define R_M_TOG RGB_MATRIX_TOGGLE diff --git a/keyboards/work_louder/work_board/config.h b/keyboards/work_louder/work_board/config.h index 2514a63ddec..36dadf6d4e0 100644 --- a/keyboards/work_louder/work_board/config.h +++ b/keyboards/work_louder/work_board/config.h @@ -23,5 +23,3 @@ along with this program. If not, see . #define RGB_MATRIX_LED_COUNT 49 #define RGB_MATRIX_DISABLE_KEYCODES - -#define VIA_EEPROM_LAYOUT_OPTIONS_DEFAULT 0x1 diff --git a/keyboards/work_louder/work_board/keymaps/via/config.h b/keyboards/work_louder/work_board/keymaps/via/config.h index 7aa3bebe9b8..716aac11aaf 100644 --- a/keyboards/work_louder/work_board/keymaps/via/config.h +++ b/keyboards/work_louder/work_board/keymaps/via/config.h @@ -1,6 +1,10 @@ // Copyright 2023 QMK // SPDX-License-Identifier: GPL-2.0-or-later #pragma once + #define NO_ACTION_ONESHOT + #undef ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS #undef ENABLE_RGB_MATRIX_PIXEL_FRACTAL + +#define VIA_EEPROM_LAYOUT_OPTIONS_DEFAULT 0x1 diff --git a/keyboards/work_louder/work_board/keymaps/via/keymap.c b/keyboards/work_louder/work_board/keymaps/via/keymap.c index 255ee3ed789..9ba3dcda4c2 100644 --- a/keyboards/work_louder/work_board/keymaps/via/keymap.c +++ b/keyboards/work_louder/work_board/keymaps/via/keymap.c @@ -214,3 +214,21 @@ void via_custom_value_command_kb(uint8_t *data, uint8_t length) { } *command_id = id_unhandled; } + +bool via_layout_2u = false; + +void via_set_layout_options_kb(uint32_t value) { + via_layout_2u = (bool)value; +} + +#ifdef RGB_MATRIX_ENABLE +bool rgb_matrix_indicators_user(void) { + if (via_layout_2u) { + rgb_matrix_set_color(5, 0, 0, 0); + rgb_matrix_set_color(7, 0, 0, 0); + } else { + rgb_matrix_set_color(6, 0, 0, 0); + } + return false; +} +#endif diff --git a/keyboards/work_louder/work_board/work_board.c b/keyboards/work_louder/work_board/work_board.c index ef36b3171f2..b34f31df5cf 100644 --- a/keyboards/work_louder/work_board/work_board.c +++ b/keyboards/work_louder/work_board/work_board.c @@ -67,27 +67,12 @@ bool oled_task_kb(void) { #endif #ifdef RGB_MATRIX_ENABLE -# ifdef VIA_ENABLE -bool via_layout_2u = false; - -void via_set_layout_options_kb(uint32_t value) { via_layout_2u = (bool)value; } -# endif // VIA_ENABLE - bool rgb_matrix_indicators_kb(void) { if (!rgb_matrix_indicators_user()) { return false; } -# ifdef VIA_ENABLE - if (via_layout_2u) { - rgb_matrix_set_color(5, 0, 0, 0); - rgb_matrix_set_color(7, 0, 0, 0); - } else { - rgb_matrix_set_color(6, 0, 0, 0); - } -# else rgb_matrix_set_color(5, 0, 0, 0); rgb_matrix_set_color(7, 0, 0, 0); -# endif return true; } From 38f72c5d2bbae3be5a1d39284c1579616b097b75 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sat, 29 Jun 2024 10:17:47 +0100 Subject: [PATCH 030/204] Relocate xelus/pachi/rgb/rev2 VIA logic (#24016) --- .../pachi/rgb/{ => rev1}/keymaps/via/config.h | 0 .../pachi/rgb/{ => rev1}/keymaps/via/keymap.c | 0 .../pachi/rgb/{ => rev1}/keymaps/via/rules.mk | 0 keyboards/xelus/pachi/rgb/rev2/config.h | 4 - .../xelus/pachi/rgb/rev2/keymaps/via/config.h | 20 + .../xelus/pachi/rgb/rev2/keymaps/via/keymap.c | 399 ++++++++++++++++++ .../xelus/pachi/rgb/rev2/keymaps/via/rules.mk | 1 + keyboards/xelus/pachi/rgb/rev2/rev2.c | 309 +------------- keyboards/xelus/pachi/rgb/rev2/rev2.h | 72 ---- 9 files changed, 421 insertions(+), 384 deletions(-) rename keyboards/xelus/pachi/rgb/{ => rev1}/keymaps/via/config.h (100%) rename keyboards/xelus/pachi/rgb/{ => rev1}/keymaps/via/keymap.c (100%) rename keyboards/xelus/pachi/rgb/{ => rev1}/keymaps/via/rules.mk (100%) create mode 100644 keyboards/xelus/pachi/rgb/rev2/keymaps/via/config.h create mode 100644 keyboards/xelus/pachi/rgb/rev2/keymaps/via/keymap.c create mode 100644 keyboards/xelus/pachi/rgb/rev2/keymaps/via/rules.mk delete mode 100644 keyboards/xelus/pachi/rgb/rev2/rev2.h diff --git a/keyboards/xelus/pachi/rgb/keymaps/via/config.h b/keyboards/xelus/pachi/rgb/rev1/keymaps/via/config.h similarity index 100% rename from keyboards/xelus/pachi/rgb/keymaps/via/config.h rename to keyboards/xelus/pachi/rgb/rev1/keymaps/via/config.h diff --git a/keyboards/xelus/pachi/rgb/keymaps/via/keymap.c b/keyboards/xelus/pachi/rgb/rev1/keymaps/via/keymap.c similarity index 100% rename from keyboards/xelus/pachi/rgb/keymaps/via/keymap.c rename to keyboards/xelus/pachi/rgb/rev1/keymaps/via/keymap.c diff --git a/keyboards/xelus/pachi/rgb/keymaps/via/rules.mk b/keyboards/xelus/pachi/rgb/rev1/keymaps/via/rules.mk similarity index 100% rename from keyboards/xelus/pachi/rgb/keymaps/via/rules.mk rename to keyboards/xelus/pachi/rgb/rev1/keymaps/via/rules.mk diff --git a/keyboards/xelus/pachi/rgb/rev2/config.h b/keyboards/xelus/pachi/rgb/rev2/config.h index a5fc38e0708..fcf4c41d8a7 100644 --- a/keyboards/xelus/pachi/rgb/rev2/config.h +++ b/keyboards/xelus/pachi/rgb/rev2/config.h @@ -33,7 +33,3 @@ // RGB Matrix defines #define IS31FL3741_I2C_ADDRESS_1 IS31FL3741_I2C_ADDRESS_GND #define IS31FL3741_LED_COUNT RGB_MATRIX_LED_COUNT // is31fl3741.h does not set this for custom driver - -// VIA KB level -#define VIA_FIRMWARE_VERSION 1 -#define VIA_EEPROM_CUSTOM_CONFIG_SIZE 17 diff --git a/keyboards/xelus/pachi/rgb/rev2/keymaps/via/config.h b/keyboards/xelus/pachi/rgb/rev2/keymaps/via/config.h new file mode 100644 index 00000000000..abdd8c320c3 --- /dev/null +++ b/keyboards/xelus/pachi/rgb/rev2/keymaps/via/config.h @@ -0,0 +1,20 @@ +/* Copyright 2021 Harrison Chan (Xelus) + * + * 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 VIA_FIRMWARE_VERSION 1 +#define VIA_EEPROM_CUSTOM_CONFIG_SIZE 17 diff --git a/keyboards/xelus/pachi/rgb/rev2/keymaps/via/keymap.c b/keyboards/xelus/pachi/rgb/rev2/keymaps/via/keymap.c new file mode 100644 index 00000000000..f739dc4b6ab --- /dev/null +++ b/keyboards/xelus/pachi/rgb/rev2/keymaps/via/keymap.c @@ -0,0 +1,399 @@ +/* Copyright 2021 Harrison Chan (Xelus) + * + * 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 "eeprom.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_tkl_ansi_tsangan( + 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_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, + MO(1), 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, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [1] = LAYOUT_tkl_ansi_tsangan( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, QK_BOOT , KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [2] = LAYOUT_tkl_ansi_tsangan( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; + +// custom ID codes +enum via_indicator_value { + id_caps_lock_enable = 1, + id_caps_lock_brightness, + id_caps_lock_color, + id_caps_lock_key, + id_caps_lock_override, + id_num_lock_enable, + id_num_lock_brightness, + id_num_lock_color, + id_num_lock_key, + id_num_lock_override, + id_scroll_lock_enable, + id_scroll_lock_brightness, + id_scroll_lock_color, + id_scroll_lock_key, + id_scroll_lock_override, + id_layer_indicator_enable, + id_layer_indicator_brightness, + id_layer_indicator_color, + id_layer_indicator_key, + id_layer_indicator_override +}; + +// struct to save things +typedef struct { + bool enable_caps_lock:1; // | + bool enable_num_lock:1; // | + bool enable_scroll_lock:1; // | + bool enable_layer_indicator:1; // | + bool caps_override_bl:1; // | + bool num_override_bl:1; // | + bool scroll_override_bl:1; // | + bool layer_override_bl:1; // 1 byte + HSV caps_lock_indicator; // 3 bytes + HSV num_lock_indicator; // 3 bytes + HSV scroll_lock_indicator; // 3 bytes + HSV layer_indicator; // 3 bytes + uint8_t caps_lock_key; // 1 byte + uint8_t num_lock_key; // 1 byte + uint8_t scroll_lock_key; // 1 byte + uint8_t layer_indicator_key;// 1 byte +} indicator_settings_config; +// total 17 bytes + +indicator_settings_config g_config = { + .caps_lock_indicator = {0, 0, 128}, + .num_lock_indicator = {60, 0, 128}, + .scroll_lock_indicator = {120, 0, 128}, + .layer_indicator = {180, 0, 128}, + .caps_lock_key = 7, + .num_lock_key = 0, + .scroll_lock_key = 78, + .layer_indicator_key = 0, + .enable_caps_lock = true, + .enable_num_lock = false, + .enable_scroll_lock = true, + .enable_layer_indicator = false, + .caps_override_bl = true, + .num_override_bl = true, + .scroll_override_bl = true, + .layer_override_bl = true +}; + + +// function declaration +void indicator_config_set_value( uint8_t *data ); +void indicator_config_get_value( uint8_t *data ); +void indicator_config_save ( void ); +void _set_color(HSV *color, uint8_t *data); +void _get_color(HSV *color, uint8_t *data); + +void values_load(void) +{ + eeprom_read_block( &g_config, ((void*)VIA_EEPROM_CUSTOM_CONFIG_ADDR), sizeof(g_config) ); +} + +void values_save(void) +{ + eeprom_update_block( &g_config, ((void*)VIA_EEPROM_CUSTOM_CONFIG_ADDR), sizeof(g_config) ); +} + +void via_init_kb(void) +{ + // If the EEPROM has the magic, the data is good. + // OK to load from EEPROM + if (via_eeprom_is_valid()) { + values_load(); + } else { + values_save(); + // DO NOT set EEPROM valid here, let caller do this + } +} + +void via_custom_value_command_kb(uint8_t *data, uint8_t length) { + // data = [ command_id, channel_id, value_id, value_data ] + uint8_t *command_id = &(data[0]); + uint8_t *channel_id = &(data[1]); + uint8_t *value_id_and_data = &(data[2]); + + if ( *channel_id == id_custom_channel ) { + switch ( *command_id ) + { + case id_custom_set_value: + { + indicator_config_set_value(value_id_and_data); + break; + } + case id_custom_get_value: + { + indicator_config_get_value(value_id_and_data); + break; + } + case id_custom_save: + { + values_save(); + break; + } + default: + { + // Unhandled message. + *command_id = id_unhandled; + break; + } + } + return; + } + + // Return the unhandled state + *command_id = id_unhandled; + + // DO NOT call raw_hid_send(data,length) here, let caller do this +} + +void indicator_config_set_value( uint8_t *data ) +{ + // data = [ value_id, value_data ] + uint8_t *value_id = &(data[0]); + uint8_t *value_data = &(data[1]); + + switch ( *value_id ) + { + case id_caps_lock_enable: + g_config.enable_caps_lock = *value_data; + break; + case id_num_lock_enable: + g_config.enable_num_lock = *value_data; + break; + case id_scroll_lock_enable: + g_config.enable_scroll_lock = *value_data; + break; + case id_layer_indicator_enable: + g_config.enable_layer_indicator = *value_data; + break; + case id_caps_lock_brightness: + g_config.caps_lock_indicator.v = *value_data; + break; + case id_num_lock_brightness: + g_config.num_lock_indicator.v = *value_data; + break; + case id_scroll_lock_brightness: + g_config.scroll_lock_indicator.v = *value_data; + break; + case id_layer_indicator_brightness: + g_config.layer_indicator.v = *value_data; + break; + case id_caps_lock_color: + _set_color( &(g_config.caps_lock_indicator), value_data ); + break; + case id_num_lock_color: + _set_color( &(g_config.num_lock_indicator), value_data ); + break; + case id_scroll_lock_color: + _set_color( &(g_config.scroll_lock_indicator), value_data ); + break; + case id_layer_indicator_color: + _set_color( &(g_config.layer_indicator), value_data ); + break; + case id_caps_lock_key: + g_config.caps_lock_key = *value_data; + break; + case id_num_lock_key: + g_config.num_lock_key = *value_data; + break; + case id_scroll_lock_key: + g_config.scroll_lock_key = *value_data; + break; + case id_layer_indicator_key: + g_config.layer_indicator_key = *value_data; + break; + case id_caps_lock_override: + g_config.caps_override_bl = *value_data; + break; + case id_num_lock_override: + g_config.num_override_bl = *value_data; + break; + case id_scroll_lock_override: + g_config.scroll_override_bl = *value_data; + break; + case id_layer_indicator_override: + g_config.layer_override_bl = *value_data; + break; + } +} + +void indicator_config_get_value( uint8_t *data ) +{ + uint8_t *value_id = &(data[0]); + uint8_t *value_data = &(data[1]); + + switch ( *value_id ) + { + case id_caps_lock_enable: + *value_data = g_config.enable_caps_lock; + break; + case id_num_lock_enable: + *value_data = g_config.enable_num_lock; + break; + case id_scroll_lock_enable: + *value_data = g_config.enable_scroll_lock; + break; + case id_layer_indicator_enable: + *value_data = g_config.enable_layer_indicator; + break; + case id_caps_lock_brightness: + *value_data = g_config.caps_lock_indicator.v; + break; + case id_num_lock_brightness: + *value_data = g_config.num_lock_indicator.v; + break; + case id_layer_indicator_brightness: + *value_data = g_config.scroll_lock_indicator.v; + break; + case id_scroll_lock_brightness: + *value_data = g_config.layer_indicator.v; + break; + case id_caps_lock_color: + _get_color( &(g_config.caps_lock_indicator), value_data ); + break; + case id_num_lock_color: + _get_color( &(g_config.num_lock_indicator), value_data ); + break; + case id_scroll_lock_color: + _get_color( &(g_config.scroll_lock_indicator), value_data ); + break; + case id_layer_indicator_color: + _get_color( &(g_config.layer_indicator), value_data ); + break; + case id_caps_lock_key: + *value_data = g_config.caps_lock_key; + break; + case id_num_lock_key: + *value_data = g_config.num_lock_key; + break; + case id_scroll_lock_key: + *value_data = g_config.scroll_lock_key; + break; + case id_layer_indicator_key: + *value_data = g_config.layer_indicator_key; + break; + case id_caps_lock_override: + *value_data = g_config.caps_override_bl; + break; + case id_num_lock_override: + *value_data = g_config.num_override_bl; + break; + case id_scroll_lock_override: + *value_data = g_config.scroll_override_bl; + break; + case id_layer_indicator_override: + *value_data = g_config.layer_override_bl; + break; + } +} + +// Some helpers for setting/getting HSV +void _set_color( HSV *color, uint8_t *data ) +{ + color->h = data[0]; + color->s = data[1]; +} + +void _get_color( HSV *color, uint8_t *data ) +{ + data[0] = color->h; + data[1] = color->s; +} + +// Set the indicators with RGB Matrix subsystem +bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) { + // caps lock cyan + if (g_config.enable_caps_lock) { + RGB rgb_caps = hsv_to_rgb( (HSV){ .h = g_config.caps_lock_indicator.h, + .s = g_config.caps_lock_indicator.s, + .v = g_config.caps_lock_indicator.v } ); + if (host_keyboard_led_state().caps_lock) { + RGB_MATRIX_INDICATOR_SET_COLOR(g_config.caps_lock_key, rgb_caps.r, rgb_caps.g, rgb_caps.b); + } else { + if (g_config.caps_override_bl) { + RGB_MATRIX_INDICATOR_SET_COLOR(g_config.caps_lock_key, 0, 0, 0); + } + } + } + + // num lock cyan + if (g_config.enable_num_lock) { + RGB rgb_num = hsv_to_rgb( (HSV){ .h = g_config.num_lock_indicator.h, + .s = g_config.num_lock_indicator.s, + .v = g_config.num_lock_indicator.v } ); + if (host_keyboard_led_state().num_lock) { + RGB_MATRIX_INDICATOR_SET_COLOR(g_config.num_lock_key, rgb_num.r, rgb_num.g, rgb_num.b); + } else { + if (g_config.num_override_bl) { + RGB_MATRIX_INDICATOR_SET_COLOR(g_config.num_lock_key, 0, 0, 0); + } + } + } + + // scroll lock cyan + if (g_config.enable_scroll_lock) { + RGB rgb_scroll = hsv_to_rgb( (HSV){ .h = g_config.scroll_lock_indicator.h, + .s = g_config.scroll_lock_indicator.s, + .v = g_config.scroll_lock_indicator.v } ); + if (host_keyboard_led_state().scroll_lock) { + RGB_MATRIX_INDICATOR_SET_COLOR(g_config.scroll_lock_key, rgb_scroll.r, rgb_scroll.g, rgb_scroll.b); + } else { + if (g_config.scroll_override_bl) { + RGB_MATRIX_INDICATOR_SET_COLOR(g_config.scroll_lock_key, 0, 0, 0); + } + } + } + + // layer state + if (g_config.enable_layer_indicator) { + RGB rgb_layer = hsv_to_rgb( (HSV){ .h = g_config.layer_indicator.h, + .s = g_config.layer_indicator.s, + .v = g_config.layer_indicator.v } ); + switch (get_highest_layer(layer_state)) { + case 0: + if (g_config.layer_override_bl) { + RGB_MATRIX_INDICATOR_SET_COLOR(g_config.layer_indicator_key, 0, 0, 0); + } + break; + case 1: + RGB_MATRIX_INDICATOR_SET_COLOR(g_config.layer_indicator_key, rgb_layer.r, rgb_layer.g, rgb_layer.b); + break; + default: + // white + RGB_MATRIX_INDICATOR_SET_COLOR(24, 128, 128, 128); + break; + } + } + return false; +} diff --git a/keyboards/xelus/pachi/rgb/rev2/keymaps/via/rules.mk b/keyboards/xelus/pachi/rgb/rev2/keymaps/via/rules.mk new file mode 100644 index 00000000000..1e5b99807cb --- /dev/null +++ b/keyboards/xelus/pachi/rgb/rev2/keymaps/via/rules.mk @@ -0,0 +1 @@ +VIA_ENABLE = yes diff --git a/keyboards/xelus/pachi/rgb/rev2/rev2.c b/keyboards/xelus/pachi/rgb/rev2/rev2.c index f595e889c3b..5589b271770 100644 --- a/keyboards/xelus/pachi/rgb/rev2/rev2.c +++ b/keyboards/xelus/pachi/rgb/rev2/rev2.c @@ -14,7 +14,7 @@ * along with this program. If not, see . */ -#include "rev2.h" +#include "quantum.h" // tested and working void matrix_io_delay(void) { __asm__ volatile("nop\nnop\nnop\n"); } @@ -239,311 +239,4 @@ const rgb_matrix_driver_t rgb_matrix_driver = { .set_color_all = is31fl3741_set_color_all }; -#ifdef VIA_ENABLE -#include "quantum.h" -#include "eeprom.h" - -indicator_settings_config g_config = { - .caps_lock_indicator = {0, 0, 128}, - .num_lock_indicator = {60, 0, 128}, - .scroll_lock_indicator = {120, 0, 128}, - .layer_indicator = {180, 0, 128}, - .caps_lock_key = 7, - .num_lock_key = 0, - .scroll_lock_key = 78, - .layer_indicator_key = 0, - .enable_caps_lock = true, - .enable_num_lock = false, - .enable_scroll_lock = true, - .enable_layer_indicator = false, - .caps_override_bl = true, - .num_override_bl = true, - .scroll_override_bl = true, - .layer_override_bl = true -}; - -void values_load(void) -{ - eeprom_read_block( &g_config, ((void*)VIA_EEPROM_CUSTOM_CONFIG_ADDR), sizeof(g_config) ); -} - -void values_save(void) -{ - eeprom_update_block( &g_config, ((void*)VIA_EEPROM_CUSTOM_CONFIG_ADDR), sizeof(g_config) ); -} - -void via_init_kb(void) -{ - // If the EEPROM has the magic, the data is good. - // OK to load from EEPROM - if (via_eeprom_is_valid()) { - values_load(); - } else { - values_save(); - // DO NOT set EEPROM valid here, let caller do this - } -} - -void via_custom_value_command_kb(uint8_t *data, uint8_t length) { - // data = [ command_id, channel_id, value_id, value_data ] - uint8_t *command_id = &(data[0]); - uint8_t *channel_id = &(data[1]); - uint8_t *value_id_and_data = &(data[2]); - - if ( *channel_id == id_custom_channel ) { - switch ( *command_id ) - { - case id_custom_set_value: - { - indicator_config_set_value(value_id_and_data); - break; - } - case id_custom_get_value: - { - indicator_config_get_value(value_id_and_data); - break; - } - case id_custom_save: - { - values_save(); - break; - } - default: - { - // Unhandled message. - *command_id = id_unhandled; - break; - } - } - return; - } - - // Return the unhandled state - *command_id = id_unhandled; - - // DO NOT call raw_hid_send(data,length) here, let caller do this -} - -void indicator_config_set_value( uint8_t *data ) -{ - // data = [ value_id, value_data ] - uint8_t *value_id = &(data[0]); - uint8_t *value_data = &(data[1]); - - switch ( *value_id ) - { - case id_caps_lock_enable: - g_config.enable_caps_lock = *value_data; - break; - case id_num_lock_enable: - g_config.enable_num_lock = *value_data; - break; - case id_scroll_lock_enable: - g_config.enable_scroll_lock = *value_data; - break; - case id_layer_indicator_enable: - g_config.enable_layer_indicator = *value_data; - break; - case id_caps_lock_brightness: - g_config.caps_lock_indicator.v = *value_data; - break; - case id_num_lock_brightness: - g_config.num_lock_indicator.v = *value_data; - break; - case id_scroll_lock_brightness: - g_config.scroll_lock_indicator.v = *value_data; - break; - case id_layer_indicator_brightness: - g_config.layer_indicator.v = *value_data; - break; - case id_caps_lock_color: - _set_color( &(g_config.caps_lock_indicator), value_data ); - break; - case id_num_lock_color: - _set_color( &(g_config.num_lock_indicator), value_data ); - break; - case id_scroll_lock_color: - _set_color( &(g_config.scroll_lock_indicator), value_data ); - break; - case id_layer_indicator_color: - _set_color( &(g_config.layer_indicator), value_data ); - break; - case id_caps_lock_key: - g_config.caps_lock_key = *value_data; - break; - case id_num_lock_key: - g_config.num_lock_key = *value_data; - break; - case id_scroll_lock_key: - g_config.scroll_lock_key = *value_data; - break; - case id_layer_indicator_key: - g_config.layer_indicator_key = *value_data; - break; - case id_caps_lock_override: - g_config.caps_override_bl = *value_data; - break; - case id_num_lock_override: - g_config.num_override_bl = *value_data; - break; - case id_scroll_lock_override: - g_config.scroll_override_bl = *value_data; - break; - case id_layer_indicator_override: - g_config.layer_override_bl = *value_data; - break; - } -} - -void indicator_config_get_value( uint8_t *data ) -{ - uint8_t *value_id = &(data[0]); - uint8_t *value_data = &(data[1]); - - switch ( *value_id ) - { - case id_caps_lock_enable: - *value_data = g_config.enable_caps_lock; - break; - case id_num_lock_enable: - *value_data = g_config.enable_num_lock; - break; - case id_scroll_lock_enable: - *value_data = g_config.enable_scroll_lock; - break; - case id_layer_indicator_enable: - *value_data = g_config.enable_layer_indicator; - break; - case id_caps_lock_brightness: - *value_data = g_config.caps_lock_indicator.v; - break; - case id_num_lock_brightness: - *value_data = g_config.num_lock_indicator.v; - break; - case id_layer_indicator_brightness: - *value_data = g_config.scroll_lock_indicator.v; - break; - case id_scroll_lock_brightness: - *value_data = g_config.layer_indicator.v; - break; - case id_caps_lock_color: - _get_color( &(g_config.caps_lock_indicator), value_data ); - break; - case id_num_lock_color: - _get_color( &(g_config.num_lock_indicator), value_data ); - break; - case id_scroll_lock_color: - _get_color( &(g_config.scroll_lock_indicator), value_data ); - break; - case id_layer_indicator_color: - _get_color( &(g_config.layer_indicator), value_data ); - break; - case id_caps_lock_key: - *value_data = g_config.caps_lock_key; - break; - case id_num_lock_key: - *value_data = g_config.num_lock_key; - break; - case id_scroll_lock_key: - *value_data = g_config.scroll_lock_key; - break; - case id_layer_indicator_key: - *value_data = g_config.layer_indicator_key; - break; - case id_caps_lock_override: - *value_data = g_config.caps_override_bl; - break; - case id_num_lock_override: - *value_data = g_config.num_override_bl; - break; - case id_scroll_lock_override: - *value_data = g_config.scroll_override_bl; - break; - case id_layer_indicator_override: - *value_data = g_config.layer_override_bl; - break; - } -} - -// Some helpers for setting/getting HSV -void _set_color( HSV *color, uint8_t *data ) -{ - color->h = data[0]; - color->s = data[1]; -} - -void _get_color( HSV *color, uint8_t *data ) -{ - data[0] = color->h; - data[1] = color->s; -} - -// Set the indicators with RGB Matrix subsystem -bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) { - // caps lock cyan - if (g_config.enable_caps_lock) { - RGB rgb_caps = hsv_to_rgb( (HSV){ .h = g_config.caps_lock_indicator.h, - .s = g_config.caps_lock_indicator.s, - .v = g_config.caps_lock_indicator.v } ); - if (host_keyboard_led_state().caps_lock) { - RGB_MATRIX_INDICATOR_SET_COLOR(g_config.caps_lock_key, rgb_caps.r, rgb_caps.g, rgb_caps.b); - } else { - if (g_config.caps_override_bl) { - RGB_MATRIX_INDICATOR_SET_COLOR(g_config.caps_lock_key, 0, 0, 0); - } - } - } - - // num lock cyan - if (g_config.enable_num_lock) { - RGB rgb_num = hsv_to_rgb( (HSV){ .h = g_config.num_lock_indicator.h, - .s = g_config.num_lock_indicator.s, - .v = g_config.num_lock_indicator.v } ); - if (host_keyboard_led_state().num_lock) { - RGB_MATRIX_INDICATOR_SET_COLOR(g_config.num_lock_key, rgb_num.r, rgb_num.g, rgb_num.b); - } else { - if (g_config.num_override_bl) { - RGB_MATRIX_INDICATOR_SET_COLOR(g_config.num_lock_key, 0, 0, 0); - } - } - } - - // scroll lock cyan - if (g_config.enable_scroll_lock) { - RGB rgb_scroll = hsv_to_rgb( (HSV){ .h = g_config.scroll_lock_indicator.h, - .s = g_config.scroll_lock_indicator.s, - .v = g_config.scroll_lock_indicator.v } ); - if (host_keyboard_led_state().scroll_lock) { - RGB_MATRIX_INDICATOR_SET_COLOR(g_config.scroll_lock_key, rgb_scroll.r, rgb_scroll.g, rgb_scroll.b); - } else { - if (g_config.scroll_override_bl) { - RGB_MATRIX_INDICATOR_SET_COLOR(g_config.scroll_lock_key, 0, 0, 0); - } - } - } - - // layer state - if (g_config.enable_layer_indicator) { - RGB rgb_layer = hsv_to_rgb( (HSV){ .h = g_config.layer_indicator.h, - .s = g_config.layer_indicator.s, - .v = g_config.layer_indicator.v } ); - switch (get_highest_layer(layer_state)) { - case 0: - if (g_config.layer_override_bl) { - RGB_MATRIX_INDICATOR_SET_COLOR(g_config.layer_indicator_key, 0, 0, 0); - } - break; - case 1: - RGB_MATRIX_INDICATOR_SET_COLOR(g_config.layer_indicator_key, rgb_layer.r, rgb_layer.g, rgb_layer.b); - break; - default: - // white - RGB_MATRIX_INDICATOR_SET_COLOR(24, 128, 128, 128); - break; - } - } - return false; -} - -#endif #endif diff --git a/keyboards/xelus/pachi/rgb/rev2/rev2.h b/keyboards/xelus/pachi/rgb/rev2/rev2.h deleted file mode 100644 index fb0b8639d20..00000000000 --- a/keyboards/xelus/pachi/rgb/rev2/rev2.h +++ /dev/null @@ -1,72 +0,0 @@ -/* Copyright 2023 Harrison Chan (Xelus) - * - * 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" - -#ifdef VIA_ENABLE -// custom ID codes -enum via_indicator_value { - id_caps_lock_enable = 1, - id_caps_lock_brightness, - id_caps_lock_color, - id_caps_lock_key, - id_caps_lock_override, - id_num_lock_enable, - id_num_lock_brightness, - id_num_lock_color, - id_num_lock_key, - id_num_lock_override, - id_scroll_lock_enable, - id_scroll_lock_brightness, - id_scroll_lock_color, - id_scroll_lock_key, - id_scroll_lock_override, - id_layer_indicator_enable, - id_layer_indicator_brightness, - id_layer_indicator_color, - id_layer_indicator_key, - id_layer_indicator_override -}; - -// struct to save things -typedef struct { - bool enable_caps_lock:1; // | - bool enable_num_lock:1; // | - bool enable_scroll_lock:1; // | - bool enable_layer_indicator:1; // | - bool caps_override_bl:1; // | - bool num_override_bl:1; // | - bool scroll_override_bl:1; // | - bool layer_override_bl:1; // 1 byte - HSV caps_lock_indicator; // 3 bytes - HSV num_lock_indicator; // 3 bytes - HSV scroll_lock_indicator; // 3 bytes - HSV layer_indicator; // 3 bytes - uint8_t caps_lock_key; // 1 byte - uint8_t num_lock_key; // 1 byte - uint8_t scroll_lock_key; // 1 byte - uint8_t layer_indicator_key;// 1 byte -} indicator_settings_config; -// total 17 bytes - -// function declaration -void indicator_config_set_value( uint8_t *data ); -void indicator_config_get_value( uint8_t *data ); -void indicator_config_save ( void ); -void _set_color(HSV *color, uint8_t *data); -void _get_color(HSV *color, uint8_t *data); -#endif From 0947299864c81a93ee5a6f13bab8d71b72299191 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sat, 29 Jun 2024 14:25:24 +0100 Subject: [PATCH 031/204] Remove custom keycodes from nullbitsco/snap (#24017) --- keyboards/nullbitsco/snap/snap.c | 84 ++++++++------------------------ keyboards/nullbitsco/snap/snap.h | 12 ----- 2 files changed, 19 insertions(+), 77 deletions(-) diff --git a/keyboards/nullbitsco/snap/snap.c b/keyboards/nullbitsco/snap/snap.c index 7308572f954..bd0ea5b7317 100644 --- a/keyboards/nullbitsco/snap/snap.c +++ b/keyboards/nullbitsco/snap/snap.c @@ -15,11 +15,6 @@ */ #include "snap.h" -// Macro variables -bool is_alt_tab_active = false; -uint16_t alt_tab_timer = 0; -bool muted = false; - void matrix_init_kb(void) { set_bitc_LED(LED_OFF); matrix_init_remote_kb(); @@ -27,23 +22,16 @@ void matrix_init_kb(void) { } void keyboard_post_init_kb(void) { - #ifdef CONSOLE_ENABLE +#ifdef CONSOLE_ENABLE debug_enable = true; debug_matrix = true; - #endif +#endif keyboard_post_init_user(); } void matrix_scan_kb(void) { matrix_scan_remote_kb(); matrix_scan_user(); - - if (is_alt_tab_active) { - if (timer_elapsed(alt_tab_timer) > 1000) { - unregister_code(KC_LALT); - is_alt_tab_active = false; - } - } } // Use Bit-C LED to show CAPS LOCK and NUM LOCK status @@ -51,63 +39,29 @@ void led_update_ports(led_t led_state) { set_bitc_LED(led_state.caps_lock ? LED_DIM : LED_OFF); } +bool shutdown_kb(bool jump_to_bootloader) { + if (!shutdown_user(jump_to_bootloader)) { + return false; + } + + set_bitc_LED(LED_DIM); +#ifdef RGBLIGHT_ENABLE + rgblight_disable_noeeprom(); +#endif +#ifdef OLED_ENABLE + oled_off(); +#endif + return true; +} + bool process_record_kb(uint16_t keycode, keyrecord_t *record) { // If console is enabled, it will print the matrix position and status of each key pressed - #ifdef CONSOLE_ENABLE +#ifdef CONSOLE_ENABLE dprintf("kc: 0x%04X, col: %u, row: %u, pressed: %b, time: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed, record->event.time); - #endif +#endif process_record_remote_kb(keycode, record); if (!process_record_user(keycode, record)) return false; - switch (keycode) { - case QK_BOOT: - if (record->event.pressed) { - set_bitc_LED(LED_DIM); - #ifdef RGBLIGHT_ENABLE - rgblight_disable_noeeprom(); - #endif - #ifdef OLED_ENABLE - oled_off(); - #endif - bootloader_jump(); // jump to bootloader - } - return false; - - case DISC_MUTE: - if (record->event.pressed) { - tap_code(KC_F23); - #ifdef RGBLIGHT_ENABLE - if (!rgblight_is_enabled()) break; - - if (muted) { - rgblight_enable_noeeprom(); - } else { - rgblight_timer_disable(); - uint8_t val = rgblight_get_val(); - rgblight_sethsv_range(255, 255, val, 1, 5); - } - #endif - muted = !muted; - } - break; - - case SUPER_ALT_TAB: - if (record->event.pressed) { - if (!is_alt_tab_active) { - is_alt_tab_active = true; - register_code(KC_LALT); - } - alt_tab_timer = timer_read(); - register_code(KC_TAB); - } else { - unregister_code(KC_TAB); - } - break; - - default: - break; - } - return true; } diff --git a/keyboards/nullbitsco/snap/snap.h b/keyboards/nullbitsco/snap/snap.h index e593257368d..c1fa22e0c1e 100644 --- a/keyboards/nullbitsco/snap/snap.h +++ b/keyboards/nullbitsco/snap/snap.h @@ -18,15 +18,3 @@ #include "quantum.h" #include "common/remote_kb.h" #include "common/bitc_led.h" - -#ifdef VIA_ENABLE -enum custom_keycodes { - DISC_MUTE = QK_USER_0, - SUPER_ALT_TAB -}; -#else -enum custom_keycodes { - DISC_MUTE = SAFE_RANGE, - SUPER_ALT_TAB -}; -#endif From 7bc3eef8cc262e12b0f823ba4c92cf97ca3dc1fa Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Tue, 2 Jul 2024 10:16:41 +1000 Subject: [PATCH 032/204] SPI flash API cleanup, add async erase capability. (#23894) --- builddefs/common_features.mk | 9 +- drivers/flash/flash.h | 126 ++++++++++++++++++ drivers/flash/flash_spi.c | 89 +++++++------ drivers/flash/flash_spi.h | 31 +---- .../wear_leveling/wear_leveling_flash_spi.c | 4 +- 5 files changed, 182 insertions(+), 77 deletions(-) create mode 100644 drivers/flash/flash.h diff --git a/builddefs/common_features.mk b/builddefs/common_features.mk index 68f9a1dd08a..498614dd264 100644 --- a/builddefs/common_features.mk +++ b/builddefs/common_features.mk @@ -282,18 +282,17 @@ ifneq ($(strip $(WEAR_LEVELING_DRIVER)),none) endif endif -VALID_FLASH_DRIVER_TYPES := spi +VALID_FLASH_DRIVER_TYPES := spi custom FLASH_DRIVER ?= none ifneq ($(strip $(FLASH_DRIVER)), none) ifeq ($(filter $(FLASH_DRIVER),$(VALID_FLASH_DRIVER_TYPES)),) $(call CATASTROPHIC_ERROR,Invalid FLASH_DRIVER,FLASH_DRIVER="$(FLASH_DRIVER)" is not a valid flash driver) else - OPT_DEFS += -DFLASH_ENABLE + OPT_DEFS += -DFLASH_ENABLE -DFLASH_DRIVER -DFLASH_DRIVER_$(strip $(shell echo $(FLASH_DRIVER) | tr '[:lower:]' '[:upper:]')) + COMMON_VPATH += $(DRIVER_PATH)/flash ifeq ($(strip $(FLASH_DRIVER)),spi) - SPI_DRIVER_REQUIRED = yes - OPT_DEFS += -DFLASH_DRIVER -DFLASH_SPI - COMMON_VPATH += $(DRIVER_PATH)/flash SRC += flash_spi.c + SPI_DRIVER_REQUIRED = yes endif endif endif diff --git a/drivers/flash/flash.h b/drivers/flash/flash.h new file mode 100644 index 00000000000..4d624751398 --- /dev/null +++ b/drivers/flash/flash.h @@ -0,0 +1,126 @@ +// Copyright 2024 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +/** + * @brief The status of a flash operation. + */ +enum { + FLASH_STATUS_SUCCESS = 0, //< The operation completed successfully. + FLASH_STATUS_ERROR = -1, //< An error occurred during the operation. + FLASH_STATUS_TIMEOUT = -2, //< The operation timed out. + FLASH_STATUS_BAD_ADDRESS = -3, //< The address is out of bounds. + FLASH_STATUS_BUSY = -4, //< The flash is busy. +}; + +/** + * @brief The status of a flash operation. + */ +typedef int16_t flash_status_t; + +/** + * @brief Initializes the flash driver. + * + * This function initializes the flash driver and prepares it for use. + * It should be called before any other flash-related functions are used. + */ +void flash_init(void); + +/** + * @brief Checks if the flash is busy. + * + * This function checks if the flash is currently busy with an operation. + * + * @return FLASH_STATUS_SUCCESS if the flash is not busy, FLASH_STATUS_BUSY if the flash is busy, or FLASH_STATUS_ERROR if an error occurred. + */ +flash_status_t flash_is_busy(void); + +/** + * @brief Initiates a chip erase operation. + * + * This function does not wait for the flash to become ready. + * + * @return FLASH_STATUS_SUCCESS if the erase command was successfully sent, FLASH_STATUS_TIMEOUT if the flash is busy, or FLASH_STATUS_ERROR if an error occurred. + */ +flash_status_t flash_begin_erase_chip(void); + +/** + * @brief Waits for the chip erase operation to complete. + * + * This function waits for the chip erase operation to complete. + * + * @return FLASH_STATUS_SUCCESS if the chip erase operation completed successfully, FLASH_STATUS_TIMEOUT if the flash was still busy, or FLASH_STATUS_ERROR if an error occurred. + */ +flash_status_t flash_wait_erase_chip(void); + +/** + * @brief Erases the entire flash memory chip. + * + * This function initiates an erase operation to erase the entire flash memory chip. + * It waits for the operation to complete. + * + * @return FLASH_STATUS_SUCCESS if the erase was successfully executed, FLASH_STATUS_TIMEOUT if the flash is busy, or FLASH_STATUS_ERROR if an error occurred. + */ +flash_status_t flash_erase_chip(void); + +/** + * @brief Erases a block of flash memory. + * + * This function initiates an erase operation to erase a block of flash memory. + * It waits for the operation to complete. + * + * @param addr The address of the block to erase. + * + * @return FLASH_STATUS_SUCCESS if the erase was successfully executed, FLASH_STATUS_TIMEOUT if the flash is busy, or FLASH_STATUS_ERROR if an error occurred. + */ +flash_status_t flash_erase_block(uint32_t addr); + +/** + * @brief Erases a sector of flash memory. + * + * This function initiates an erase operation to erase a sector of flash memory. + * It waits for the operation to complete. + * + * @param addr The address of the sector to erase. + * + * @return FLASH_STATUS_SUCCESS if the erase was successfully executed, FLASH_STATUS_TIMEOUT if the flash is busy, or FLASH_STATUS_ERROR if an error occurred. + */ +flash_status_t flash_erase_sector(uint32_t addr); + +/** + * @brief Reads a range of flash memory. + * + * This function reads a range of flash memory into a buffer. + * + * @param addr The address of the range to read. + * @param buf A pointer to the buffer to read the range into. + * @param len The length of the range to read. + * + * @return FLASH_STATUS_SUCCESS if the range was successfully read, FLASH_STATUS_BAD_ADDRESS if the address is out of bounds, FLASH_STATUS_TIMEOUT if the flash is busy, or FLASH_STATUS_ERROR if an error occurred. + */ +flash_status_t flash_read_range(uint32_t addr, void *buf, size_t len); + +/** + * @brief Writes a range of flash memory. + * + * This function writes a range of flash memory from a buffer. + * + * @param addr The address of the range to write. + * @param buf A pointer to the buffer to write to the range. + * @param len The length of the range to write. + * + * @return FLASH_STATUS_SUCCESS if the range was successfully written, FLASH_STATUS_BAD_ADDRESS if the address is out of bounds, FLASH_STATUS_TIMEOUT if the flash is busy, or FLASH_STATUS_ERROR if an error occurred. + */ +flash_status_t flash_write_range(uint32_t addr, const void *buf, size_t len); + +#ifdef __cplusplus +} +#endif diff --git a/drivers/flash/flash_spi.c b/drivers/flash/flash_spi.c index 0c0eb8a99e5..7226773ff41 100644 --- a/drivers/flash/flash_spi.c +++ b/drivers/flash/flash_spi.c @@ -1,22 +1,10 @@ -/* -Copyright (C) 2021 Westberry Technology (ChangZhou) Corp., Ltd - -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 . -*/ +// Copyright 2021 Westberry Technology (ChangZhou) Corp., Ltd +// Copyright 2024 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later #include +#include "flash.h" #include "util.h" #include "wait.h" #include "debug.h" @@ -69,33 +57,43 @@ static bool spi_flash_start(void) { return spi_start(EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN, EXTERNAL_FLASH_SPI_LSBFIRST, EXTERNAL_FLASH_SPI_MODE, EXTERNAL_FLASH_SPI_CLOCK_DIVISOR); } -static flash_status_t spi_flash_wait_while_busy(void) { - uint32_t deadline = timer_read32() + EXTERNAL_FLASH_SPI_TIMEOUT; +static flash_status_t spi_flash_wait_while_busy_multiplier(int multiplier) { flash_status_t response = FLASH_STATUS_SUCCESS; - uint8_t retval; - + uint32_t deadline = timer_read32() + ((EXTERNAL_FLASH_SPI_TIMEOUT)*multiplier); do { - bool res = spi_flash_start(); - if (!res) { - dprint("Failed to start SPI! [spi flash wait while busy]\n"); - return FLASH_STATUS_ERROR; - } - - spi_write(FLASH_CMD_RDSR); - - retval = (uint8_t)spi_read(); - - spi_stop(); - if (timer_read32() >= deadline) { response = FLASH_STATUS_TIMEOUT; break; } - } while (retval & FLASH_FLAG_WIP); + response = flash_is_busy(); + } while (response == FLASH_STATUS_BUSY); return response; } +static flash_status_t spi_flash_wait_while_busy(void) { + return spi_flash_wait_while_busy_multiplier(1); +} + +flash_status_t flash_is_busy(void) { + bool res = spi_flash_start(); + if (!res) { + dprint("Failed to start SPI! [spi flash wait while busy]\n"); + return FLASH_STATUS_ERROR; + } + + spi_write(FLASH_CMD_RDSR); + spi_status_t status = spi_read(); + spi_stop(); + + if (status < 0) { + return status; + } + + uint8_t sr = (uint8_t)status; + return (sr & FLASH_FLAG_WIP) ? FLASH_STATUS_BUSY : FLASH_STATUS_SUCCESS; +} + static flash_status_t spi_flash_write_enable(void) { bool res = spi_flash_start(); if (!res) { @@ -104,7 +102,6 @@ static flash_status_t spi_flash_write_enable(void) { } spi_write(FLASH_CMD_WREN); - spi_stop(); return FLASH_STATUS_SUCCESS; @@ -118,7 +115,6 @@ static flash_status_t spi_flash_write_disable(void) { } spi_write(FLASH_CMD_WRDI); - spi_stop(); return FLASH_STATUS_SUCCESS; @@ -166,7 +162,7 @@ void flash_init(void) { spi_init(); } -flash_status_t flash_erase_chip(void) { +flash_status_t flash_begin_erase_chip(void) { flash_status_t response = FLASH_STATUS_SUCCESS; /* Wait for the write-in-progress bit to be cleared. */ @@ -191,17 +187,28 @@ flash_status_t flash_erase_chip(void) { } spi_write(FLASH_CMD_CE); spi_stop(); + return FLASH_STATUS_SUCCESS; +} - /* Wait for the write-in-progress bit to be cleared.*/ - response = spi_flash_wait_while_busy(); +flash_status_t flash_wait_erase_chip(void) { + flash_status_t response = spi_flash_wait_while_busy_multiplier(250); // Chip erase can take a long time, wait 250x the usual timeout if (response != FLASH_STATUS_SUCCESS) { dprint("Failed to check WIP flag! [spi flash erase chip]\n"); return response; } - return response; } +flash_status_t flash_erase_chip(void) { + flash_status_t response = flash_begin_erase_chip(); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to begin erase chip! [spi flash erase chip]\n"); + return response; + } + + return flash_wait_erase_chip(); +} + flash_status_t flash_erase_sector(uint32_t addr) { flash_status_t response = FLASH_STATUS_SUCCESS; @@ -282,7 +289,7 @@ flash_status_t flash_erase_block(uint32_t addr) { return response; } -flash_status_t flash_read_block(uint32_t addr, void *buf, size_t len) { +flash_status_t flash_read_range(uint32_t addr, void *buf, size_t len) { flash_status_t response = FLASH_STATUS_SUCCESS; uint8_t * read_buf = (uint8_t *)buf; @@ -313,7 +320,7 @@ flash_status_t flash_read_block(uint32_t addr, void *buf, size_t len) { return response; } -flash_status_t flash_write_block(uint32_t addr, const void *buf, size_t len) { +flash_status_t flash_write_range(uint32_t addr, const void *buf, size_t len) { flash_status_t response = FLASH_STATUS_SUCCESS; uint8_t * write_buf = (uint8_t *)buf; diff --git a/drivers/flash/flash_spi.h b/drivers/flash/flash_spi.h index 87460fc210e..7a979daf0f7 100644 --- a/drivers/flash/flash_spi.h +++ b/drivers/flash/flash_spi.h @@ -17,6 +17,8 @@ along with this program. If not, see . #pragma once +#include "flash.h" + /* All the following default configurations are based on MX25L4006E Nor FLASH. */ /* @@ -105,32 +107,3 @@ along with this program. If not, see . The page count of the FLASH, calculated by total FLASH size and page size. */ #define EXTERNAL_FLASH_PAGE_COUNT ((EXTERNAL_FLASH_SIZE) / (EXTERNAL_FLASH_PAGE_SIZE)) - -typedef int16_t flash_status_t; - -#define FLASH_STATUS_SUCCESS (0) -#define FLASH_STATUS_ERROR (-1) -#define FLASH_STATUS_TIMEOUT (-2) -#define FLASH_STATUS_BAD_ADDRESS (-3) - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -void flash_init(void); - -flash_status_t flash_erase_chip(void); - -flash_status_t flash_erase_block(uint32_t addr); - -flash_status_t flash_erase_sector(uint32_t addr); - -flash_status_t flash_read_block(uint32_t addr, void *buf, size_t len); - -flash_status_t flash_write_block(uint32_t addr, const void *buf, size_t len); - -#ifdef __cplusplus -} -#endif diff --git a/drivers/wear_leveling/wear_leveling_flash_spi.c b/drivers/wear_leveling/wear_leveling_flash_spi.c index 6191f8bf095..304aed1641f 100644 --- a/drivers/wear_leveling/wear_leveling_flash_spi.c +++ b/drivers/wear_leveling/wear_leveling_flash_spi.c @@ -58,7 +58,7 @@ bool backing_store_read(uint32_t address, backing_store_int_t *value) { bool backing_store_read_bulk(uint32_t address, backing_store_int_t *values, size_t item_count) { bs_dprintf("Read "); uint32_t offset = (WEAR_LEVELING_EXTERNAL_FLASH_BLOCK_OFFSET) * (EXTERNAL_FLASH_BLOCK_SIZE) + address; - flash_status_t status = flash_read_block(offset, values, sizeof(backing_store_int_t) * item_count); + flash_status_t status = flash_read_range(offset, values, sizeof(backing_store_int_t) * item_count); if (status == FLASH_STATUS_SUCCESS) { for (size_t i = 0; i < item_count; ++i) { values[i] = ~values[i]; @@ -88,7 +88,7 @@ bool backing_store_write_bulk(uint32_t address, backing_store_int_t *values, siz } // Write out the block - if (flash_write_block(offset, temp, sizeof(backing_store_int_t) * this_loop) != FLASH_STATUS_SUCCESS) { + if (flash_write_range(offset, temp, sizeof(backing_store_int_t) * this_loop) != FLASH_STATUS_SUCCESS) { return false; } From bc0c69570b8a8b1d9a754a280053e49a825b24d7 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 3 Jul 2024 17:18:27 +1000 Subject: [PATCH 033/204] Rename encoder pins defines (#24003) --- docs/features/encoders.md | 28 ++++++++--------- docs/features/split_keyboard.md | 4 +-- drivers/encoder/encoder_quadrature.c | 18 +++++------ .../wings42/rev2/keymaps/via/config.h | 4 +-- .../handwired/sick68/keymaps/via/config.h | 4 +-- .../gskt00/keymaps/default-poly/config.h | 4 +-- keyboards/pica40/rev2/rev2.c | 4 +-- keyboards/ploopyco/mouse/config.h | 4 +-- keyboards/ploopyco/ploopyco.c | 4 +-- keyboards/ploopyco/trackball/config.h | 4 +-- keyboards/ploopyco/trackball_mini/config.h | 4 +-- keyboards/ploopyco/trackball_thumb/config.h | 4 +-- keyboards/rgbkb/sol/keymaps/default/keymap.c | 2 +- keyboards/rgbkb/sol/rev2/config.h | 8 ++--- keyboards/terrazzo/readme.md | 4 +-- lib/python/qmk/cli/generate/config_h.py | 4 +-- lib/python/qmk/info.py | 4 +-- quantum/encoder.h | 31 ++++++++++++------- quantum/encoder/tests/config_mock.h | 4 +-- .../tests/config_mock_split_left_eq_right.h | 8 ++--- .../tests/config_mock_split_left_gt_right.h | 8 ++--- .../tests/config_mock_split_left_lt_right.h | 8 ++--- .../encoder/tests/config_mock_split_no_left.h | 8 ++--- .../tests/config_mock_split_no_right.h | 8 ++--- .../encoder/tests/config_mock_split_role.h | 8 ++--- 25 files changed, 100 insertions(+), 91 deletions(-) diff --git a/docs/features/encoders.md b/docs/features/encoders.md index 3d1cac79af7..eea70dafecf 100644 --- a/docs/features/encoders.md +++ b/docs/features/encoders.md @@ -9,15 +9,15 @@ ENCODER_ENABLE = yes and this to your `config.h`: ```c -#define ENCODERS_PAD_A { B12 } -#define ENCODERS_PAD_B { B13 } +#define ENCODER_A_PINS { B12 } +#define ENCODER_B_PINS { B13 } ``` Each PAD_A/B variable defines an array so multiple encoders can be defined, e.g.: ```c -#define ENCODERS_PAD_A { encoder1a, encoder2a } -#define ENCODERS_PAD_B { encoder1b, encoder2b } +#define ENCODER_A_PINS { encoder1a, encoder2a } +#define ENCODER_B_PINS { encoder1b, encoder2b } ``` If your encoder's clockwise directions are incorrect, you can swap the A & B pad definitions. They can also be flipped with a define: @@ -49,8 +49,8 @@ For 4× encoders you also can assign default position if encoder skips pulses wh If you are using different pinouts for the encoders on each half of a split keyboard, you can define the pinout (and optionally, resolutions) for the right half like this: ```c -#define ENCODERS_PAD_A_RIGHT { encoder1a, encoder2a } -#define ENCODERS_PAD_B_RIGHT { encoder1b, encoder2b } +#define ENCODER_A_PINS_RIGHT { encoder1a, encoder2a } +#define ENCODER_B_PINS_RIGHT { encoder1b, encoder2b } #define ENCODER_RESOLUTIONS_RIGHT { 2, 4 } ``` @@ -59,11 +59,11 @@ If the `_RIGHT` definitions aren't specified in your `config.h`, then the non-`_ Additionally, if one side does not have an encoder, you can specify `{}` for the pins/resolution -- for example, a split keyboard with only a right-side encoder: ```c -#define ENCODERS_PAD_A { } -#define ENCODERS_PAD_B { } +#define ENCODER_A_PINS { } +#define ENCODER_B_PINS { } #define ENCODER_RESOLUTIONS { } -#define ENCODERS_PAD_A_RIGHT { B12 } -#define ENCODERS_PAD_B_RIGHT { B13 } +#define ENCODER_A_PINS_RIGHT { B12 } +#define ENCODER_B_PINS_RIGHT { B13 } #define ENCODER_RESOLUTIONS_RIGHT { 4 } ``` @@ -174,13 +174,13 @@ Multiple encoders may share pins so long as each encoder has a distinct pair of For example you can support two encoders using only 3 pins like this ``` -#define ENCODERS_PAD_A { B1, B1 } -#define ENCODERS_PAD_B { B2, B3 } +#define ENCODER_A_PINS { B1, B1 } +#define ENCODER_B_PINS { B2, B3 } ``` You could even support three encoders using only three pins (one per encoder) however in this configuration, rotating two encoders which share pins simultaneously will often generate incorrect output. For example: ``` -#define ENCODERS_PAD_A { B1, B1, B2 } -#define ENCODERS_PAD_B { B2, B3, B3 } +#define ENCODER_A_PINS { B1, B1, B2 } +#define ENCODER_B_PINS { B2, B3, B3 } ``` Here rotating Encoder 0 `B1 B2` and Encoder 1 `B1 B3` could be interpreted as rotating Encoder 2 `B2 B3` or `B3 B2` depending on the timing. This may still be a useful configuration depending on your use case diff --git a/docs/features/split_keyboard.md b/docs/features/split_keyboard.md index 6efa1c2a35c..49582c3946f 100644 --- a/docs/features/split_keyboard.md +++ b/docs/features/split_keyboard.md @@ -417,8 +417,8 @@ This allows you to specify a different set of pins for the matrix on the right s This allows you to specify a different set of direct pins for the right side. ```c -#define ENCODERS_PAD_A_RIGHT { encoder1a, encoder2a } -#define ENCODERS_PAD_B_RIGHT { encoder1b, encoder2b } +#define ENCODER_A_PINS_RIGHT { encoder1a, encoder2a } +#define ENCODER_B_PINS_RIGHT { encoder1b, encoder2b } ``` This allows you to specify a different set of encoder pins for the right side. diff --git a/drivers/encoder/encoder_quadrature.c b/drivers/encoder/encoder_quadrature.c index cd589bf1e20..086f500391c 100644 --- a/drivers/encoder/encoder_quadrature.c +++ b/drivers/encoder/encoder_quadrature.c @@ -22,7 +22,7 @@ #endif #undef ENCODER_DEFAULT_PIN_API_IMPL -#if defined(ENCODERS_PAD_A) && defined(ENCODERS_PAD_B) +#if defined(ENCODER_A_PINS) && defined(ENCODER_B_PINS) // Inform the quadrature driver that it needs to implement pin init/read functions # define ENCODER_DEFAULT_PIN_API_IMPL #endif @@ -34,8 +34,8 @@ __attribute__((weak)) uint8_t encoder_quadrature_read_pin(uint8_t index, bool pa #ifdef ENCODER_DEFAULT_PIN_API_IMPL -static pin_t encoders_pad_a[NUM_ENCODERS_MAX_PER_SIDE] = ENCODERS_PAD_A; -static pin_t encoders_pad_b[NUM_ENCODERS_MAX_PER_SIDE] = ENCODERS_PAD_B; +static pin_t encoders_pad_a[NUM_ENCODERS_MAX_PER_SIDE] = ENCODER_A_PINS; +static pin_t encoders_pad_b[NUM_ENCODERS_MAX_PER_SIDE] = ENCODER_B_PINS; __attribute__((weak)) void encoder_wait_pullup_charge(void) { wait_us(100); @@ -123,25 +123,25 @@ void encoder_driver_init(void) { // here, but it's the simplest solution. memset(encoder_state, 0, sizeof(encoder_state)); memset(encoder_pulses, 0, sizeof(encoder_pulses)); - const pin_t encoders_pad_a_left[] = ENCODERS_PAD_A; - const pin_t encoders_pad_b_left[] = ENCODERS_PAD_B; + const pin_t encoders_pad_a_left[] = ENCODER_A_PINS; + const pin_t encoders_pad_b_left[] = ENCODER_B_PINS; for (uint8_t i = 0; i < thisCount; i++) { encoders_pad_a[i] = encoders_pad_a_left[i]; encoders_pad_b[i] = encoders_pad_b_left[i]; } #endif -#if defined(SPLIT_KEYBOARD) && defined(ENCODERS_PAD_A_RIGHT) && defined(ENCODERS_PAD_B_RIGHT) +#if defined(SPLIT_KEYBOARD) && defined(ENCODER_A_PINS_RIGHT) && defined(ENCODER_B_PINS_RIGHT) // Re-initialise the pads if it's the right-hand side if (!isLeftHand) { - const pin_t encoders_pad_a_right[] = ENCODERS_PAD_A_RIGHT; - const pin_t encoders_pad_b_right[] = ENCODERS_PAD_B_RIGHT; + const pin_t encoders_pad_a_right[] = ENCODER_A_PINS_RIGHT; + const pin_t encoders_pad_b_right[] = ENCODER_B_PINS_RIGHT; for (uint8_t i = 0; i < thisCount; i++) { encoders_pad_a[i] = encoders_pad_a_right[i]; encoders_pad_b[i] = encoders_pad_b_right[i]; } } -#endif // defined(SPLIT_KEYBOARD) && defined(ENCODERS_PAD_A_RIGHT) && defined(ENCODERS_PAD_B_RIGHT) +#endif // defined(SPLIT_KEYBOARD) && defined(ENCODER_A_PINS_RIGHT) && defined(ENCODER_B_PINS_RIGHT) // Encoder resolutions is defined differently in config.h, so concatenate #if defined(SPLIT_KEYBOARD) && defined(ENCODER_RESOLUTIONS) diff --git a/keyboards/dailycraft/wings42/rev2/keymaps/via/config.h b/keyboards/dailycraft/wings42/rev2/keymaps/via/config.h index 3e0c8d146af..6a9ab04738d 100644 --- a/keyboards/dailycraft/wings42/rev2/keymaps/via/config.h +++ b/keyboards/dailycraft/wings42/rev2/keymaps/via/config.h @@ -15,6 +15,6 @@ */ #pragma once -#define ENCODERS_PAD_A { B5, B6 } -#define ENCODERS_PAD_B { B4, B2 } +#define ENCODER_A_PINS { B5, B6 } +#define ENCODER_B_PINS { B4, B2 } #define ENCODER_RESOLUTION 4 diff --git a/keyboards/handwired/sick68/keymaps/via/config.h b/keyboards/handwired/sick68/keymaps/via/config.h index 4ce1e3e7859..bf6fd3ea4f7 100644 --- a/keyboards/handwired/sick68/keymaps/via/config.h +++ b/keyboards/handwired/sick68/keymaps/via/config.h @@ -15,6 +15,6 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#define ENCODERS_PAD_A { F0 } -#define ENCODERS_PAD_B { F1 } +#define ENCODER_A_PINS { F0 } +#define ENCODER_B_PINS { F1 } #define ENCODER_RESOLUTION 4 diff --git a/keyboards/kapcave/gskt00/keymaps/default-poly/config.h b/keyboards/kapcave/gskt00/keymaps/default-poly/config.h index 40a7c6ec47e..9d03a669c85 100644 --- a/keyboards/kapcave/gskt00/keymaps/default-poly/config.h +++ b/keyboards/kapcave/gskt00/keymaps/default-poly/config.h @@ -16,8 +16,8 @@ along with this program. If not, see . */ #pragma once -#define ENCODERS_PAD_A { D5 } -#define ENCODERS_PAD_B { D3 } +#define ENCODER_A_PINS { D5 } +#define ENCODER_B_PINS { D3 } #define WS2812_DI_PIN D0 #define RGBLIGHT_EFFECT_BREATHING diff --git a/keyboards/pica40/rev2/rev2.c b/keyboards/pica40/rev2/rev2.c index 0ba9a537341..b5d79508fca 100644 --- a/keyboards/pica40/rev2/rev2.c +++ b/keyboards/pica40/rev2/rev2.c @@ -6,8 +6,8 @@ #ifdef ENCODER_ENABLE // code based on encoder.c -#define ENCODER_PIN_A (((pin_t[])ENCODERS_PAD_A)[0]) -#define ENCODER_PIN_B (((pin_t[])ENCODERS_PAD_B)[0]) +#define ENCODER_PIN_A (((pin_t[])ENCODER_A_PINS)[0]) +#define ENCODER_PIN_B (((pin_t[])ENCODER_B_PINS)[0]) // custom handler that returns encoder B pin status from slave side void encoder_sync_slave_handler(uint8_t in_buflen, const void *in_data, uint8_t out_buflen, void *out_data) { diff --git a/keyboards/ploopyco/mouse/config.h b/keyboards/ploopyco/mouse/config.h index 0375a8875a4..0f8774dcd7f 100644 --- a/keyboards/ploopyco/mouse/config.h +++ b/keyboards/ploopyco/mouse/config.h @@ -38,5 +38,5 @@ /* Custom encoder needs to specify just how many encoders we have */ #define NUM_ENCODERS 1 -#define ENCODERS_PAD_A { F0 } -#define ENCODERS_PAD_B { F4 } +#define ENCODER_A_PINS { F0 } +#define ENCODER_B_PINS { F4 } diff --git a/keyboards/ploopyco/ploopyco.c b/keyboards/ploopyco/ploopyco.c index e4726238f26..a6f76203d64 100644 --- a/keyboards/ploopyco/ploopyco.c +++ b/keyboards/ploopyco/ploopyco.c @@ -71,8 +71,8 @@ float scroll_accumulated_v = 0; #ifdef ENCODER_ENABLE uint16_t lastScroll = 0; // Previous confirmed wheel event uint16_t lastMidClick = 0; // Stops scrollwheel from being read if it was pressed -pin_t encoder_pins_a[1] = ENCODERS_PAD_A; -pin_t encoder_pins_b[1] = ENCODERS_PAD_B; +pin_t encoder_pins_a[1] = ENCODER_A_PINS; +pin_t encoder_pins_b[1] = ENCODER_B_PINS; bool debug_encoder = false; bool encoder_update_kb(uint8_t index, bool clockwise) { diff --git a/keyboards/ploopyco/trackball/config.h b/keyboards/ploopyco/trackball/config.h index 80457d062aa..2aac27437ab 100644 --- a/keyboards/ploopyco/trackball/config.h +++ b/keyboards/ploopyco/trackball/config.h @@ -38,5 +38,5 @@ /* Custom encoder needs to specify just how many encoders we have */ #define NUM_ENCODERS 1 -#define ENCODERS_PAD_A { F0 } -#define ENCODERS_PAD_B { F4 } +#define ENCODER_A_PINS { F0 } +#define ENCODER_B_PINS { F4 } diff --git a/keyboards/ploopyco/trackball_mini/config.h b/keyboards/ploopyco/trackball_mini/config.h index c5d2d5694e4..2e0b570bbae 100644 --- a/keyboards/ploopyco/trackball_mini/config.h +++ b/keyboards/ploopyco/trackball_mini/config.h @@ -38,5 +38,5 @@ /* Custom encoder needs to specify just how many encoders we have */ #define NUM_ENCODERS 1 -#define ENCODERS_PAD_A { F0 } -#define ENCODERS_PAD_B { F4 } +#define ENCODER_A_PINS { F0 } +#define ENCODER_B_PINS { F4 } diff --git a/keyboards/ploopyco/trackball_thumb/config.h b/keyboards/ploopyco/trackball_thumb/config.h index 631456d9d31..f03ffc76990 100644 --- a/keyboards/ploopyco/trackball_thumb/config.h +++ b/keyboards/ploopyco/trackball_thumb/config.h @@ -42,5 +42,5 @@ /* Custom encoder needs to specify just how many encoders we have */ #define NUM_ENCODERS 1 -#define ENCODERS_PAD_A { F4 } -#define ENCODERS_PAD_B { F0 } +#define ENCODER_A_PINS { F4 } +#define ENCODER_B_PINS { F0 } diff --git a/keyboards/rgbkb/sol/keymaps/default/keymap.c b/keyboards/rgbkb/sol/keymaps/default/keymap.c index 4a6511cbfc7..8997e9a582e 100644 --- a/keyboards/rgbkb/sol/keymaps/default/keymap.c +++ b/keyboards/rgbkb/sol/keymaps/default/keymap.c @@ -201,7 +201,7 @@ const rgb_matrix_f rgb_matrix_functions[6][2] = { #ifdef ENCODER_ENABLE -static pin_t encoders_pad_a[] = ENCODERS_PAD_A; +static pin_t encoders_pad_a[] = ENCODER_A_PINS; #define NUMBER_OF_ENCODERS ARRAY_SIZE(encoders_pad_a) const uint16_t PROGMEM encoders[][NUMBER_OF_ENCODERS * 2][2] = { diff --git a/keyboards/rgbkb/sol/rev2/config.h b/keyboards/rgbkb/sol/rev2/config.h index ab5150051a0..5867c6dfe36 100644 --- a/keyboards/rgbkb/sol/rev2/config.h +++ b/keyboards/rgbkb/sol/rev2/config.h @@ -49,12 +49,12 @@ along with this program. If not, see . // Encoder support #ifndef EXTRA_ENCODERS_ENABLE -#define ENCODERS_PAD_A { D2 } -#define ENCODERS_PAD_B { D6 } +#define ENCODER_A_PINS { D2 } +#define ENCODER_B_PINS { D6 } #else #ifdef OLED_ENABLE #error Extra encoders cannot be enabled at the same time as the OLED Driver as they use the same pins. #endif -#define ENCODERS_PAD_A { D2, D1, B0 } -#define ENCODERS_PAD_B { D6, B1, D0 } +#define ENCODER_A_PINS { D2, D1, B0 } +#define ENCODER_B_PINS { D6, B1, D0 } #endif diff --git a/keyboards/terrazzo/readme.md b/keyboards/terrazzo/readme.md index e0f4f3457f0..828819f7b45 100644 --- a/keyboards/terrazzo/readme.md +++ b/keyboards/terrazzo/readme.md @@ -82,8 +82,8 @@ Change pinouts, Pro Micro does not have the "F0" pin. Set encoder to just top or bottom position. ``` -#define ENCODERS_PAD_A { C6 } -#define ENCODERS_PAD_B { D4 } +#define ENCODER_A_PINS { C6 } +#define ENCODER_B_PINS { D4 } ``` ## Encoder Setup diff --git a/lib/python/qmk/cli/generate/config_h.py b/lib/python/qmk/cli/generate/config_h.py index fc681300a37..d613f7b92c1 100755 --- a/lib/python/qmk/cli/generate/config_h.py +++ b/lib/python/qmk/cli/generate/config_h.py @@ -135,8 +135,8 @@ def generate_encoder_config(encoder_json, config_h_lines, postfix=''): b_pads.append(encoder["pin_b"]) resolutions.append(encoder.get("resolution", None)) - config_h_lines.append(generate_define(f'ENCODERS_PAD_A{postfix}', f'{{ {", ".join(a_pads)} }}')) - config_h_lines.append(generate_define(f'ENCODERS_PAD_B{postfix}', f'{{ {", ".join(b_pads)} }}')) + config_h_lines.append(generate_define(f'ENCODER_A_PINS{postfix}', f'{{ {", ".join(a_pads)} }}')) + config_h_lines.append(generate_define(f'ENCODER_B_PINS{postfix}', f'{{ {", ".join(b_pads)} }}')) if None in resolutions: cli.log.debug(f"Unable to generate ENCODER_RESOLUTION{postfix} configuration") diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py index 091a11854c0..5b3b2490150 100644 --- a/lib/python/qmk/info.py +++ b/lib/python/qmk/info.py @@ -375,8 +375,8 @@ def _extract_audio(info_data, config_c): def _extract_encoders_values(config_c, postfix=''): """Common encoder extraction logic """ - a_pad = config_c.get(f'ENCODERS_PAD_A{postfix}', '').replace(' ', '')[1:-1] - b_pad = config_c.get(f'ENCODERS_PAD_B{postfix}', '').replace(' ', '')[1:-1] + a_pad = config_c.get(f'ENCODER_A_PINS{postfix}', '').replace(' ', '')[1:-1] + b_pad = config_c.get(f'ENCODER_B_PINS{postfix}', '').replace(' ', '')[1:-1] resolutions = config_c.get(f'ENCODER_RESOLUTIONS{postfix}', '').replace(' ', '')[1:-1] default_resolution = config_c.get('ENCODER_RESOLUTION', None) diff --git a/quantum/encoder.h b/quantum/encoder.h index 317a91f1da5..1d2f1f46c7f 100644 --- a/quantum/encoder.h +++ b/quantum/encoder.h @@ -22,6 +22,21 @@ #include "gpio.h" #include "util.h" +// ======== DEPRECATED DEFINES - DO NOT USE ======== +#ifdef ENCODERS_PAD_A +# define ENCODER_A_PINS ENCODERS_PAD_A +#endif +#ifdef ENCODERS_PAD_B +# define ENCODER_B_PINS ENCODERS_PAD_B +#endif +#ifdef ENCODERS_PAD_A_RIGHT +# define ENCODER_A_PINS_RIGHT ENCODERS_PAD_A_RIGHT +#endif +#ifdef ENCODERS_PAD_B_RIGHT +# define ENCODER_B_PINS_RIGHT ENCODERS_PAD_B_RIGHT +#endif +// ======== + #ifdef ENCODER_ENABLE __attribute__((weak)) bool should_process_encoder(void); @@ -36,16 +51,16 @@ bool encoder_update_user(uint8_t index, bool clockwise); # ifdef SPLIT_KEYBOARD -# if defined(ENCODERS_PAD_A_RIGHT) +# if defined(ENCODER_A_PINS_RIGHT) # ifndef NUM_ENCODERS_LEFT -# define NUM_ENCODERS_LEFT ARRAY_SIZE(((pin_t[])ENCODERS_PAD_A)) +# define NUM_ENCODERS_LEFT ARRAY_SIZE(((pin_t[])ENCODER_A_PINS)) # endif # ifndef NUM_ENCODERS_RIGHT -# define NUM_ENCODERS_RIGHT ARRAY_SIZE(((pin_t[])ENCODERS_PAD_A_RIGHT)) +# define NUM_ENCODERS_RIGHT ARRAY_SIZE(((pin_t[])ENCODER_A_PINS_RIGHT)) # endif # else # ifndef NUM_ENCODERS_LEFT -# define NUM_ENCODERS_LEFT ARRAY_SIZE(((pin_t[])ENCODERS_PAD_A)) +# define NUM_ENCODERS_LEFT ARRAY_SIZE(((pin_t[])ENCODER_A_PINS)) # endif # ifndef NUM_ENCODERS_RIGHT # define NUM_ENCODERS_RIGHT NUM_ENCODERS_LEFT @@ -58,19 +73,13 @@ bool encoder_update_user(uint8_t index, bool clockwise); # else // SPLIT_KEYBOARD # ifndef NUM_ENCODERS -# define NUM_ENCODERS ARRAY_SIZE(((pin_t[])ENCODERS_PAD_A)) +# define NUM_ENCODERS ARRAY_SIZE(((pin_t[])ENCODER_A_PINS)) # endif # define NUM_ENCODERS_LEFT NUM_ENCODERS # define NUM_ENCODERS_RIGHT 0 # endif // SPLIT_KEYBOARD -# ifndef NUM_ENCODERS -# define NUM_ENCODERS 0 -# define NUM_ENCODERS_LEFT 0 -# define NUM_ENCODERS_RIGHT 0 -# endif // NUM_ENCODERS - # define NUM_ENCODERS_MAX_PER_SIDE MAX(NUM_ENCODERS_LEFT, NUM_ENCODERS_RIGHT) # ifndef MAX_QUEUED_ENCODER_EVENTS diff --git a/quantum/encoder/tests/config_mock.h b/quantum/encoder/tests/config_mock.h index 9eb59ddc881..b5a1537d8a2 100644 --- a/quantum/encoder/tests/config_mock.h +++ b/quantum/encoder/tests/config_mock.h @@ -7,9 +7,9 @@ #define MATRIX_COLS 1 /* Here, "pins" from 0 to 31 are allowed. */ -#define ENCODERS_PAD_A \ +#define ENCODER_A_PINS \ { 0 } -#define ENCODERS_PAD_B \ +#define ENCODER_B_PINS \ { 1 } #ifdef __cplusplus diff --git a/quantum/encoder/tests/config_mock_split_left_eq_right.h b/quantum/encoder/tests/config_mock_split_left_eq_right.h index ea795657ef1..a4aa051ef1a 100644 --- a/quantum/encoder/tests/config_mock_split_left_eq_right.h +++ b/quantum/encoder/tests/config_mock_split_left_eq_right.h @@ -7,13 +7,13 @@ #define MATRIX_COLS 1 /* Here, "pins" from 0 to 31 are allowed. */ -#define ENCODERS_PAD_A \ +#define ENCODER_A_PINS \ { 0, 2 } -#define ENCODERS_PAD_B \ +#define ENCODER_B_PINS \ { 1, 3 } -#define ENCODERS_PAD_A_RIGHT \ +#define ENCODER_A_PINS_RIGHT \ { 4, 6 } -#define ENCODERS_PAD_B_RIGHT \ +#define ENCODER_B_PINS_RIGHT \ { 5, 7 } #ifdef __cplusplus diff --git a/quantum/encoder/tests/config_mock_split_left_gt_right.h b/quantum/encoder/tests/config_mock_split_left_gt_right.h index abcfe039189..77190797add 100644 --- a/quantum/encoder/tests/config_mock_split_left_gt_right.h +++ b/quantum/encoder/tests/config_mock_split_left_gt_right.h @@ -7,13 +7,13 @@ #define MATRIX_COLS 1 /* Here, "pins" from 0 to 31 are allowed. */ -#define ENCODERS_PAD_A \ +#define ENCODER_A_PINS \ { 0, 2, 4 } -#define ENCODERS_PAD_B \ +#define ENCODER_B_PINS \ { 1, 3, 5 } -#define ENCODERS_PAD_A_RIGHT \ +#define ENCODER_A_PINS_RIGHT \ { 6, 8 } -#define ENCODERS_PAD_B_RIGHT \ +#define ENCODER_B_PINS_RIGHT \ { 7, 9 } #ifdef __cplusplus diff --git a/quantum/encoder/tests/config_mock_split_left_lt_right.h b/quantum/encoder/tests/config_mock_split_left_lt_right.h index 075c774b0d1..61808e866e1 100644 --- a/quantum/encoder/tests/config_mock_split_left_lt_right.h +++ b/quantum/encoder/tests/config_mock_split_left_lt_right.h @@ -7,13 +7,13 @@ #define MATRIX_COLS 1 /* Here, "pins" from 0 to 31 are allowed. */ -#define ENCODERS_PAD_A \ +#define ENCODER_A_PINS \ { 0, 2 } -#define ENCODERS_PAD_B \ +#define ENCODER_B_PINS \ { 1, 3 } -#define ENCODERS_PAD_A_RIGHT \ +#define ENCODER_A_PINS_RIGHT \ { 4, 6, 8 } -#define ENCODERS_PAD_B_RIGHT \ +#define ENCODER_B_PINS_RIGHT \ { 5, 7, 9 } #ifdef __cplusplus diff --git a/quantum/encoder/tests/config_mock_split_no_left.h b/quantum/encoder/tests/config_mock_split_no_left.h index dfd8358929b..599e584ff16 100644 --- a/quantum/encoder/tests/config_mock_split_no_left.h +++ b/quantum/encoder/tests/config_mock_split_no_left.h @@ -7,13 +7,13 @@ #define MATRIX_COLS 1 /* Here, "pins" from 0 to 31 are allowed. */ -#define ENCODERS_PAD_A \ +#define ENCODER_A_PINS \ {} -#define ENCODERS_PAD_B \ +#define ENCODER_B_PINS \ {} -#define ENCODERS_PAD_A_RIGHT \ +#define ENCODER_A_PINS_RIGHT \ { 0, 2 } -#define ENCODERS_PAD_B_RIGHT \ +#define ENCODER_B_PINS_RIGHT \ { 1, 3 } #ifdef __cplusplus diff --git a/quantum/encoder/tests/config_mock_split_no_right.h b/quantum/encoder/tests/config_mock_split_no_right.h index 5683eade8c9..c3f753014c0 100644 --- a/quantum/encoder/tests/config_mock_split_no_right.h +++ b/quantum/encoder/tests/config_mock_split_no_right.h @@ -7,13 +7,13 @@ #define MATRIX_COLS 1 /* Here, "pins" from 0 to 31 are allowed. */ -#define ENCODERS_PAD_A \ +#define ENCODER_A_PINS \ { 0, 2 } -#define ENCODERS_PAD_B \ +#define ENCODER_B_PINS \ { 1, 3 } -#define ENCODERS_PAD_A_RIGHT \ +#define ENCODER_A_PINS_RIGHT \ {} -#define ENCODERS_PAD_B_RIGHT \ +#define ENCODER_B_PINS_RIGHT \ {} #ifdef __cplusplus diff --git a/quantum/encoder/tests/config_mock_split_role.h b/quantum/encoder/tests/config_mock_split_role.h index ea795657ef1..a4aa051ef1a 100644 --- a/quantum/encoder/tests/config_mock_split_role.h +++ b/quantum/encoder/tests/config_mock_split_role.h @@ -7,13 +7,13 @@ #define MATRIX_COLS 1 /* Here, "pins" from 0 to 31 are allowed. */ -#define ENCODERS_PAD_A \ +#define ENCODER_A_PINS \ { 0, 2 } -#define ENCODERS_PAD_B \ +#define ENCODER_B_PINS \ { 1, 3 } -#define ENCODERS_PAD_A_RIGHT \ +#define ENCODER_A_PINS_RIGHT \ { 4, 6 } -#define ENCODERS_PAD_B_RIGHT \ +#define ENCODER_B_PINS_RIGHT \ { 5, 7 } #ifdef __cplusplus From f8596b40a4bb15a1881138baa8b8787277e2e622 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 3 Jul 2024 18:35:54 +1000 Subject: [PATCH 034/204] Normalise mouse keycodes (#23975) --- data/constants/keycodes/keycodes_0.0.5.hjson | 0 .../keycodes/keycodes_0.0.5_basic.hjson | 175 ++++++++++++++++++ docs/features/encoders.md | 8 +- docs/features/mouse_keys.md | 82 ++++---- docs/features/repeat_key.md | 8 +- docs/keycodes.md | 39 ++-- drivers/sensors/cirque_pinnacle_gestures.h | 2 +- .../lib/satisfaction75/satisfaction_encoder.c | 6 +- keyboards/dichotomy/keymaps/default/keymap.c | 16 +- quantum/action.c | 6 +- quantum/encoder.c | 4 +- quantum/keycode.h | 8 +- quantum/keycodes.h | 80 ++++---- quantum/mousekey.c | 112 +++++------ quantum/pointing_device/pointing_device.c | 2 +- .../pointing_device_auto_mouse.h | 2 +- quantum/quantum_keycodes_legacy.h | 39 ++++ quantum/repeat_key.c | 8 +- tests/test_common/keycode_table.cpp | 38 ++-- 19 files changed, 426 insertions(+), 209 deletions(-) create mode 100644 data/constants/keycodes/keycodes_0.0.5.hjson create mode 100644 data/constants/keycodes/keycodes_0.0.5_basic.hjson diff --git a/data/constants/keycodes/keycodes_0.0.5.hjson b/data/constants/keycodes/keycodes_0.0.5.hjson new file mode 100644 index 00000000000..e69de29bb2d diff --git a/data/constants/keycodes/keycodes_0.0.5_basic.hjson b/data/constants/keycodes/keycodes_0.0.5_basic.hjson new file mode 100644 index 00000000000..79b6bf6596e --- /dev/null +++ b/data/constants/keycodes/keycodes_0.0.5_basic.hjson @@ -0,0 +1,175 @@ +{ + "keycodes": { + "0x00CD": { + "group": "mouse", + "key": "QK_MOUSE_CURSOR_UP", + "label": "Mouse cursor up", + "aliases": [ + "!reset!", + "MS_UP" + ] + }, + "0x00CE": { + "group": "mouse", + "key": "QK_MOUSE_CURSOR_DOWN", + "label": "Mouse cursor down", + "aliases": [ + "!reset!", + "MS_DOWN" + ] + }, + "0x00CF": { + "group": "mouse", + "key": "QK_MOUSE_CURSOR_LEFT", + "label": "Mouse cursor left", + "aliases": [ + "!reset!", + "MS_LEFT" + ] + }, + "0x00D0": { + "group": "mouse", + "key": "QK_MOUSE_CURSOR_RIGHT", + "label": "Mouse cursor right", + "aliases": [ + "!reset!", + "MS_RGHT" + ] + }, + "0x00D1": { + "group": "mouse", + "key": "QK_MOUSE_BUTTON_1", + "label": "Mouse button 1", + "aliases": [ + "!reset!", + "MS_BTN1" + ] + }, + "0x00D2": { + "group": "mouse", + "key": "QK_MOUSE_BUTTON_2", + "label": "Mouse button 2", + "aliases": [ + "!reset!", + "MS_BTN2" + ] + }, + "0x00D3": { + "group": "mouse", + "key": "QK_MOUSE_BUTTON_3", + "label": "Mouse button 3", + "aliases": [ + "!reset!", + "MS_BTN3" + ] + }, + "0x00D4": { + "group": "mouse", + "key": "QK_MOUSE_BUTTON_4", + "label": "Mouse button 4", + "aliases": [ + "!reset!", + "MS_BTN4" + ] + }, + "0x00D5": { + "group": "mouse", + "key": "QK_MOUSE_BUTTON_5", + "label": "Mouse button 5", + "aliases": [ + "!reset!", + "MS_BTN5" + ] + }, + "0x00D6": { + "group": "mouse", + "key": "QK_MOUSE_BUTTON_6", + "label": "Mouse button 6", + "aliases": [ + "!reset!", + "MS_BTN6" + ] + }, + "0x00D7": { + "group": "mouse", + "key": "QK_MOUSE_BUTTON_7", + "label": "Mouse button 7", + "aliases": [ + "!reset!", + "MS_BTN7" + ] + }, + "0x00D8": { + "group": "mouse", + "key": "QK_MOUSE_BUTTON_8", + "label": "Mouse button 8", + "aliases": [ + "!reset!", + "MS_BTN8" + ] + }, + "0x00D9": { + "group": "mouse", + "key": "QK_MOUSE_WHEEL_UP", + "label": "Mouse wheel up", + "aliases": [ + "!reset!", + "MS_WHLU" + ] + }, + "0x00DA": { + "group": "mouse", + "key": "QK_MOUSE_WHEEL_DOWN", + "label": "Mouse wheel down", + "aliases": [ + "!reset!", + "MS_WHLD" + ] + }, + "0x00DB": { + "group": "mouse", + "key": "QK_MOUSE_WHEEL_LEFT", + "label": "Mouse wheel left", + "aliases": [ + "!reset!", + "MS_WHLL" + ] + }, + "0x00DC": { + "group": "mouse", + "key": "QK_MOUSE_WHEEL_RIGHT", + "label": "Mouse wheel right", + "aliases": [ + "!reset!", + "MS_WHLR" + ] + }, + "0x00DD": { + "group": "mouse", + "key": "QK_MOUSE_ACCELERATION_0", + "label": "Set mouse acceleration to 0", + "aliases": [ + "!reset!", + "MS_ACL0" + ] + }, + "0x00DE": { + "group": "mouse", + "key": "QK_MOUSE_ACCELERATION_1", + "label": "Set mouse acceleration to 1", + "aliases": [ + "!reset!", + "MS_ACL1" + ] + }, + "0x00DF": { + "group": "mouse", + "key": "QK_MOUSE_ACCELERATION_2", + "label": "Set mouse acceleration to 2", + "aliases": [ + "!reset!", + "MS_ACL2" + ] + } + } +} diff --git a/docs/features/encoders.md b/docs/features/encoders.md index eea70dafecf..73cbb4f3f3f 100644 --- a/docs/features/encoders.md +++ b/docs/features/encoders.md @@ -84,10 +84,10 @@ Your `keymap.c` will then need an encoder mapping defined (for four layers and t ```c #if defined(ENCODER_MAP_ENABLE) const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { - [0] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, - [1] = { ENCODER_CCW_CW(RGB_HUD, RGB_HUI), ENCODER_CCW_CW(RGB_SAD, RGB_SAI) }, - [2] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI), ENCODER_CCW_CW(RGB_SPD, RGB_SPI) }, - [3] = { ENCODER_CCW_CW(RGB_RMOD, RGB_MOD), ENCODER_CCW_CW(KC_RIGHT, KC_LEFT) }, + [0] = { ENCODER_CCW_CW(MS_WHLU, MS_WHLD), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [1] = { ENCODER_CCW_CW(RGB_HUD, RGB_HUI), ENCODER_CCW_CW(RGB_SAD, RGB_SAI) }, + [2] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI), ENCODER_CCW_CW(RGB_SPD, RGB_SPI) }, + [3] = { ENCODER_CCW_CW(RGB_RMOD, RGB_MOD), ENCODER_CCW_CW(KC_RIGHT, KC_LEFT) }, }; #endif ``` diff --git a/docs/features/mouse_keys.md b/docs/features/mouse_keys.md index c2b3e98f424..4cc06c992ae 100644 --- a/docs/features/mouse_keys.md +++ b/docs/features/mouse_keys.md @@ -18,27 +18,27 @@ MOUSEKEY_ENABLE = yes In your keymap you can use the following keycodes to map key presses to mouse actions: -|Key |Aliases |Description | -|----------------|---------|-----------------| -|`KC_MS_UP` |`KC_MS_U`|Move cursor up | -|`KC_MS_DOWN` |`KC_MS_D`|Move cursor down | -|`KC_MS_LEFT` |`KC_MS_L`|Move cursor left | -|`KC_MS_RIGHT` |`KC_MS_R`|Move cursor right| -|`KC_MS_BTN1` |`KC_BTN1`|Press button 1 | -|`KC_MS_BTN2` |`KC_BTN2`|Press button 2 | -|`KC_MS_BTN3` |`KC_BTN3`|Press button 3 | -|`KC_MS_BTN4` |`KC_BTN4`|Press button 4 | -|`KC_MS_BTN5` |`KC_BTN5`|Press button 5 | -|`KC_MS_BTN6` |`KC_BTN6`|Press button 6 | -|`KC_MS_BTN7` |`KC_BTN7`|Press button 7 | -|`KC_MS_BTN8` |`KC_BTN8`|Press button 8 | -|`KC_MS_WH_UP` |`KC_WH_U`|Move wheel up | -|`KC_MS_WH_DOWN` |`KC_WH_D`|Move wheel down | -|`KC_MS_WH_LEFT` |`KC_WH_L`|Move wheel left | -|`KC_MS_WH_RIGHT`|`KC_WH_R`|Move wheel right | -|`KC_MS_ACCEL0` |`KC_ACL0`|Set speed to 0 | -|`KC_MS_ACCEL1` |`KC_ACL1`|Set speed to 1 | -|`KC_MS_ACCEL2` |`KC_ACL2`|Set speed to 2 | +|Key |Aliases |Description | +|-------------------------|---------|---------------------------| +|`QK_MOUSE_CURSOR_UP` |`MS_UP` |Mouse cursor up | +|`QK_MOUSE_CURSOR_DOWN` |`MS_DOWN`|Mouse cursor down | +|`QK_MOUSE_CURSOR_LEFT` |`MS_LEFT`|Mouse cursor left | +|`QK_MOUSE_CURSOR_RIGHT` |`MS_RGHT`|Mouse cursor right | +|`QK_MOUSE_BUTTON_1` |`MS_BTN1`|Mouse button 1 | +|`QK_MOUSE_BUTTON_2` |`MS_BTN2`|Mouse button 2 | +|`QK_MOUSE_BUTTON_3` |`MS_BTN3`|Mouse button 3 | +|`QK_MOUSE_BUTTON_4` |`MS_BTN4`|Mouse button 4 | +|`QK_MOUSE_BUTTON_5` |`MS_BTN5`|Mouse button 5 | +|`QK_MOUSE_BUTTON_6` |`MS_BTN6`|Mouse button 6 | +|`QK_MOUSE_BUTTON_7` |`MS_BTN7`|Mouse button 7 | +|`QK_MOUSE_BUTTON_8` |`MS_BTN8`|Mouse button 8 | +|`QK_MOUSE_WHEEL_UP` |`MS_WHLU`|Mouse wheel up | +|`QK_MOUSE_WHEEL_DOWN` |`MS_WHLD`|Mouse wheel down | +|`QK_MOUSE_WHEEL_LEFT` |`MS_WHLL`|Mouse wheel left | +|`QK_MOUSE_WHEEL_RIGHT` |`MS_WHLR`|Mouse wheel right | +|`QK_MOUSE_ACCELERATION_0`|`MS_ACL0`|Set mouse acceleration to 0| +|`QK_MOUSE_ACCELERATION_1`|`MS_ACL1`|Set mouse acceleration to 1| +|`QK_MOUSE_ACCELERATION_2`|`MS_ACL2`|Set mouse acceleration to 2| ## Configuring mouse keys @@ -106,17 +106,17 @@ Tips: ### Constant mode -In this mode you can define multiple different speeds for both the cursor and the mouse wheel. There is no acceleration. `KC_ACL0`, `KC_ACL1` and `KC_ACL2` change the cursor and scroll speed to their respective setting. +In this mode you can define multiple different speeds for both the cursor and the mouse wheel. There is no acceleration. `MS_ACL0`, `MS_ACL1` and `MS_ACL2` change the cursor and scroll speed to their respective setting. You can choose whether speed selection is momentary or tap-to-select: * **Momentary:** The chosen speed is only active while you hold the respective key. When the key is raised, mouse keys returns to the unmodified speed. -* **Tap-to-select:** The chosen speed is activated when you press the respective key and remains active even after the key has been raised. The default speed is that of `KC_ACL1`. There is no unmodified speed. +* **Tap-to-select:** The chosen speed is activated when you press the respective key and remains active even after the key has been raised. The default speed is that of `MS_ACL1`. There is no unmodified speed. The default speeds from slowest to fastest are as follows: -* **Momentary:** `KC_ACL0` < `KC_ACL1` < *unmodified* < `KC_ACL2` -* **Tap-to-select:** `KC_ACL0` < `KC_ACL1` < `KC_ACL2` +* **Momentary:** `MS_ACL0` < `MS_ACL1` < *unmodified* < `MS_ACL2` +* **Tap-to-select:** `MS_ACL0` < `MS_ACL1` < `MS_ACL2` To use constant speed mode, you must at least define `MK_3_SPEED` in your keymap’s `config.h` file: @@ -138,32 +138,32 @@ Use the following settings if you want to adjust cursor movement or scrolling: |`MK_MOMENTARY_ACCEL` |*Not defined*|Enable momentary speed selection | |`MK_C_OFFSET_UNMOD` |16 |Cursor offset per movement (unmodified) | |`MK_C_INTERVAL_UNMOD`|16 |Time between cursor movements (unmodified) | -|`MK_C_OFFSET_0` |1 |Cursor offset per movement (`KC_ACL0`) | -|`MK_C_INTERVAL_0` |32 |Time between cursor movements (`KC_ACL0`) | -|`MK_C_OFFSET_1` |4 |Cursor offset per movement (`KC_ACL1`) | -|`MK_C_INTERVAL_1` |16 |Time between cursor movements (`KC_ACL1`) | -|`MK_C_OFFSET_2` |32 |Cursor offset per movement (`KC_ACL2`) | -|`MK_C_INTERVAL_2` |16 |Time between cursor movements (`KC_ACL2`) | +|`MK_C_OFFSET_0` |1 |Cursor offset per movement (`MS_ACL0`) | +|`MK_C_INTERVAL_0` |32 |Time between cursor movements (`MS_ACL0`) | +|`MK_C_OFFSET_1` |4 |Cursor offset per movement (`MS_ACL1`) | +|`MK_C_INTERVAL_1` |16 |Time between cursor movements (`MS_ACL1`) | +|`MK_C_OFFSET_2` |32 |Cursor offset per movement (`MS_ACL2`) | +|`MK_C_INTERVAL_2` |16 |Time between cursor movements (`MS_ACL2`) | |`MK_W_OFFSET_UNMOD` |1 |Scroll steps per scroll action (unmodified)| |`MK_W_INTERVAL_UNMOD`|40 |Time between scroll steps (unmodified) | -|`MK_W_OFFSET_0` |1 |Scroll steps per scroll action (`KC_ACL0`) | -|`MK_W_INTERVAL_0` |360 |Time between scroll steps (`KC_ACL0`) | -|`MK_W_OFFSET_1` |1 |Scroll steps per scroll action (`KC_ACL1`) | -|`MK_W_INTERVAL_1` |120 |Time between scroll steps (`KC_ACL1`) | -|`MK_W_OFFSET_2` |1 |Scroll steps per scroll action (`KC_ACL2`) | -|`MK_W_INTERVAL_2` |20 |Time between scroll steps (`KC_ACL2`) | +|`MK_W_OFFSET_0` |1 |Scroll steps per scroll action (`MS_ACL0`) | +|`MK_W_INTERVAL_0` |360 |Time between scroll steps (`MS_ACL0`) | +|`MK_W_OFFSET_1` |1 |Scroll steps per scroll action (`MS_ACL1`) | +|`MK_W_INTERVAL_1` |120 |Time between scroll steps (`MS_ACL1`) | +|`MK_W_OFFSET_2` |1 |Scroll steps per scroll action (`MS_ACL2`) | +|`MK_W_INTERVAL_2` |20 |Time between scroll steps (`MS_ACL2`) | ### Combined mode -This mode functions like **Accelerated** mode, however, you can hold `KC_ACL0`, `KC_ACL1` and `KC_ACL2` +This mode functions like **Accelerated** mode, however, you can hold `MS_ACL0`, `MS_ACL1` and `MS_ACL2` to momentarily (while held) set the cursor and scroll speeds to constant speeds. When no acceleration keys are held, this mode is identical to **Accelerated** mode, and can be modified using all of the relevant settings. -* **KC_ACL0:** This acceleration sets your cursor to the slowest possible speed. This is useful for very +* **MS_ACL0:** This acceleration sets your cursor to the slowest possible speed. This is useful for very small and detailed movements of the cursor. -* **KC_ACL1:** This acceleration sets your cursor to half the maximum (user defined) speed. -* **KC_ACL2:** This acceleration sets your cursor to the maximum (computer defined) speed. This is +* **MS_ACL1:** This acceleration sets your cursor to half the maximum (user defined) speed. +* **MS_ACL2:** This acceleration sets your cursor to the maximum (computer defined) speed. This is useful for moving the cursor large distances without much accuracy. To use combined speed mode, you must at least define `MK_COMBINED` in your keymap’s `config.h` file: diff --git a/docs/features/repeat_key.md b/docs/features/repeat_key.md index 53495e0f4d6..7f2bdc44e65 100644 --- a/docs/features/repeat_key.md +++ b/docs/features/repeat_key.md @@ -60,10 +60,10 @@ with mods, like Ctrl + Left ↔ Ctrl + Right Arrow. |`KC_UP` ↔ `KC_DOWN` | Up ↔ Down Arrow | |`KC_HOME` ↔ `KC_END` | Home ↔ End | |`KC_PGUP` ↔ `KC_PGDN` | Page Up ↔ Page Down | -|`KC_MS_L` ↔ `KC_MS_R` | Mouse Cursor Left ↔ Right | -|`KC_MS_U` ↔ `KC_MS_D` | Mouse Cursor Up ↔ Down | -|`KC_WH_L` ↔ `KC_WH_R` | Mouse Wheel Left ↔ Right | -|`KC_WH_U` ↔ `KC_WH_D` | Mouse Wheel Up ↔ Down | +|`MS_LEFT` ↔ `MS_RGHT` | Mouse Cursor Left ↔ Right | +|`MS_UP` ↔ `MS_DOWN` | Mouse Cursor Up ↔ Down | +|`MS_WHLL` ↔ `MS_WHLR` | Mouse Wheel Left ↔ Right | +|`MS_WHLU` ↔ `MS_WHLD` | Mouse Wheel Up ↔ Down | **Misc** diff --git a/docs/keycodes.md b/docs/keycodes.md index 4c91d98fa7a..ea8b2e7b650 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -611,24 +611,27 @@ See also: [MIDI](features/midi) See also: [Mouse Keys](features/mouse_keys) -|Key |Aliases |Description | -|----------------|---------|---------------------------| -|`KC_MS_UP` |`KC_MS_U`|Mouse Cursor Up | -|`KC_MS_DOWN` |`KC_MS_D`|Mouse Cursor Down | -|`KC_MS_LEFT` |`KC_MS_L`|Mouse Cursor Left | -|`KC_MS_RIGHT` |`KC_MS_R`|Mouse Cursor Right | -|`KC_MS_BTN1` |`KC_BTN1`|Mouse Button 1 | -|`KC_MS_BTN2` |`KC_BTN2`|Mouse Button 2 | -|`KC_MS_BTN3` |`KC_BTN3`|Mouse Button 3 | -|`KC_MS_BTN4` |`KC_BTN4`|Mouse Button 4 | -|`KC_MS_BTN5` |`KC_BTN5`|Mouse Button 5 | -|`KC_MS_WH_UP` |`KC_WH_U`|Mouse Wheel Up | -|`KC_MS_WH_DOWN` |`KC_WH_D`|Mouse Wheel Down | -|`KC_MS_WH_LEFT` |`KC_WH_L`|Mouse Wheel Left | -|`KC_MS_WH_RIGHT`|`KC_WH_R`|Mouse Wheel Right | -|`KC_MS_ACCEL0` |`KC_ACL0`|Set mouse acceleration to 0| -|`KC_MS_ACCEL1` |`KC_ACL1`|Set mouse acceleration to 1| -|`KC_MS_ACCEL2` |`KC_ACL2`|Set mouse acceleration to 2| +|Key |Aliases |Description | +|-------------------------|---------|---------------------------| +|`QK_MOUSE_CURSOR_UP` |`MS_UP` |Mouse cursor up | +|`QK_MOUSE_CURSOR_DOWN` |`MS_DOWN`|Mouse cursor down | +|`QK_MOUSE_CURSOR_LEFT` |`MS_LEFT`|Mouse cursor left | +|`QK_MOUSE_CURSOR_RIGHT` |`MS_RGHT`|Mouse cursor right | +|`QK_MOUSE_BUTTON_1` |`MS_BTN1`|Mouse button 1 | +|`QK_MOUSE_BUTTON_2` |`MS_BTN2`|Mouse button 2 | +|`QK_MOUSE_BUTTON_3` |`MS_BTN3`|Mouse button 3 | +|`QK_MOUSE_BUTTON_4` |`MS_BTN4`|Mouse button 4 | +|`QK_MOUSE_BUTTON_5` |`MS_BTN5`|Mouse button 5 | +|`QK_MOUSE_BUTTON_6` |`MS_BTN6`|Mouse button 6 | +|`QK_MOUSE_BUTTON_7` |`MS_BTN7`|Mouse button 7 | +|`QK_MOUSE_BUTTON_8` |`MS_BTN8`|Mouse button 8 | +|`QK_MOUSE_WHEEL_UP` |`MS_WHLU`|Mouse wheel up | +|`QK_MOUSE_WHEEL_DOWN` |`MS_WHLD`|Mouse wheel down | +|`QK_MOUSE_WHEEL_LEFT` |`MS_WHLL`|Mouse wheel left | +|`QK_MOUSE_WHEEL_RIGHT` |`MS_WHLR`|Mouse wheel right | +|`QK_MOUSE_ACCELERATION_0`|`MS_ACL0`|Set mouse acceleration to 0| +|`QK_MOUSE_ACCELERATION_1`|`MS_ACL1`|Set mouse acceleration to 1| +|`QK_MOUSE_ACCELERATION_2`|`MS_ACL2`|Set mouse acceleration to 2| ## Modifiers {#modifiers} diff --git a/drivers/sensors/cirque_pinnacle_gestures.h b/drivers/sensors/cirque_pinnacle_gestures.h index d2aa206b2be..1412c86f7eb 100644 --- a/drivers/sensors/cirque_pinnacle_gestures.h +++ b/drivers/sensors/cirque_pinnacle_gestures.h @@ -28,7 +28,7 @@ typedef struct { # ifndef CIRQUE_PINNACLE_TAPPING_TERM # include "action.h" # include "action_tapping.h" -# define CIRQUE_PINNACLE_TAPPING_TERM GET_TAPPING_TERM(KC_BTN1, &(keyrecord_t){}) +# define CIRQUE_PINNACLE_TAPPING_TERM GET_TAPPING_TERM(QK_MOUSE_BUTTON_1, &(keyrecord_t){}) # endif # ifndef CIRQUE_PINNACLE_TOUCH_DEBOUNCE # define CIRQUE_PINNACLE_TOUCH_DEBOUNCE (CIRQUE_PINNACLE_TAPPING_TERM * 8) diff --git a/keyboards/cannonkeys/lib/satisfaction75/satisfaction_encoder.c b/keyboards/cannonkeys/lib/satisfaction75/satisfaction_encoder.c index aab005ebd87..7e0b82e9e7a 100644 --- a/keyboards/cannonkeys/lib/satisfaction75/satisfaction_encoder.c +++ b/keyboards/cannonkeys/lib/satisfaction75/satisfaction_encoder.c @@ -101,7 +101,7 @@ uint16_t handle_encoder_clockwise(void){ mapped_code = KC_MEDIA_NEXT_TRACK; break; case ENC_MODE_SCROLL: - mapped_code = KC_WH_D; + mapped_code = QK_MOUSE_WHEEL_DOWN; break; #ifdef BACKLIGHT_ENABLE case ENC_MODE_BACKLIGHT: @@ -143,7 +143,7 @@ uint16_t handle_encoder_ccw(void){ mapped_code = KC_MEDIA_PREV_TRACK; break; case ENC_MODE_SCROLL: - mapped_code = KC_WH_U; + mapped_code = QK_MOUSE_WHEEL_UP; break; #ifdef BACKLIGHT_ENABLE case ENC_MODE_BACKLIGHT: @@ -186,7 +186,7 @@ uint16_t handle_encoder_press(void){ mapped_code = KC_MEDIA_PLAY_PAUSE; break; case ENC_MODE_SCROLL: - mapped_code = KC_BTN3; + mapped_code = QK_MOUSE_BUTTON_3; break; #ifdef BACKLIGHT_ENABLE case ENC_MODE_BACKLIGHT: diff --git a/keyboards/dichotomy/keymaps/default/keymap.c b/keyboards/dichotomy/keymaps/default/keymap.c index b83f7b82e9e..b92beb73ccc 100755 --- a/keyboards/dichotomy/keymaps/default/keymap.c +++ b/keyboards/dichotomy/keymaps/default/keymap.c @@ -28,9 +28,9 @@ enum dichotomy_keycodes NUMKEY, SFTKEY, MOUKEY, - MS_BTN1, - MS_BTN2, - MS_BTN3 + CK_MSE1, + CK_MSE2, + CK_MSE3 }; #define CUSTOM_LONGPRESS 150 @@ -46,7 +46,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { NUMKEY, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, CK_QE, SFTKEY, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MOUKEY, KC_LCTL, KC_LALT, KC_LGUI, KC_RGUI, KC_RALT, KC_RCTL, - MS_BTN3, KC_LBRC, KC_LPRN, KC_SPC, KC_SPC, KC_RPRN, KC_RBRC, MS_BTN3 + CK_MSE3, KC_LBRC, KC_LPRN, KC_SPC, KC_SPC, KC_RPRN, KC_RBRC, CK_MSE3 ), [_SF] = LAYOUT( /* Shifted layout, small changes (because angle brackets have been moved to thumb cluster buttons) */ @@ -75,7 +75,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_MS] = LAYOUT( /* Mouse layer, including buttons for clicking. */ _______, _______, _______, _______, _______, _______, KC_VOLU, KC_HOME, KC_PGUP, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, MS_BTN1, MS_BTN2, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, CK_MSE1, CK_MSE2, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_END, KC_PGDN, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______ @@ -311,7 +311,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; //mouse buttons, for 1-3, to update the mouse report: - case MS_BTN1: + case CK_MSE1: currentReport = pointing_device_get_report(); if (record->event.pressed) { if (shift_held && shift_suspended){ @@ -327,7 +327,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { pointing_device_set_report(currentReport); returnVal = false; break; - case MS_BTN2: + case CK_MSE2: currentReport = pointing_device_get_report(); if (record->event.pressed) { if (shift_held && shift_suspended){ @@ -343,7 +343,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { pointing_device_set_report(currentReport); returnVal = false; break; - case MS_BTN3: + case CK_MSE3: currentReport = pointing_device_get_report(); if (record->event.pressed) { if (shift_held && shift_suspended){ diff --git a/quantum/action.c b/quantum/action.c index 74ef55e5eb2..a39631ba3e9 100644 --- a/quantum/action.c +++ b/quantum/action.c @@ -329,7 +329,7 @@ void register_mouse(uint8_t mouse_keycode, bool pressed) { // should mousekeys send report, or does something else handle this? switch (mouse_keycode) { # if defined(PS2_MOUSE_ENABLE) || defined(POINTING_DEVICE_ENABLE) - case KC_MS_BTN1 ... KC_MS_BTN8: + case QK_MOUSE_BUTTON_1 ... QK_MOUSE_BUTTON_8: // let pointing device handle the buttons // expand if/when it handles more of the code # if defined(POINTING_DEVICE_ENABLE) @@ -351,8 +351,8 @@ void register_mouse(uint8_t mouse_keycode, bool pressed) { #ifdef PS2_MOUSE_ENABLE // make sure that ps2 mouse has button report synced - if (KC_MS_BTN1 <= mouse_keycode && mouse_keycode <= KC_MS_BTN3) { - uint8_t tmp_button_msk = MOUSE_BTN_MASK(mouse_keycode - KC_MS_BTN1); + if (QK_MOUSE_BUTTON_1 <= mouse_keycode && mouse_keycode <= QK_MOUSE_BUTTON_3) { + uint8_t tmp_button_msk = MOUSE_BTN_MASK(mouse_keycode - QK_MOUSE_BUTTON_1); tp_buttons = pressed ? tp_buttons | tmp_button_msk : tp_buttons & ~tmp_button_msk; } #endif diff --git a/quantum/encoder.c b/quantum/encoder.c index 2ddbf3ee1e0..27d7b1fc809 100644 --- a/quantum/encoder.c +++ b/quantum/encoder.c @@ -160,7 +160,7 @@ __attribute__((weak)) bool encoder_update_kb(uint8_t index, bool clockwise) { # if defined(EXTRAKEY_ENABLE) tap_code_delay(KC_VOLU, 10); # elif defined(MOUSEKEY_ENABLE) - tap_code_delay(KC_MS_WH_UP, 10); + tap_code_delay(QK_MOUSE_WHEEL_UP, 10); # else tap_code_delay(KC_PGDN, 10); # endif @@ -168,7 +168,7 @@ __attribute__((weak)) bool encoder_update_kb(uint8_t index, bool clockwise) { # if defined(EXTRAKEY_ENABLE) tap_code_delay(KC_VOLD, 10); # elif defined(MOUSEKEY_ENABLE) - tap_code_delay(KC_MS_WH_DOWN, 10); + tap_code_delay(QK_MOUSE_WHEEL_DOWN, 10); # else tap_code_delay(KC_PGUP, 10); # endif diff --git a/quantum/keycode.h b/quantum/keycode.h index df1452d2965..4ff6894a011 100644 --- a/quantum/keycode.h +++ b/quantum/keycode.h @@ -29,10 +29,10 @@ along with this program. If not, see . #define IS_ANY(code) (KC_A <= (code) && (code) <= 0xFF) #define IS_MOUSEKEY(code) IS_MOUSE_KEYCODE(code) -#define IS_MOUSEKEY_MOVE(code) (KC_MS_UP <= (code) && (code) <= KC_MS_RIGHT) -#define IS_MOUSEKEY_BUTTON(code) (KC_MS_BTN1 <= (code) && (code) <= KC_MS_BTN8) -#define IS_MOUSEKEY_WHEEL(code) (KC_MS_WH_UP <= (code) && (code) <= KC_MS_WH_RIGHT) -#define IS_MOUSEKEY_ACCEL(code) (KC_MS_ACCEL0 <= (code) && (code) <= KC_MS_ACCEL2) +#define IS_MOUSEKEY_MOVE(code) (QK_MOUSE_CURSOR_UP <= (code) && (code) <= QK_MOUSE_CURSOR_RIGHT) +#define IS_MOUSEKEY_BUTTON(code) (QK_MOUSE_BUTTON_1 <= (code) && (code) <= QK_MOUSE_BUTTON_8) +#define IS_MOUSEKEY_WHEEL(code) (QK_MOUSE_WHEEL_UP <= (code) && (code) <= QK_MOUSE_WHEEL_RIGHT) +#define IS_MOUSEKEY_ACCEL(code) (QK_MOUSE_ACCELERATION_0 <= (code) && (code) <= QK_MOUSE_ACCELERATION_2) #define MOD_BIT(code) (1 << ((code)&0x07)) diff --git a/quantum/keycodes.h b/quantum/keycodes.h index c92028ab439..f461e4a586e 100644 --- a/quantum/keycodes.h +++ b/quantum/keycodes.h @@ -283,25 +283,25 @@ enum qk_keycode_defines { KC_ASSISTANT = 0x00C0, KC_MISSION_CONTROL = 0x00C1, KC_LAUNCHPAD = 0x00C2, - KC_MS_UP = 0x00CD, - KC_MS_DOWN = 0x00CE, - KC_MS_LEFT = 0x00CF, - KC_MS_RIGHT = 0x00D0, - KC_MS_BTN1 = 0x00D1, - KC_MS_BTN2 = 0x00D2, - KC_MS_BTN3 = 0x00D3, - KC_MS_BTN4 = 0x00D4, - KC_MS_BTN5 = 0x00D5, - KC_MS_BTN6 = 0x00D6, - KC_MS_BTN7 = 0x00D7, - KC_MS_BTN8 = 0x00D8, - KC_MS_WH_UP = 0x00D9, - KC_MS_WH_DOWN = 0x00DA, - KC_MS_WH_LEFT = 0x00DB, - KC_MS_WH_RIGHT = 0x00DC, - KC_MS_ACCEL0 = 0x00DD, - KC_MS_ACCEL1 = 0x00DE, - KC_MS_ACCEL2 = 0x00DF, + QK_MOUSE_CURSOR_UP = 0x00CD, + QK_MOUSE_CURSOR_DOWN = 0x00CE, + QK_MOUSE_CURSOR_LEFT = 0x00CF, + QK_MOUSE_CURSOR_RIGHT = 0x00D0, + QK_MOUSE_BUTTON_1 = 0x00D1, + QK_MOUSE_BUTTON_2 = 0x00D2, + QK_MOUSE_BUTTON_3 = 0x00D3, + QK_MOUSE_BUTTON_4 = 0x00D4, + QK_MOUSE_BUTTON_5 = 0x00D5, + QK_MOUSE_BUTTON_6 = 0x00D6, + QK_MOUSE_BUTTON_7 = 0x00D7, + QK_MOUSE_BUTTON_8 = 0x00D8, + QK_MOUSE_WHEEL_UP = 0x00D9, + QK_MOUSE_WHEEL_DOWN = 0x00DA, + QK_MOUSE_WHEEL_LEFT = 0x00DB, + QK_MOUSE_WHEEL_RIGHT = 0x00DC, + QK_MOUSE_ACCELERATION_0 = 0x00DD, + QK_MOUSE_ACCELERATION_1 = 0x00DE, + QK_MOUSE_ACCELERATION_2 = 0x00DF, KC_LEFT_CTRL = 0x00E0, KC_LEFT_SHIFT = 0x00E1, KC_LEFT_ALT = 0x00E2, @@ -926,25 +926,25 @@ enum qk_keycode_defines { KC_ASST = KC_ASSISTANT, KC_MCTL = KC_MISSION_CONTROL, KC_LPAD = KC_LAUNCHPAD, - KC_MS_U = KC_MS_UP, - KC_MS_D = KC_MS_DOWN, - KC_MS_L = KC_MS_LEFT, - KC_MS_R = KC_MS_RIGHT, - KC_BTN1 = KC_MS_BTN1, - KC_BTN2 = KC_MS_BTN2, - KC_BTN3 = KC_MS_BTN3, - KC_BTN4 = KC_MS_BTN4, - KC_BTN5 = KC_MS_BTN5, - KC_BTN6 = KC_MS_BTN6, - KC_BTN7 = KC_MS_BTN7, - KC_BTN8 = KC_MS_BTN8, - KC_WH_U = KC_MS_WH_UP, - KC_WH_D = KC_MS_WH_DOWN, - KC_WH_L = KC_MS_WH_LEFT, - KC_WH_R = KC_MS_WH_RIGHT, - KC_ACL0 = KC_MS_ACCEL0, - KC_ACL1 = KC_MS_ACCEL1, - KC_ACL2 = KC_MS_ACCEL2, + MS_UP = QK_MOUSE_CURSOR_UP, + MS_DOWN = QK_MOUSE_CURSOR_DOWN, + MS_LEFT = QK_MOUSE_CURSOR_LEFT, + MS_RGHT = QK_MOUSE_CURSOR_RIGHT, + MS_BTN1 = QK_MOUSE_BUTTON_1, + MS_BTN2 = QK_MOUSE_BUTTON_2, + MS_BTN3 = QK_MOUSE_BUTTON_3, + MS_BTN4 = QK_MOUSE_BUTTON_4, + MS_BTN5 = QK_MOUSE_BUTTON_5, + MS_BTN6 = QK_MOUSE_BUTTON_6, + MS_BTN7 = QK_MOUSE_BUTTON_7, + MS_BTN8 = QK_MOUSE_BUTTON_8, + MS_WHLU = QK_MOUSE_WHEEL_UP, + MS_WHLD = QK_MOUSE_WHEEL_DOWN, + MS_WHLL = QK_MOUSE_WHEEL_LEFT, + MS_WHLR = QK_MOUSE_WHEEL_RIGHT, + MS_ACL0 = QK_MOUSE_ACCELERATION_0, + MS_ACL1 = QK_MOUSE_ACCELERATION_1, + MS_ACL2 = QK_MOUSE_ACCELERATION_2, KC_LCTL = KC_LEFT_CTRL, KC_LSFT = KC_LEFT_SHIFT, KC_LALT = KC_LEFT_ALT, @@ -1457,7 +1457,7 @@ enum qk_keycode_defines { #define IS_BASIC_KEYCODE(code) ((code) >= KC_A && (code) <= KC_EXSEL) #define IS_SYSTEM_KEYCODE(code) ((code) >= KC_SYSTEM_POWER && (code) <= KC_SYSTEM_WAKE) #define IS_CONSUMER_KEYCODE(code) ((code) >= KC_AUDIO_MUTE && (code) <= KC_LAUNCHPAD) -#define IS_MOUSE_KEYCODE(code) ((code) >= KC_MS_UP && (code) <= KC_MS_ACCEL2) +#define IS_MOUSE_KEYCODE(code) ((code) >= QK_MOUSE_CURSOR_UP && (code) <= QK_MOUSE_ACCELERATION_2) #define IS_MODIFIER_KEYCODE(code) ((code) >= KC_LEFT_CTRL && (code) <= KC_RIGHT_GUI) #define IS_SWAP_HANDS_KEYCODE(code) ((code) >= QK_SWAP_HANDS_TOGGLE && (code) <= QK_SWAP_HANDS_ONE_SHOT) #define IS_MAGIC_KEYCODE(code) ((code) >= QK_MAGIC_SWAP_CONTROL_CAPS_LOCK && (code) <= QK_MAGIC_TOGGLE_ESCAPE_CAPS_LOCK) @@ -1482,7 +1482,7 @@ enum qk_keycode_defines { #define BASIC_KEYCODE_RANGE KC_A ... KC_EXSEL #define SYSTEM_KEYCODE_RANGE KC_SYSTEM_POWER ... KC_SYSTEM_WAKE #define CONSUMER_KEYCODE_RANGE KC_AUDIO_MUTE ... KC_LAUNCHPAD -#define MOUSE_KEYCODE_RANGE KC_MS_UP ... KC_MS_ACCEL2 +#define MOUSE_KEYCODE_RANGE QK_MOUSE_CURSOR_UP ... QK_MOUSE_ACCELERATION_2 #define MODIFIER_KEYCODE_RANGE KC_LEFT_CTRL ... KC_RIGHT_GUI #define SWAP_HANDS_KEYCODE_RANGE QK_SWAP_HANDS_TOGGLE ... QK_SWAP_HANDS_ONE_SHOT #define MAGIC_KEYCODE_RANGE QK_MAGIC_SWAP_CONTROL_CAPS_LOCK ... QK_MAGIC_TOGGLE_ESCAPE_CAPS_LOCK diff --git a/quantum/mousekey.c b/quantum/mousekey.c index 39108117524..8683cfdffac 100644 --- a/quantum/mousekey.c +++ b/quantum/mousekey.c @@ -407,42 +407,42 @@ void mousekey_on(uint8_t code) { # ifdef MOUSEKEY_INERTIA // initial keypress sets impulse and activates first frame of movement - if ((code == KC_MS_UP) || (code == KC_MS_DOWN)) { - mousekey_y_dir = (code == KC_MS_DOWN) ? 1 : -1; + if ((code == QK_MOUSE_CURSOR_UP) || (code == QK_MOUSE_CURSOR_DOWN)) { + mousekey_y_dir = (code == QK_MOUSE_CURSOR_DOWN) ? 1 : -1; if (mousekey_frame < 2) mouse_report.y = move_unit(1); - } else if ((code == KC_MS_LEFT) || (code == KC_MS_RIGHT)) { - mousekey_x_dir = (code == KC_MS_RIGHT) ? 1 : -1; + } else if ((code == QK_MOUSE_CURSOR_LEFT) || (code == QK_MOUSE_CURSOR_RIGHT)) { + mousekey_x_dir = (code == QK_MOUSE_CURSOR_RIGHT) ? 1 : -1; if (mousekey_frame < 2) mouse_report.x = move_unit(0); } # else // no inertia - if (code == KC_MS_UP) + if (code == QK_MOUSE_CURSOR_UP) mouse_report.y = move_unit() * -1; - else if (code == KC_MS_DOWN) + else if (code == QK_MOUSE_CURSOR_DOWN) mouse_report.y = move_unit(); - else if (code == KC_MS_LEFT) + else if (code == QK_MOUSE_CURSOR_LEFT) mouse_report.x = move_unit() * -1; - else if (code == KC_MS_RIGHT) + else if (code == QK_MOUSE_CURSOR_RIGHT) mouse_report.x = move_unit(); # endif // inertia or not - else if (code == KC_MS_WH_UP) + else if (code == QK_MOUSE_WHEEL_UP) mouse_report.v = wheel_unit(); - else if (code == KC_MS_WH_DOWN) + else if (code == QK_MOUSE_WHEEL_DOWN) mouse_report.v = wheel_unit() * -1; - else if (code == KC_MS_WH_LEFT) + else if (code == QK_MOUSE_WHEEL_LEFT) mouse_report.h = wheel_unit() * -1; - else if (code == KC_MS_WH_RIGHT) + else if (code == QK_MOUSE_WHEEL_RIGHT) mouse_report.h = wheel_unit(); else if (IS_MOUSEKEY_BUTTON(code)) - mouse_report.buttons |= 1 << (code - KC_MS_BTN1); - else if (code == KC_MS_ACCEL0) + mouse_report.buttons |= 1 << (code - QK_MOUSE_BUTTON_1); + else if (code == QK_MOUSE_ACCELERATION_0) mousekey_accel |= (1 << 0); - else if (code == KC_MS_ACCEL1) + else if (code == QK_MOUSE_ACCELERATION_1) mousekey_accel |= (1 << 1); - else if (code == KC_MS_ACCEL2) + else if (code == QK_MOUSE_ACCELERATION_2) mousekey_accel |= (1 << 2); } @@ -450,43 +450,43 @@ void mousekey_off(uint8_t code) { # ifdef MOUSEKEY_INERTIA // key release clears impulse unless opposite direction is held - if ((code == KC_MS_UP) && (mousekey_y_dir < 1)) + if ((code == QK_MOUSE_CURSOR_UP) && (mousekey_y_dir < 1)) mousekey_y_dir = 0; - else if ((code == KC_MS_DOWN) && (mousekey_y_dir > -1)) + else if ((code == QK_MOUSE_CURSOR_DOWN) && (mousekey_y_dir > -1)) mousekey_y_dir = 0; - else if ((code == KC_MS_LEFT) && (mousekey_x_dir < 1)) + else if ((code == QK_MOUSE_CURSOR_LEFT) && (mousekey_x_dir < 1)) mousekey_x_dir = 0; - else if ((code == KC_MS_RIGHT) && (mousekey_x_dir > -1)) + else if ((code == QK_MOUSE_CURSOR_RIGHT) && (mousekey_x_dir > -1)) mousekey_x_dir = 0; # else // no inertia - if (code == KC_MS_UP && mouse_report.y < 0) + if (code == QK_MOUSE_CURSOR_UP && mouse_report.y < 0) mouse_report.y = 0; - else if (code == KC_MS_DOWN && mouse_report.y > 0) + else if (code == QK_MOUSE_CURSOR_DOWN && mouse_report.y > 0) mouse_report.y = 0; - else if (code == KC_MS_LEFT && mouse_report.x < 0) + else if (code == QK_MOUSE_CURSOR_LEFT && mouse_report.x < 0) mouse_report.x = 0; - else if (code == KC_MS_RIGHT && mouse_report.x > 0) + else if (code == QK_MOUSE_CURSOR_RIGHT && mouse_report.x > 0) mouse_report.x = 0; # endif // inertia or not - else if (code == KC_MS_WH_UP && mouse_report.v > 0) + else if (code == QK_MOUSE_WHEEL_UP && mouse_report.v > 0) mouse_report.v = 0; - else if (code == KC_MS_WH_DOWN && mouse_report.v < 0) + else if (code == QK_MOUSE_WHEEL_DOWN && mouse_report.v < 0) mouse_report.v = 0; - else if (code == KC_MS_WH_LEFT && mouse_report.h < 0) + else if (code == QK_MOUSE_WHEEL_LEFT && mouse_report.h < 0) mouse_report.h = 0; - else if (code == KC_MS_WH_RIGHT && mouse_report.h > 0) + else if (code == QK_MOUSE_WHEEL_RIGHT && mouse_report.h > 0) mouse_report.h = 0; else if (IS_MOUSEKEY_BUTTON(code)) - mouse_report.buttons &= ~(1 << (code - KC_MS_BTN1)); - else if (code == KC_MS_ACCEL0) + mouse_report.buttons &= ~(1 << (code - QK_MOUSE_BUTTON_1)); + else if (code == QK_MOUSE_ACCELERATION_0) mousekey_accel &= ~(1 << 0); - else if (code == KC_MS_ACCEL1) + else if (code == QK_MOUSE_ACCELERATION_1) mousekey_accel &= ~(1 << 1); - else if (code == KC_MS_ACCEL2) + else if (code == QK_MOUSE_ACCELERATION_2) mousekey_accel &= ~(1 << 2); if (mouse_report.x == 0 && mouse_report.y == 0) { mousekey_repeat = 0; @@ -568,29 +568,29 @@ void mousekey_on(uint8_t code) { uint16_t const c_offset = c_offsets[mk_speed]; uint16_t const w_offset = w_offsets[mk_speed]; uint8_t const old_speed = mk_speed; - if (code == KC_MS_UP) + if (code == QK_MOUSE_CURSOR_UP) mouse_report.y = c_offset * -1; - else if (code == KC_MS_DOWN) + else if (code == QK_MOUSE_CURSOR_DOWN) mouse_report.y = c_offset; - else if (code == KC_MS_LEFT) + else if (code == QK_MOUSE_CURSOR_LEFT) mouse_report.x = c_offset * -1; - else if (code == KC_MS_RIGHT) + else if (code == QK_MOUSE_CURSOR_RIGHT) mouse_report.x = c_offset; - else if (code == KC_MS_WH_UP) + else if (code == QK_MOUSE_WHEEL_UP) mouse_report.v = w_offset; - else if (code == KC_MS_WH_DOWN) + else if (code == QK_MOUSE_WHEEL_DOWN) mouse_report.v = w_offset * -1; - else if (code == KC_MS_WH_LEFT) + else if (code == QK_MOUSE_WHEEL_LEFT) mouse_report.h = w_offset * -1; - else if (code == KC_MS_WH_RIGHT) + else if (code == QK_MOUSE_WHEEL_RIGHT) mouse_report.h = w_offset; else if (IS_MOUSEKEY_BUTTON(code)) - mouse_report.buttons |= 1 << (code - KC_MS_BTN1); - else if (code == KC_MS_ACCEL0) + mouse_report.buttons |= 1 << (code - QK_MOUSE_BUTTON_1); + else if (code == QK_MOUSE_ACCELERATION_0) mk_speed = mkspd_0; - else if (code == KC_MS_ACCEL1) + else if (code == QK_MOUSE_ACCELERATION_1) mk_speed = mkspd_1; - else if (code == KC_MS_ACCEL2) + else if (code == QK_MOUSE_ACCELERATION_2) mk_speed = mkspd_2; if (mk_speed != old_speed) adjust_speed(); } @@ -599,30 +599,30 @@ void mousekey_off(uint8_t code) { # ifdef MK_MOMENTARY_ACCEL uint8_t const old_speed = mk_speed; # endif - if (code == KC_MS_UP && mouse_report.y < 0) + if (code == QK_MOUSE_CURSOR_UP && mouse_report.y < 0) mouse_report.y = 0; - else if (code == KC_MS_DOWN && mouse_report.y > 0) + else if (code == QK_MOUSE_CURSOR_DOWN && mouse_report.y > 0) mouse_report.y = 0; - else if (code == KC_MS_LEFT && mouse_report.x < 0) + else if (code == QK_MOUSE_CURSOR_LEFT && mouse_report.x < 0) mouse_report.x = 0; - else if (code == KC_MS_RIGHT && mouse_report.x > 0) + else if (code == QK_MOUSE_CURSOR_RIGHT && mouse_report.x > 0) mouse_report.x = 0; - else if (code == KC_MS_WH_UP && mouse_report.v > 0) + else if (code == QK_MOUSE_WHEEL_UP && mouse_report.v > 0) mouse_report.v = 0; - else if (code == KC_MS_WH_DOWN && mouse_report.v < 0) + else if (code == QK_MOUSE_WHEEL_DOWN && mouse_report.v < 0) mouse_report.v = 0; - else if (code == KC_MS_WH_LEFT && mouse_report.h < 0) + else if (code == QK_MOUSE_WHEEL_LEFT && mouse_report.h < 0) mouse_report.h = 0; - else if (code == KC_MS_WH_RIGHT && mouse_report.h > 0) + else if (code == QK_MOUSE_WHEEL_RIGHT && mouse_report.h > 0) mouse_report.h = 0; else if (IS_MOUSEKEY_BUTTON(code)) - mouse_report.buttons &= ~(1 << (code - KC_MS_BTN1)); + mouse_report.buttons &= ~(1 << (code - QK_MOUSE_BUTTON_1)); # ifdef MK_MOMENTARY_ACCEL - else if (code == KC_MS_ACCEL0) + else if (code == QK_MOUSE_ACCELERATION_0) mk_speed = mkspd_DEFAULT; - else if (code == KC_MS_ACCEL1) + else if (code == QK_MOUSE_ACCELERATION_1) mk_speed = mkspd_DEFAULT; - else if (code == KC_MS_ACCEL2) + else if (code == QK_MOUSE_ACCELERATION_2) mk_speed = mkspd_DEFAULT; if (mk_speed != old_speed) adjust_speed(); # endif diff --git a/quantum/pointing_device/pointing_device.c b/quantum/pointing_device/pointing_device.c index 4682aceb14d..74ce9108a9c 100644 --- a/quantum/pointing_device/pointing_device.c +++ b/quantum/pointing_device/pointing_device.c @@ -498,7 +498,7 @@ __attribute__((weak)) report_mouse_t pointing_device_task_combined_user(report_m __attribute__((weak)) void pointing_device_keycode_handler(uint16_t keycode, bool pressed) { if IS_MOUSEKEY_BUTTON (keycode) { - local_mouse_report.buttons = pointing_device_handle_buttons(local_mouse_report.buttons, pressed, keycode - KC_MS_BTN1); + local_mouse_report.buttons = pointing_device_handle_buttons(local_mouse_report.buttons, pressed, keycode - QK_MOUSE_BUTTON_1); pointing_device_send(); } } diff --git a/quantum/pointing_device/pointing_device_auto_mouse.h b/quantum/pointing_device/pointing_device_auto_mouse.h index a596c065a31..2c0d4d10434 100644 --- a/quantum/pointing_device/pointing_device_auto_mouse.h +++ b/quantum/pointing_device/pointing_device_auto_mouse.h @@ -37,7 +37,7 @@ # define AUTO_MOUSE_TIME 650 #endif #ifndef AUTO_MOUSE_DELAY -# define AUTO_MOUSE_DELAY GET_TAPPING_TERM(KC_MS_BTN1, &(keyrecord_t){}) +# define AUTO_MOUSE_DELAY GET_TAPPING_TERM(QK_MOUSE_BUTTON_1, &(keyrecord_t){}) #endif #ifndef AUTO_MOUSE_DEBOUNCE # define AUTO_MOUSE_DEBOUNCE 25 diff --git a/quantum/quantum_keycodes_legacy.h b/quantum/quantum_keycodes_legacy.h index 6ea5e13f3a9..e1562077e5f 100644 --- a/quantum/quantum_keycodes_legacy.h +++ b/quantum/quantum_keycodes_legacy.h @@ -16,3 +16,42 @@ #define RGB_VAD QK_UNDERGLOW_VALUE_DOWN #define RGB_SPI QK_UNDERGLOW_SPEED_UP #define RGB_SPD QK_UNDERGLOW_SPEED_DOWN + +#define KC_MS_UP QK_MOUSE_CURSOR_UP +#define KC_MS_U QK_MOUSE_CURSOR_UP +#define KC_MS_DOWN QK_MOUSE_CURSOR_DOWN +#define KC_MS_D QK_MOUSE_CURSOR_DOWN +#define KC_MS_LEFT QK_MOUSE_CURSOR_LEFT +#define KC_MS_L QK_MOUSE_CURSOR_LEFT +#define KC_MS_RIGHT QK_MOUSE_CURSOR_RIGHT +#define KC_MS_R QK_MOUSE_CURSOR_RIGHT +#define KC_MS_BTN1 QK_MOUSE_BUTTON_1 +#define KC_BTN1 QK_MOUSE_BUTTON_1 +#define KC_MS_BTN2 QK_MOUSE_BUTTON_2 +#define KC_BTN2 QK_MOUSE_BUTTON_2 +#define KC_MS_BTN3 QK_MOUSE_BUTTON_3 +#define KC_BTN3 QK_MOUSE_BUTTON_3 +#define KC_MS_BTN4 QK_MOUSE_BUTTON_4 +#define KC_BTN4 QK_MOUSE_BUTTON_4 +#define KC_MS_BTN5 QK_MOUSE_BUTTON_5 +#define KC_BTN5 QK_MOUSE_BUTTON_5 +#define KC_MS_BTN6 QK_MOUSE_BUTTON_6 +#define KC_BTN6 QK_MOUSE_BUTTON_6 +#define KC_MS_BTN7 QK_MOUSE_BUTTON_7 +#define KC_BTN7 QK_MOUSE_BUTTON_7 +#define KC_MS_BTN8 QK_MOUSE_BUTTON_8 +#define KC_BTN8 QK_MOUSE_BUTTON_8 +#define KC_MS_WH_UP QK_MOUSE_WHEEL_UP +#define KC_WH_U QK_MOUSE_WHEEL_UP +#define KC_MS_WH_DOWN QK_MOUSE_WHEEL_DOWN +#define KC_WH_D QK_MOUSE_WHEEL_DOWN +#define KC_MS_WH_LEFT QK_MOUSE_WHEEL_LEFT +#define KC_WH_L QK_MOUSE_WHEEL_LEFT +#define KC_MS_WH_RIGHT QK_MOUSE_WHEEL_RIGHT +#define KC_WH_R QK_MOUSE_WHEEL_RIGHT +#define KC_MS_ACCEL0 QK_MOUSE_ACCELERATION_0 +#define KC_ACL0 QK_MOUSE_ACCELERATION_0 +#define KC_MS_ACCEL1 QK_MOUSE_ACCELERATION_1 +#define KC_ACL1 QK_MOUSE_ACCELERATION_1 +#define KC_MS_ACCEL2 QK_MOUSE_ACCELERATION_2 +#define KC_ACL2 QK_MOUSE_ACCELERATION_2 diff --git a/quantum/repeat_key.c b/quantum/repeat_key.c index 4567428723a..56f242f8b84 100644 --- a/quantum/repeat_key.c +++ b/quantum/repeat_key.c @@ -220,10 +220,10 @@ uint16_t get_alt_repeat_key_keycode(void) { {KC_BRIU, KC_BRID}, // Brightness Up / Down. #endif // EXTRAKEY_ENABLE #ifdef MOUSEKEY_ENABLE - {KC_MS_L, KC_MS_R}, // Mouse Cursor Left / Right. - {KC_MS_U, KC_MS_D}, // Mouse Cursor Up / Down. - {KC_WH_L, KC_WH_R}, // Mouse Wheel Left / Right. - {KC_WH_U, KC_WH_D}, // Mouse Wheel Up / Down. + {MS_LEFT, MS_RGHT}, // Mouse Cursor Left / Right. + {MS_UP, MS_DOWN}, // Mouse Cursor Up / Down. + {MS_WHLL, MS_WHLR}, // Mouse Wheel Left / Right. + {MS_WHLU, MS_WHLD}, // Mouse Wheel Up / Down. #endif // MOUSEKEY_ENABLE }; // clang-format on diff --git a/tests/test_common/keycode_table.cpp b/tests/test_common/keycode_table.cpp index 18dd5360277..4c28ab4d20d 100644 --- a/tests/test_common/keycode_table.cpp +++ b/tests/test_common/keycode_table.cpp @@ -225,25 +225,25 @@ std::map KEYCODE_ID_TABLE = { {KC_ASSISTANT, "KC_ASSISTANT"}, {KC_MISSION_CONTROL, "KC_MISSION_CONTROL"}, {KC_LAUNCHPAD, "KC_LAUNCHPAD"}, - {KC_MS_UP, "KC_MS_UP"}, - {KC_MS_DOWN, "KC_MS_DOWN"}, - {KC_MS_LEFT, "KC_MS_LEFT"}, - {KC_MS_RIGHT, "KC_MS_RIGHT"}, - {KC_MS_BTN1, "KC_MS_BTN1"}, - {KC_MS_BTN2, "KC_MS_BTN2"}, - {KC_MS_BTN3, "KC_MS_BTN3"}, - {KC_MS_BTN4, "KC_MS_BTN4"}, - {KC_MS_BTN5, "KC_MS_BTN5"}, - {KC_MS_BTN6, "KC_MS_BTN6"}, - {KC_MS_BTN7, "KC_MS_BTN7"}, - {KC_MS_BTN8, "KC_MS_BTN8"}, - {KC_MS_WH_UP, "KC_MS_WH_UP"}, - {KC_MS_WH_DOWN, "KC_MS_WH_DOWN"}, - {KC_MS_WH_LEFT, "KC_MS_WH_LEFT"}, - {KC_MS_WH_RIGHT, "KC_MS_WH_RIGHT"}, - {KC_MS_ACCEL0, "KC_MS_ACCEL0"}, - {KC_MS_ACCEL1, "KC_MS_ACCEL1"}, - {KC_MS_ACCEL2, "KC_MS_ACCEL2"}, + {QK_MOUSE_CURSOR_UP, "QK_MOUSE_CURSOR_UP"}, + {QK_MOUSE_CURSOR_DOWN, "QK_MOUSE_CURSOR_DOWN"}, + {QK_MOUSE_CURSOR_LEFT, "QK_MOUSE_CURSOR_LEFT"}, + {QK_MOUSE_CURSOR_RIGHT, "QK_MOUSE_CURSOR_RIGHT"}, + {QK_MOUSE_BUTTON_1, "QK_MOUSE_BUTTON_1"}, + {QK_MOUSE_BUTTON_2, "QK_MOUSE_BUTTON_2"}, + {QK_MOUSE_BUTTON_3, "QK_MOUSE_BUTTON_3"}, + {QK_MOUSE_BUTTON_4, "QK_MOUSE_BUTTON_4"}, + {QK_MOUSE_BUTTON_5, "QK_MOUSE_BUTTON_5"}, + {QK_MOUSE_BUTTON_6, "QK_MOUSE_BUTTON_6"}, + {QK_MOUSE_BUTTON_7, "QK_MOUSE_BUTTON_7"}, + {QK_MOUSE_BUTTON_8, "QK_MOUSE_BUTTON_8"}, + {QK_MOUSE_WHEEL_UP, "QK_MOUSE_WHEEL_UP"}, + {QK_MOUSE_WHEEL_DOWN, "QK_MOUSE_WHEEL_DOWN"}, + {QK_MOUSE_WHEEL_LEFT, "QK_MOUSE_WHEEL_LEFT"}, + {QK_MOUSE_WHEEL_RIGHT, "QK_MOUSE_WHEEL_RIGHT"}, + {QK_MOUSE_ACCELERATION_0, "QK_MOUSE_ACCELERATION_0"}, + {QK_MOUSE_ACCELERATION_1, "QK_MOUSE_ACCELERATION_1"}, + {QK_MOUSE_ACCELERATION_2, "QK_MOUSE_ACCELERATION_2"}, {KC_LEFT_CTRL, "KC_LEFT_CTRL"}, {KC_LEFT_SHIFT, "KC_LEFT_SHIFT"}, {KC_LEFT_ALT, "KC_LEFT_ALT"}, From e07f752a5704640052963ff7777bd3b87a429f6f Mon Sep 17 00:00:00 2001 From: DavidSannier Date: Thu, 4 Jul 2024 01:15:44 +0200 Subject: [PATCH 035/204] [build_test] set CONSOLE_ENABLE=yes if DEBUG > 0 (#23097) --- builddefs/build_test.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builddefs/build_test.mk b/builddefs/build_test.mk index 2cc1134da5b..d0de63c6f58 100644 --- a/builddefs/build_test.mk +++ b/builddefs/build_test.mk @@ -47,7 +47,8 @@ PLATFORM:=TEST PLATFORM_KEY:=test BOOTLOADER_TYPE:=none -ifeq ($(strip $(DEBUG)), 1) +DEBUG ?= 0 +ifneq ($(strip $(DEBUG)), 0) CONSOLE_ENABLE = yes endif From bdca9318f9f6a7b4ea697113a2e0b3117a67e093 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 3 Jul 2024 19:13:00 -0700 Subject: [PATCH 036/204] Change suspend condition check order on ChibiOS (#24020) --- tmk_core/protocol/chibios/chibios.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmk_core/protocol/chibios/chibios.c b/tmk_core/protocol/chibios/chibios.c index a249af8d38c..b879bdac778 100644 --- a/tmk_core/protocol/chibios/chibios.c +++ b/tmk_core/protocol/chibios/chibios.c @@ -184,7 +184,7 @@ void protocol_pre_task(void) { /* Do this in the suspended state */ suspend_power_down(); // on AVR this deep sleeps for 15ms /* Remote wakeup */ - if ((USB_DRIVER.status & USB_GETSTATUS_REMOTE_WAKEUP_ENABLED) && suspend_wakeup_condition()) { + if (suspend_wakeup_condition() && (USB_DRIVER.status & USB_GETSTATUS_REMOTE_WAKEUP_ENABLED)) { usbWakeupHost(&USB_DRIVER); # if USB_SUSPEND_WAKEUP_DELAY > 0 // Some hubs, kvm switches, and monitors do From 26c114a2b47377db2ef337f3e22e3685e70852bd Mon Sep 17 00:00:00 2001 From: Will Hedges <36576135+will-hedges@users.noreply.github.com> Date: Wed, 3 Jul 2024 21:38:03 -0500 Subject: [PATCH 037/204] [keyboard] added bear_face/v3 (#24032) * added keyboard.json, default, default_iso, and keymap READMEs --- keyboards/bear_face/v3/keyboard.json | 287 ++++++++++++++++++ .../bear_face/v3/keymaps/default/keymap.c | 92 ++++++ .../bear_face/v3/keymaps/default/readme.md | 18 ++ .../bear_face/v3/keymaps/default_iso/keymap.c | 92 ++++++ .../v3/keymaps/default_iso/readme.md | 18 ++ 5 files changed, 507 insertions(+) create mode 100644 keyboards/bear_face/v3/keyboard.json create mode 100644 keyboards/bear_face/v3/keymaps/default/keymap.c create mode 100644 keyboards/bear_face/v3/keymaps/default/readme.md create mode 100644 keyboards/bear_face/v3/keymaps/default_iso/keymap.c create mode 100644 keyboards/bear_face/v3/keymaps/default_iso/readme.md diff --git a/keyboards/bear_face/v3/keyboard.json b/keyboards/bear_face/v3/keyboard.json new file mode 100644 index 00000000000..0a0bda8df90 --- /dev/null +++ b/keyboards/bear_face/v3/keyboard.json @@ -0,0 +1,287 @@ +{ + "keyboard_name": "bear_face v3", + "usb": { + "device_version": "3.2.0" + }, + "layouts": { + "LAYOUT_all": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0, "w": 1.5}, + {"matrix": [0, 1], "x": 1.5, "y": 0}, + {"matrix": [0, 2], "x": 2.5, "y": 0}, + {"matrix": [0, 3], "x": 3.5, "y": 0}, + {"matrix": [0, 4], "x": 4.5, "y": 0}, + {"matrix": [0, 5], "x": 5.5, "y": 0}, + {"matrix": [0, 6], "x": 6.5, "y": 0}, + {"matrix": [0, 7], "x": 7.5, "y": 0}, + {"matrix": [0, 8], "x": 8.5, "y": 0}, + {"matrix": [0, 9], "x": 9.5, "y": 0}, + {"matrix": [0, 10], "x": 10.5, "y": 0}, + {"matrix": [0, 11], "x": 11.5, "y": 0}, + {"matrix": [0, 12], "x": 12.5, "y": 0}, + {"matrix": [0, 13], "x": 13.5, "y": 0}, + {"matrix": [0, 14], "x": 14.5, "y": 0, "w": 1.5}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + {"matrix": [1, 6], "x": 6, "y": 1}, + {"matrix": [1, 7], "x": 7, "y": 1}, + {"matrix": [1, 8], "x": 8, "y": 1}, + {"matrix": [1, 9], "x": 9, "y": 1}, + {"matrix": [1, 10], "x": 10, "y": 1}, + {"matrix": [1, 11], "x": 11, "y": 1}, + {"matrix": [1, 12], "x": 12, "y": 1}, + {"matrix": [1, 13], "x": 13, "y": 1, "w": 2}, + {"matrix": [1, 14], "x": 15, "y": 1}, + + {"matrix": [2, 0], "x": 0, "y": 2, "w": 1.5}, + {"matrix": [2, 1], "x": 1.5, "y": 2}, + {"matrix": [2, 2], "x": 2.5, "y": 2}, + {"matrix": [2, 3], "x": 3.5, "y": 2}, + {"matrix": [2, 4], "x": 4.5, "y": 2}, + {"matrix": [2, 5], "x": 5.5, "y": 2}, + {"matrix": [2, 6], "x": 6.5, "y": 2}, + {"matrix": [2, 7], "x": 7.5, "y": 2}, + {"matrix": [2, 8], "x": 8.5, "y": 2}, + {"matrix": [2, 9], "x": 9.5, "y": 2}, + {"matrix": [2, 10], "x": 10.5, "y": 2}, + {"matrix": [2, 11], "x": 11.5, "y": 2}, + {"matrix": [2, 12], "x": 12.5, "y": 2}, + {"matrix": [2, 13], "x": 13.5, "y": 2, "w": 1.5}, + {"matrix": [2, 14], "x": 15, "y": 2}, + + {"matrix": [3, 0], "x": 0, "y": 3, "w": 1.75}, + {"matrix": [3, 1], "x": 1.75, "y": 3}, + {"matrix": [3, 2], "x": 2.75, "y": 3}, + {"matrix": [3, 3], "x": 3.75, "y": 3}, + {"matrix": [3, 4], "x": 4.75, "y": 3}, + {"matrix": [3, 5], "x": 5.75, "y": 3}, + {"matrix": [3, 6], "x": 6.75, "y": 3}, + {"matrix": [3, 7], "x": 7.75, "y": 3}, + {"matrix": [3, 8], "x": 8.75, "y": 3}, + {"matrix": [3, 9], "x": 9.75, "y": 3}, + {"matrix": [3, 10], "x": 10.75, "y": 3}, + {"matrix": [3, 11], "x": 11.75, "y": 3}, + {"matrix": [3, 12], "x": 12.75, "y": 3}, + {"matrix": [3, 13], "x": 13.75, "y": 2, "w": 1.25, "h": 2}, + {"matrix": [3, 14], "x": 15, "y": 3}, + + {"matrix": [4, 0], "x": 0, "y": 4, "w": 1.25}, + {"matrix": [4, 1], "x": 1.25, "y": 4}, + {"matrix": [4, 2], "x": 2.25, "y": 4}, + {"matrix": [4, 3], "x": 3.25, "y": 4}, + {"matrix": [4, 4], "x": 4.25, "y": 4}, + {"matrix": [4, 5], "x": 5.25, "y": 4}, + {"matrix": [4, 6], "x": 6.25, "y": 4}, + {"matrix": [4, 7], "x": 7.25, "y": 4}, + {"matrix": [4, 8], "x": 8.25, "y": 4}, + {"matrix": [4, 9], "x": 9.25, "y": 4}, + {"matrix": [4, 10], "x": 10.25, "y": 4}, + {"matrix": [4, 11], "x": 11.25, "y": 4}, + {"matrix": [4, 12], "x": 12.25, "y": 4, "w": 1.75}, + {"matrix": [4, 13], "x": 14, "y": 4}, + {"matrix": [4, 14], "x": 15, "y": 4}, + + {"matrix": [5, 0], "x": 0, "y": 5, "w": 1.25}, + {"matrix": [5, 1], "x": 1.25, "y": 5, "w": 1.25}, + {"matrix": [5, 2], "x": 2.5, "y": 5, "w": 1.25}, + {"matrix": [5, 5], "x": 3.75, "y": 5, "w": 6.25}, + {"matrix": [5, 9], "x": 10, "y": 5}, + {"matrix": [5, 10], "x": 11, "y": 5}, + {"matrix": [5, 11], "x": 12, "y": 5}, + {"matrix": [5, 12], "x": 13, "y": 5}, + {"matrix": [5, 13], "x": 14, "y": 5}, + {"matrix": [5, 14], "x": 15, "y": 5} + ] + }, + "LAYOUT_83_ansi": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0, "w": 1.5}, + {"matrix": [0, 1], "x": 1.5, "y": 0}, + {"matrix": [0, 2], "x": 2.5, "y": 0}, + {"matrix": [0, 3], "x": 3.5, "y": 0}, + {"matrix": [0, 4], "x": 4.5, "y": 0}, + {"matrix": [0, 5], "x": 5.5, "y": 0}, + {"matrix": [0, 6], "x": 6.5, "y": 0}, + {"matrix": [0, 7], "x": 7.5, "y": 0}, + {"matrix": [0, 8], "x": 8.5, "y": 0}, + {"matrix": [0, 9], "x": 9.5, "y": 0}, + {"matrix": [0, 10], "x": 10.5, "y": 0}, + {"matrix": [0, 11], "x": 11.5, "y": 0}, + {"matrix": [0, 12], "x": 12.5, "y": 0}, + {"matrix": [0, 13], "x": 13.5, "y": 0}, + {"matrix": [0, 14], "x": 14.5, "y": 0, "w": 1.5}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + {"matrix": [1, 6], "x": 6, "y": 1}, + {"matrix": [1, 7], "x": 7, "y": 1}, + {"matrix": [1, 8], "x": 8, "y": 1}, + {"matrix": [1, 9], "x": 9, "y": 1}, + {"matrix": [1, 10], "x": 10, "y": 1}, + {"matrix": [1, 11], "x": 11, "y": 1}, + {"matrix": [1, 12], "x": 12, "y": 1}, + {"matrix": [1, 13], "x": 13, "y": 1, "w": 2}, + {"matrix": [1, 14], "x": 15, "y": 1}, + + {"matrix": [2, 0], "x": 0, "y": 2, "w": 1.5}, + {"matrix": [2, 1], "x": 1.5, "y": 2}, + {"matrix": [2, 2], "x": 2.5, "y": 2}, + {"matrix": [2, 3], "x": 3.5, "y": 2}, + {"matrix": [2, 4], "x": 4.5, "y": 2}, + {"matrix": [2, 5], "x": 5.5, "y": 2}, + {"matrix": [2, 6], "x": 6.5, "y": 2}, + {"matrix": [2, 7], "x": 7.5, "y": 2}, + {"matrix": [2, 8], "x": 8.5, "y": 2}, + {"matrix": [2, 9], "x": 9.5, "y": 2}, + {"matrix": [2, 10], "x": 10.5, "y": 2}, + {"matrix": [2, 11], "x": 11.5, "y": 2}, + {"matrix": [2, 12], "x": 12.5, "y": 2}, + {"matrix": [2, 13], "x": 13.5, "y": 2, "w": 1.5}, + {"matrix": [2, 14], "x": 15, "y": 2}, + + {"matrix": [3, 0], "x": 0, "y": 3, "w": 1.75}, + {"matrix": [3, 1], "x": 1.75, "y": 3}, + {"matrix": [3, 2], "x": 2.75, "y": 3}, + {"matrix": [3, 3], "x": 3.75, "y": 3}, + {"matrix": [3, 4], "x": 4.75, "y": 3}, + {"matrix": [3, 5], "x": 5.75, "y": 3}, + {"matrix": [3, 6], "x": 6.75, "y": 3}, + {"matrix": [3, 7], "x": 7.75, "y": 3}, + {"matrix": [3, 8], "x": 8.75, "y": 3}, + {"matrix": [3, 9], "x": 9.75, "y": 3}, + {"matrix": [3, 10], "x": 10.75, "y": 3}, + {"matrix": [3, 11], "x": 11.75, "y": 3}, + {"matrix": [3, 13], "x": 12.75, "y": 3, "w": 2.25}, + {"matrix": [3, 14], "x": 15, "y": 3}, + + {"matrix": [4, 0], "x": 0, "y": 4, "w": 2.25}, + {"matrix": [4, 2], "x": 2.25, "y": 4}, + {"matrix": [4, 3], "x": 3.25, "y": 4}, + {"matrix": [4, 4], "x": 4.25, "y": 4}, + {"matrix": [4, 5], "x": 5.25, "y": 4}, + {"matrix": [4, 6], "x": 6.25, "y": 4}, + {"matrix": [4, 7], "x": 7.25, "y": 4}, + {"matrix": [4, 8], "x": 8.25, "y": 4}, + {"matrix": [4, 9], "x": 9.25, "y": 4}, + {"matrix": [4, 10], "x": 10.25, "y": 4}, + {"matrix": [4, 11], "x": 11.25, "y": 4}, + {"matrix": [4, 12], "x": 12.25, "y": 4, "w": 1.75}, + {"matrix": [4, 13], "x": 14, "y": 4}, + {"matrix": [4, 14], "x": 15, "y": 4}, + + {"matrix": [5, 0], "x": 0, "y": 5, "w": 1.25}, + {"matrix": [5, 1], "x": 1.25, "y": 5, "w": 1.25}, + {"matrix": [5, 2], "x": 2.5, "y": 5, "w": 1.25}, + {"matrix": [5, 5], "x": 3.75, "y": 5, "w": 6.25}, + {"matrix": [5, 9], "x": 10, "y": 5}, + {"matrix": [5, 10], "x": 11, "y": 5}, + {"matrix": [5, 11], "x": 12, "y": 5}, + {"matrix": [5, 12], "x": 13, "y": 5}, + {"matrix": [5, 13], "x": 14, "y": 5}, + {"matrix": [5, 14], "x": 15, "y": 5} + ] + }, + "LAYOUT_84_iso": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0, "w": 1.5}, + {"matrix": [0, 1], "x": 1.5, "y": 0}, + {"matrix": [0, 2], "x": 2.5, "y": 0}, + {"matrix": [0, 3], "x": 3.5, "y": 0}, + {"matrix": [0, 4], "x": 4.5, "y": 0}, + {"matrix": [0, 5], "x": 5.5, "y": 0}, + {"matrix": [0, 6], "x": 6.5, "y": 0}, + {"matrix": [0, 7], "x": 7.5, "y": 0}, + {"matrix": [0, 8], "x": 8.5, "y": 0}, + {"matrix": [0, 9], "x": 9.5, "y": 0}, + {"matrix": [0, 10], "x": 10.5, "y": 0}, + {"matrix": [0, 11], "x": 11.5, "y": 0}, + {"matrix": [0, 12], "x": 12.5, "y": 0}, + {"matrix": [0, 13], "x": 13.5, "y": 0}, + {"matrix": [0, 14], "x": 14.5, "y": 0, "w": 1.5}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + {"matrix": [1, 6], "x": 6, "y": 1}, + {"matrix": [1, 7], "x": 7, "y": 1}, + {"matrix": [1, 8], "x": 8, "y": 1}, + {"matrix": [1, 9], "x": 9, "y": 1}, + {"matrix": [1, 10], "x": 10, "y": 1}, + {"matrix": [1, 11], "x": 11, "y": 1}, + {"matrix": [1, 12], "x": 12, "y": 1}, + {"matrix": [1, 13], "x": 13, "y": 1, "w": 2}, + {"matrix": [1, 14], "x": 15, "y": 1}, + + {"matrix": [2, 0], "x": 0, "y": 2, "w": 1.5}, + {"matrix": [2, 1], "x": 1.5, "y": 2}, + {"matrix": [2, 2], "x": 2.5, "y": 2}, + {"matrix": [2, 3], "x": 3.5, "y": 2}, + {"matrix": [2, 4], "x": 4.5, "y": 2}, + {"matrix": [2, 5], "x": 5.5, "y": 2}, + {"matrix": [2, 6], "x": 6.5, "y": 2}, + {"matrix": [2, 7], "x": 7.5, "y": 2}, + {"matrix": [2, 8], "x": 8.5, "y": 2}, + {"matrix": [2, 9], "x": 9.5, "y": 2}, + {"matrix": [2, 10], "x": 10.5, "y": 2}, + {"matrix": [2, 11], "x": 11.5, "y": 2}, + {"matrix": [2, 12], "x": 12.5, "y": 2}, + {"matrix": [2, 14], "x": 15, "y": 2}, + + {"matrix": [3, 0], "x": 0, "y": 3, "w": 1.75}, + {"matrix": [3, 1], "x": 1.75, "y": 3}, + {"matrix": [3, 2], "x": 2.75, "y": 3}, + {"matrix": [3, 3], "x": 3.75, "y": 3}, + {"matrix": [3, 4], "x": 4.75, "y": 3}, + {"matrix": [3, 5], "x": 5.75, "y": 3}, + {"matrix": [3, 6], "x": 6.75, "y": 3}, + {"matrix": [3, 7], "x": 7.75, "y": 3}, + {"matrix": [3, 8], "x": 8.75, "y": 3}, + {"matrix": [3, 9], "x": 9.75, "y": 3}, + {"matrix": [3, 10], "x": 10.75, "y": 3}, + {"matrix": [3, 11], "x": 11.75, "y": 3}, + {"matrix": [3, 12], "x": 12.75, "y": 3}, + {"matrix": [3, 13], "x": 13.75, "y": 2, "w": 1.25, "h": 2}, + {"matrix": [3, 14], "x": 15, "y": 3}, + + {"matrix": [4, 0], "x": 0, "y": 4, "w": 1.25}, + {"matrix": [4, 1], "x": 1.25, "y": 4}, + {"matrix": [4, 2], "x": 2.25, "y": 4}, + {"matrix": [4, 3], "x": 3.25, "y": 4}, + {"matrix": [4, 4], "x": 4.25, "y": 4}, + {"matrix": [4, 5], "x": 5.25, "y": 4}, + {"matrix": [4, 6], "x": 6.25, "y": 4}, + {"matrix": [4, 7], "x": 7.25, "y": 4}, + {"matrix": [4, 8], "x": 8.25, "y": 4}, + {"matrix": [4, 9], "x": 9.25, "y": 4}, + {"matrix": [4, 10], "x": 10.25, "y": 4}, + {"matrix": [4, 11], "x": 11.25, "y": 4}, + {"matrix": [4, 12], "x": 12.25, "y": 4, "w": 1.75}, + {"matrix": [4, 13], "x": 14, "y": 4}, + {"matrix": [4, 14], "x": 15, "y": 4}, + + {"matrix": [5, 0], "x": 0, "y": 5, "w": 1.25}, + {"matrix": [5, 1], "x": 1.25, "y": 5, "w": 1.25}, + {"matrix": [5, 2], "x": 2.5, "y": 5, "w": 1.25}, + {"matrix": [5, 5], "x": 3.75, "y": 5, "w": 6.25}, + {"matrix": [5, 9], "x": 10, "y": 5}, + {"matrix": [5, 10], "x": 11, "y": 5}, + {"matrix": [5, 11], "x": 12, "y": 5}, + {"matrix": [5, 12], "x": 13, "y": 5}, + {"matrix": [5, 13], "x": 14, "y": 5}, + {"matrix": [5, 14], "x": 15, "y": 5} + ] + } + } +} diff --git a/keyboards/bear_face/v3/keymaps/default/keymap.c b/keyboards/bear_face/v3/keymaps/default/keymap.c new file mode 100644 index 00000000000..77f161a7104 --- /dev/null +++ b/keyboards/bear_face/v3/keymaps/default/keymap.c @@ -0,0 +1,92 @@ +/* Copyright 2024 will-hedges */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include QMK_KEYBOARD_H + +enum layers { + _QWER, + _COLE, + _DVOR, + _FN1, +}; + +#define FN1_CAPS LT(_FN1, KC_CAPS) + +//custom keycode enums +enum custom_keycodes { + BASE_QWER = QK_KB_0, + BASE_COLE, + BASE_DVOR +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWER] = LAYOUT_83_ansi( + 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_NO, KC_DEL, + 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_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, + FN1_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [_COLE] = LAYOUT_83_ansi( + 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_NO, KC_DEL, + 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_HOME, + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, + KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, KC_PGDN, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [_DVOR] = LAYOUT_83_ansi( + 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_NO, KC_DEL, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSPC, KC_HOME, + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, KC_PGUP, + FN1_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, KC_PGDN, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_UP, KC_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [_FN1] = LAYOUT_83_ansi( + _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, KC_PSCR, KC_SCRL, KC_PAUS, _______, KC_INS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_CALC, BASE_QWER, + _______, _______, _______, _______, QK_BOOT, _______, _______, _______, _______, QK_BOOT, _______, _______, _______, _______, BASE_COLE, + _______, _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BASE_DVOR, + _______, KC_APP, _______, _______, _______, _______, _______, _______, _______, _______, KC_APP, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +/* + [_BLANK] = LAYOUT_83_ansi( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +*/ +}; + + +// Macros to allow the user to set whatever default layer they want, even after reboot +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case BASE_QWER: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWER); + } + break; + case BASE_COLE: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLE); + } + break; + case BASE_DVOR: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVOR); + } + break; + } + return true; +}; diff --git a/keyboards/bear_face/v3/keymaps/default/readme.md b/keyboards/bear_face/v3/keymaps/default/readme.md new file mode 100644 index 00000000000..a86b77bb191 --- /dev/null +++ b/keyboards/bear_face/v3/keymaps/default/readme.md @@ -0,0 +1,18 @@ +# default bear_face layout + +This layout replaces the stock layout on the Vortex Race 3. + +- Caps Lock indicator LED is enabled by default +- Layer Tap on Caps Lock (tap for Caps Lock, hold for _FN1) +- FORCE_NKRO enabled by default + +- Pn key is set to 'KC_NO' by default + * Might be a good place for a macro, or to put your PC to sleep, etc. + +- A combined function layer that mimics the sublegends on the stock caps (regardless of layout) + * 'Reset' will put the keyboard into DFU mode + * 'APP' sends 'KC_APP' + * Base layer toggles for QWERTY, COLEMAK, and DVORAK layouts (will persist after reboot) + +- New things in v3: + * v3.1c PCB is compatible with both rev1 (Micro-USB) and rev2 (USB-C) stock cases diff --git a/keyboards/bear_face/v3/keymaps/default_iso/keymap.c b/keyboards/bear_face/v3/keymaps/default_iso/keymap.c new file mode 100644 index 00000000000..73a1155b6a5 --- /dev/null +++ b/keyboards/bear_face/v3/keymaps/default_iso/keymap.c @@ -0,0 +1,92 @@ +/* Copyright 2024 will-hedges */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include QMK_KEYBOARD_H + +enum layers { + _QWER, + _COLE, + _DVOR, + _FN1, +}; + +#define FN1_CAPS LT(_FN1, KC_CAPS) + +//custom keycode enums +enum custom_keycodes { + BASE_QWER = SAFE_RANGE, + BASE_COLE, + BASE_DVOR +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWER] = LAYOUT_84_iso( + 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_NO, KC_DEL, + 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_HOME, + 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_PGUP, + FN1_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_PGDN, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [_COLE] = LAYOUT_84_iso( + 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_NO, KC_DEL, + 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_HOME, + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_PGUP, + KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_NUHS, KC_ENT, KC_PGDN, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [_DVOR] = LAYOUT_84_iso( + 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_NO, KC_DEL, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSPC, KC_HOME, + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_PGUP, + FN1_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_NUHS, KC_ENT, KC_PGDN, + KC_LSFT, KC_NUBS, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_UP, KC_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [_FN1] = LAYOUT_84_iso( + _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, KC_PSCR, KC_SCRL, KC_PAUS, _______, _______, KC_INS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_CALC, BASE_QWER, + _______, _______, _______, _______, QK_BOOT, _______, _______, _______, _______, QK_BOOT, _______, _______, _______, BASE_COLE, + _______, _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BASE_DVOR, + _______, KC_APP, _______, _______, _______, _______, _______, _______, _______, _______, KC_APP, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +/* + [_BLANK] = LAYOUT_84_iso( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +*/ +}; + + +// Macros to allow the user to set whatever default layer they want, even after reboot +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case BASE_QWER: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWER); + } + break; + case BASE_COLE: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLE); + } + break; + case BASE_DVOR: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVOR); + } + break; + } + return true; +}; diff --git a/keyboards/bear_face/v3/keymaps/default_iso/readme.md b/keyboards/bear_face/v3/keymaps/default_iso/readme.md new file mode 100644 index 00000000000..a86b77bb191 --- /dev/null +++ b/keyboards/bear_face/v3/keymaps/default_iso/readme.md @@ -0,0 +1,18 @@ +# default bear_face layout + +This layout replaces the stock layout on the Vortex Race 3. + +- Caps Lock indicator LED is enabled by default +- Layer Tap on Caps Lock (tap for Caps Lock, hold for _FN1) +- FORCE_NKRO enabled by default + +- Pn key is set to 'KC_NO' by default + * Might be a good place for a macro, or to put your PC to sleep, etc. + +- A combined function layer that mimics the sublegends on the stock caps (regardless of layout) + * 'Reset' will put the keyboard into DFU mode + * 'APP' sends 'KC_APP' + * Base layer toggles for QWERTY, COLEMAK, and DVORAK layouts (will persist after reboot) + +- New things in v3: + * v3.1c PCB is compatible with both rev1 (Micro-USB) and rev2 (USB-C) stock cases From 3a711f4cfa71419a22a22139d68c647ffa3f1fe4 Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Fri, 5 Jul 2024 11:22:08 +1000 Subject: [PATCH 038/204] Allow overriding `get_hardware_id()`. (#24051) --- platforms/arm_atsam/hardware_id.c | 2 +- platforms/avr/hardware_id.c | 2 +- platforms/chibios/hardware_id.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/platforms/arm_atsam/hardware_id.c b/platforms/arm_atsam/hardware_id.c index 8b3b35a4924..fc193e46d8a 100644 --- a/platforms/arm_atsam/hardware_id.c +++ b/platforms/arm_atsam/hardware_id.c @@ -3,7 +3,7 @@ #include "hardware_id.h" -hardware_id_t get_hardware_id(void) { +__attribute__((weak)) hardware_id_t get_hardware_id(void) { hardware_id_t id = {0}; return id; } diff --git a/platforms/avr/hardware_id.c b/platforms/avr/hardware_id.c index b61f0d92df8..302a800e0bb 100644 --- a/platforms/avr/hardware_id.c +++ b/platforms/avr/hardware_id.c @@ -10,7 +10,7 @@ #include #include "hardware_id.h" -hardware_id_t get_hardware_id(void) { +__attribute__((weak)) hardware_id_t get_hardware_id(void) { hardware_id_t id = {0}; for (uint8_t i = 0; i < 10; i += 1) { ((uint8_t*)&id)[i] = boot_signature_byte_get(i + 0x0E); diff --git a/platforms/chibios/hardware_id.c b/platforms/chibios/hardware_id.c index 1097db5966e..fb67a0a63eb 100644 --- a/platforms/chibios/hardware_id.c +++ b/platforms/chibios/hardware_id.c @@ -4,7 +4,7 @@ #include #include "hardware_id.h" -hardware_id_t get_hardware_id(void) { +__attribute__((weak)) hardware_id_t get_hardware_id(void) { hardware_id_t id = {0}; #if defined(RP2040) // Forward declare as including "hardware/flash.h" here causes more issues... From d0e89aeccada3f0df906dd4ff8fa7708b0d8234e Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Fri, 5 Jul 2024 12:02:39 +0100 Subject: [PATCH 039/204] Align LUFA suspend logic (#24055) --- tmk_core/protocol/lufa/lufa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index 2142b04460a..b0c9758d2fd 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -836,7 +836,7 @@ void protocol_pre_task(void) { dprintln("suspending keyboard"); while (USB_DeviceState == DEVICE_STATE_Suspended) { suspend_power_down(); - if (USB_Device_RemoteWakeupEnabled && suspend_wakeup_condition()) { + if (suspend_wakeup_condition() && USB_Device_RemoteWakeupEnabled) { USB_Device_SendRemoteWakeup(); clear_keyboard(); From 4ae0ca5a11c475ee49bbce13d29edbf9bd6fc636 Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Sat, 6 Jul 2024 09:57:54 +1000 Subject: [PATCH 040/204] Tap dance introspection (#24049) --- quantum/keymap_introspection.c | 23 +++++++++++++++++++ quantum/keymap_introspection.h | 25 +++++++++++++++++++-- quantum/process_keycode/process_tap_dance.c | 12 +++++++--- quantum/process_keycode/process_tap_dance.h | 4 +--- tests/tap_dance/examples.c | 3 ++- tests/tap_dance/tap_dance_layers/test.mk | 2 +- tests/tap_dance/test.mk | 3 +-- 7 files changed, 60 insertions(+), 12 deletions(-) diff --git a/quantum/keymap_introspection.c b/quantum/keymap_introspection.c index 71e3b429ead..4e95125335d 100644 --- a/quantum/keymap_introspection.c +++ b/quantum/keymap_introspection.c @@ -109,3 +109,26 @@ __attribute__((weak)) combo_t* combo_get(uint16_t combo_idx) { } #endif // defined(COMBO_ENABLE) + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Tap Dance + +#if defined(TAP_DANCE_ENABLE) + +uint16_t tap_dance_count_raw(void) { + return sizeof(tap_dance_actions) / sizeof(tap_dance_action_t); +} + +uint16_t tap_dance_count(void) { + return tap_dance_count_raw(); +} + +tap_dance_action_t* tap_dance_get_raw(uint16_t tap_dance_idx) { + return &tap_dance_actions[tap_dance_idx]; +} + +tap_dance_action_t* tap_dance_get(uint16_t tap_dance_idx) { + return tap_dance_get_raw(tap_dance_idx); +} + +#endif // defined(TAP_DANCE_ENABLE) diff --git a/quantum/keymap_introspection.h b/quantum/keymap_introspection.h index f7516bf42af..bc4dd93b4c8 100644 --- a/quantum/keymap_introspection.h +++ b/quantum/keymap_introspection.h @@ -61,9 +61,30 @@ uint16_t combo_count_raw(void); // Get the number of combos defined in the user's keymap, potentially stored dynamically uint16_t combo_count(void); -// Get the keycode for the encoder mapping location, stored in firmware rather than any other persistent storage +// Get the combo definition, stored in firmware rather than any other persistent storage combo_t* combo_get_raw(uint16_t combo_idx); -// Get the keycode for the encoder mapping location, potentially stored dynamically +// Get the combo definition, potentially stored dynamically combo_t* combo_get(uint16_t combo_idx); #endif // defined(COMBO_ENABLE) + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Tap Dance + +#if defined(TAP_DANCE_ENABLE) + +// Forward declaration of tap_dance_action_t so we don't need to deal with header reordering +struct tap_dance_action_t; +typedef struct tap_dance_action_t tap_dance_action_t; + +// Get the number of tap dances defined in the user's keymap, stored in firmware rather than any other persistent storage +uint16_t tap_dance_count_raw(void); +// Get the number of tap dances defined in the user's keymap, potentially stored dynamically +uint16_t tap_dance_count(void); + +// Get the tap dance definitions, stored in firmware rather than any other persistent storage +tap_dance_action_t* tap_dance_get_raw(uint16_t tap_dance_idx); +// Get the tap dance definitions, potentially stored dynamically +tap_dance_action_t* tap_dance_get(uint16_t tap_dance_idx); + +#endif // defined(TAP_DANCE_ENABLE) diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c index ce3b8fc81f7..11df62763dd 100644 --- a/quantum/process_keycode/process_tap_dance.c +++ b/quantum/process_keycode/process_tap_dance.c @@ -21,6 +21,7 @@ #include "action_util.h" #include "timer.h" #include "wait.h" +#include "keymap_introspection.h" static uint16_t active_td; static uint16_t last_tap_time; @@ -133,7 +134,7 @@ bool preprocess_tap_dance(uint16_t keycode, keyrecord_t *record) { if (!active_td || keycode == active_td) return false; - action = &tap_dance_actions[QK_TAP_DANCE_GET_INDEX(active_td)]; + action = tap_dance_get(QK_TAP_DANCE_GET_INDEX(active_td)); action->state.interrupted = true; action->state.interrupting_keycode = keycode; process_tap_dance_action_on_dance_finished(action); @@ -150,11 +151,16 @@ bool preprocess_tap_dance(uint16_t keycode, keyrecord_t *record) { } bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { + int td_index; tap_dance_action_t *action; switch (keycode) { case QK_TAP_DANCE ... QK_TAP_DANCE_MAX: - action = &tap_dance_actions[QK_TAP_DANCE_GET_INDEX(keycode)]; + td_index = QK_TAP_DANCE_GET_INDEX(keycode); + if (td_index >= tap_dance_count()) { + return false; + } + action = tap_dance_get(td_index); action->state.pressed = record->event.pressed; if (record->event.pressed) { @@ -182,7 +188,7 @@ void tap_dance_task(void) { if (!active_td || timer_elapsed(last_tap_time) <= GET_TAPPING_TERM(active_td, &(keyrecord_t){})) return; - action = &tap_dance_actions[QK_TAP_DANCE_GET_INDEX(active_td)]; + action = tap_dance_get(QK_TAP_DANCE_GET_INDEX(active_td)); if (!action->state.interrupted) { process_tap_dance_action_on_dance_finished(action); } diff --git a/quantum/process_keycode/process_tap_dance.h b/quantum/process_keycode/process_tap_dance.h index c0137c14a33..5cccbdf439a 100644 --- a/quantum/process_keycode/process_tap_dance.h +++ b/quantum/process_keycode/process_tap_dance.h @@ -35,7 +35,7 @@ typedef struct { typedef void (*tap_dance_user_fn_t)(tap_dance_state_t *state, void *user_data); -typedef struct { +typedef struct tap_dance_action_t { tap_dance_state_t state; struct { tap_dance_user_fn_t on_each_tap; @@ -78,8 +78,6 @@ typedef struct { #define TD_INDEX(code) QK_TAP_DANCE_GET_INDEX(code) #define TAP_DANCE_KEYCODE(state) TD(((tap_dance_action_t *)state) - tap_dance_actions) -extern tap_dance_action_t tap_dance_actions[]; - void reset_tap_dance(tap_dance_state_t *state); /* To be used internally */ diff --git a/tests/tap_dance/examples.c b/tests/tap_dance/examples.c index 5377b397d3c..4b6bdb20908 100644 --- a/tests/tap_dance/examples.c +++ b/tests/tap_dance/examples.c @@ -16,6 +16,7 @@ #include "quantum.h" #include "examples.h" +#include "keymap_introspection.h" // Example code from the tap dance documentation, adapted for testing @@ -83,7 +84,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case TD(CT_CLN): - action = &tap_dance_actions[QK_TAP_DANCE_GET_INDEX(keycode)]; + action = tap_dance_get(QK_TAP_DANCE_GET_INDEX(keycode)); if (!record->event.pressed && action->state.count && !action->state.finished) { tap_dance_tap_hold_t *tap_hold = (tap_dance_tap_hold_t *)action->user_data; tap_code16(tap_hold->tap); diff --git a/tests/tap_dance/tap_dance_layers/test.mk b/tests/tap_dance/tap_dance_layers/test.mk index b4cdc9b0880..a677fda6482 100644 --- a/tests/tap_dance/tap_dance_layers/test.mk +++ b/tests/tap_dance/tap_dance_layers/test.mk @@ -7,4 +7,4 @@ TAP_DANCE_ENABLE = yes -SRC += tap_dance_defs.c +INTROSPECTION_KEYMAP_C = tap_dance_defs.c diff --git a/tests/tap_dance/test.mk b/tests/tap_dance/test.mk index 041d9b4dc9a..0e727da9e8f 100644 --- a/tests/tap_dance/test.mk +++ b/tests/tap_dance/test.mk @@ -18,5 +18,4 @@ # -------------------------------------------------------------------------------- TAP_DANCE_ENABLE = yes - -SRC += examples.c +INTROSPECTION_KEYMAP_C = examples.c From 2477aa91617f51fc945b844c325455a2db90a55b Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 6 Jul 2024 11:14:09 +1000 Subject: [PATCH 041/204] [docs] Update RGBLight (Underglow) keycode names (#23999) --- docs/features/encoders.md | 6 ++--- docs/features/rgblight.md | 48 ++++++++++++++++++++------------------- docs/keycodes.md | 43 +++++++++++++++++++---------------- 3 files changed, 51 insertions(+), 46 deletions(-) diff --git a/docs/features/encoders.md b/docs/features/encoders.md index 73cbb4f3f3f..a674eaa4a64 100644 --- a/docs/features/encoders.md +++ b/docs/features/encoders.md @@ -85,9 +85,9 @@ Your `keymap.c` will then need an encoder mapping defined (for four layers and t #if defined(ENCODER_MAP_ENABLE) const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { [0] = { ENCODER_CCW_CW(MS_WHLU, MS_WHLD), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, - [1] = { ENCODER_CCW_CW(RGB_HUD, RGB_HUI), ENCODER_CCW_CW(RGB_SAD, RGB_SAI) }, - [2] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI), ENCODER_CCW_CW(RGB_SPD, RGB_SPI) }, - [3] = { ENCODER_CCW_CW(RGB_RMOD, RGB_MOD), ENCODER_CCW_CW(KC_RIGHT, KC_LEFT) }, + [1] = { ENCODER_CCW_CW(UG_HUED, UG_HUEU), ENCODER_CCW_CW(UG_SATD, UG_SATU) }, + [2] = { ENCODER_CCW_CW(UG_VALD, UG_VALU), ENCODER_CCW_CW(UG_SPDD, UG_SPDU) }, + [3] = { ENCODER_CCW_CW(UG_PREV, UG_NEXT), ENCODER_CCW_CW(KC_RIGHT, KC_LEFT) }, }; #endif ``` diff --git a/docs/features/rgblight.md b/docs/features/rgblight.md index ece1c104677..794398a0f95 100644 --- a/docs/features/rgblight.md +++ b/docs/features/rgblight.md @@ -59,30 +59,32 @@ Changing the **Value** sets the overall brightness.
## Keycodes -|Key |Aliases |Description | -|-------------------|----------|--------------------------------------------------------------------| -|`RGB_TOG` | |Toggle RGB lighting on or off | -|`RGB_MODE_FORWARD` |`RGB_MOD` |Cycle through modes, reverse direction when Shift is held | -|`RGB_MODE_REVERSE` |`RGB_RMOD`|Cycle through modes in reverse, forward direction when Shift is held| -|`RGB_HUI` | |Increase hue, decrease hue when Shift is held | -|`RGB_HUD` | |Decrease hue, increase hue when Shift is held | -|`RGB_SAI` | |Increase saturation, decrease saturation when Shift is held | -|`RGB_SAD` | |Decrease saturation, increase saturation when Shift is held | -|`RGB_VAI` | |Increase value (brightness), decrease value when Shift is held | -|`RGB_VAD` | |Decrease value (brightness), increase value when Shift is held | -|`RGB_MODE_PLAIN` |`RGB_M_P `|Static (no animation) mode | -|`RGB_MODE_BREATHE` |`RGB_M_B` |Breathing animation mode | -|`RGB_MODE_RAINBOW` |`RGB_M_R` |Rainbow animation mode | -|`RGB_MODE_SWIRL` |`RGB_M_SW`|Swirl animation mode | -|`RGB_MODE_SNAKE` |`RGB_M_SN`|Snake animation mode | -|`RGB_MODE_KNIGHT` |`RGB_M_K` |"Knight Rider" animation mode | -|`RGB_MODE_XMAS` |`RGB_M_X` |Christmas animation mode | -|`RGB_MODE_GRADIENT`|`RGB_M_G` |Static gradient animation mode | -|`RGB_MODE_RGBTEST` |`RGB_M_T` |Red, Green, Blue test animation mode | -|`RGB_MODE_TWINKLE` |`RGB_M_TW`|Twinkle animation mode | +|Key |Aliases |Description | +|------------------------------|----------|---------------------------------------------------------------------| +|`QK_UNDERGLOW_TOGGLE` |`UG_TOGG` |Toggle RGB lighting on or off | +|`QK_UNDERGLOW_MODE_NEXT` |`UG_NEXT` |Cycle through modes, reverse direction when Shift is held | +|`QK_UNDERGLOW_MODE_PREVIOUS` |`UG_PREV` |Cycle through modes in reverse, forward direction when Shift is held | +|`QK_UNDERGLOW_HUE_UP` |`UG_HUEU` |Increase hue, decrease hue when Shift is held | +|`QK_UNDERGLOW_HUE_DOWN` |`UG_HUED` |Decrease hue, increase hue when Shift is held | +|`QK_UNDERGLOW_SATURATION_UP` |`UG_SATU` |Increase saturation, decrease saturation when Shift is held | +|`QK_UNDERGLOW_SATURATION_DOWN`|`UG_SATD` |Decrease saturation, increase saturation when Shift is held | +|`QK_UNDERGLOW_VALUE_UP` |`UG_VALU` |Increase value (brightness), decrease value when Shift is held | +|`QK_UNDERGLOW_VALUE_DOWN` |`UG_VALD` |Decrease value (brightness), increase value when Shift is held | +|`QK_UNDERGLOW_SPEED_UP` |`UG_SPDU` |Increase effect speed (brightness), decrease speed when Shift is held| +|`QK_UNDERGLOW_SPEED_DOWN` |`UG_SPDD` |Decrease effect speed (brightness), increase speed when Shift is held| +|`RGB_MODE_PLAIN` |`RGB_M_P `|Static (no animation) mode (deprecated) | +|`RGB_MODE_BREATHE` |`RGB_M_B` |Breathing animation mode (deprecated) | +|`RGB_MODE_RAINBOW` |`RGB_M_R` |Rainbow animation mode (deprecated) | +|`RGB_MODE_SWIRL` |`RGB_M_SW`|Swirl animation mode (deprecated) | +|`RGB_MODE_SNAKE` |`RGB_M_SN`|Snake animation mode (deprecated) | +|`RGB_MODE_KNIGHT` |`RGB_M_K` |"Knight Rider" animation mode (deprecated) | +|`RGB_MODE_XMAS` |`RGB_M_X` |Christmas animation mode (deprecated) | +|`RGB_MODE_GRADIENT` |`RGB_M_G` |Static gradient animation mode (deprecated) | +|`RGB_MODE_RGBTEST` |`RGB_M_T` |Red, Green, Blue test animation mode (deprecated) | +|`RGB_MODE_TWINKLE` |`RGB_M_TW`|Twinkle animation mode (deprecated) | ::: tip -`RGB_*` keycodes cannot be used with functions like `tap_code16(RGB_HUI)` as they're not USB HID keycodes. If you wish to replicate similar behaviour in custom code within your firmware (e.g. inside `encoder_update_user()` or `process_record_user()`), the equivalent [RGB functions](#functions) should be used instead. +These keycodes cannot be used with functions like `tap_code16()` as they are not USB HID keycodes. If you wish to replicate similar behaviour in custom code within your firmware (e.g. inside `encoder_update_user()` or `process_record_user()`), the equivalent [RGB functions](#functions) should be used instead. ::: @@ -358,7 +360,7 @@ Lighting layers on split keyboards will require layer state synced to the slave ### Overriding RGB Lighting on/off status -Normally lighting layers are not shown when RGB Lighting is disabled (e.g. with `RGB_TOG` keycode). If you would like lighting layers to work even when the RGB Lighting is otherwise off, add `#define RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF` to your `config.h`. +Normally lighting layers are not shown when RGB Lighting is disabled (e.g. with `UG_TOGG` keycode). If you would like lighting layers to work even when the RGB Lighting is otherwise off, add `#define RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF` to your `config.h`. ### Retain brightness diff --git a/docs/keycodes.md b/docs/keycodes.md index ea8b2e7b650..9038c2b6d73 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -704,26 +704,29 @@ See also: [Dynamic Tapping Term](tap_hold#dynamic-tapping-term) See also: [RGB Lighting](features/rgblight) -|Key |Aliases |Description | -|-------------------|----------|--------------------------------------------------------------------| -|`RGB_TOG` | |Toggle RGB lighting on or off | -|`RGB_MODE_FORWARD` |`RGB_MOD` |Cycle through modes, reverse direction when Shift is held | -|`RGB_MODE_REVERSE` |`RGB_RMOD`|Cycle through modes in reverse, forward direction when Shift is held| -|`RGB_HUI` | |Increase hue, decrease hue when Shift is held | -|`RGB_HUD` | |Decrease hue, increase hue when Shift is held | -|`RGB_SAI` | |Increase saturation, decrease saturation when Shift is held | -|`RGB_SAD` | |Decrease saturation, increase saturation when Shift is held | -|`RGB_VAI` | |Increase value (brightness), decrease value when Shift is held | -|`RGB_VAD` | |Decrease value (brightness), increase value when Shift is held | -|`RGB_MODE_PLAIN` |`RGB_M_P `|Static (no animation) mode | -|`RGB_MODE_BREATHE` |`RGB_M_B` |Breathing animation mode | -|`RGB_MODE_RAINBOW` |`RGB_M_R` |Rainbow animation mode | -|`RGB_MODE_SWIRL` |`RGB_M_SW`|Swirl animation mode | -|`RGB_MODE_SNAKE` |`RGB_M_SN`|Snake animation mode | -|`RGB_MODE_KNIGHT` |`RGB_M_K` |"Knight Rider" animation mode | -|`RGB_MODE_XMAS` |`RGB_M_X` |Christmas animation mode | -|`RGB_MODE_GRADIENT`|`RGB_M_G` |Static gradient animation mode | -|`RGB_MODE_RGBTEST` |`RGB_M_T` |Red,Green,Blue test animation mode | +|Key |Aliases |Description | +|------------------------------|----------|---------------------------------------------------------------------| +|`QK_UNDERGLOW_TOGGLE` |`UG_TOGG` |Toggle RGB lighting on or off | +|`QK_UNDERGLOW_MODE_NEXT` |`UG_NEXT` |Cycle through modes, reverse direction when Shift is held | +|`QK_UNDERGLOW_MODE_PREVIOUS` |`UG_PREV` |Cycle through modes in reverse, forward direction when Shift is held | +|`QK_UNDERGLOW_HUE_UP` |`UG_HUEU` |Increase hue, decrease hue when Shift is held | +|`QK_UNDERGLOW_HUE_DOWN` |`UG_HUED` |Decrease hue, increase hue when Shift is held | +|`QK_UNDERGLOW_SATURATION_UP` |`UG_SATU` |Increase saturation, decrease saturation when Shift is held | +|`QK_UNDERGLOW_SATURATION_DOWN`|`UG_SATD` |Decrease saturation, increase saturation when Shift is held | +|`QK_UNDERGLOW_VALUE_UP` |`UG_VALU` |Increase value (brightness), decrease value when Shift is held | +|`QK_UNDERGLOW_VALUE_DOWN` |`UG_VALD` |Decrease value (brightness), increase value when Shift is held | +|`QK_UNDERGLOW_SPEED_UP` |`UG_SPDU` |Increase effect speed (brightness), decrease speed when Shift is held| +|`QK_UNDERGLOW_SPEED_DOWN` |`UG_SPDD` |Decrease effect speed (brightness), increase speed when Shift is held| +|`RGB_MODE_PLAIN` |`RGB_M_P `|Static (no animation) mode (deprecated) | +|`RGB_MODE_BREATHE` |`RGB_M_B` |Breathing animation mode (deprecated) | +|`RGB_MODE_RAINBOW` |`RGB_M_R` |Rainbow animation mode (deprecated) | +|`RGB_MODE_SWIRL` |`RGB_M_SW`|Swirl animation mode (deprecated) | +|`RGB_MODE_SNAKE` |`RGB_M_SN`|Snake animation mode (deprecated) | +|`RGB_MODE_KNIGHT` |`RGB_M_K` |"Knight Rider" animation mode (deprecated) | +|`RGB_MODE_XMAS` |`RGB_M_X` |Christmas animation mode (deprecated) | +|`RGB_MODE_GRADIENT` |`RGB_M_G` |Static gradient animation mode (deprecated) | +|`RGB_MODE_RGBTEST` |`RGB_M_T` |Red, Green, Blue test animation mode (deprecated) | +|`RGB_MODE_TWINKLE` |`RGB_M_TW`|Twinkle animation mode (deprecated) | ## RGB Matrix Lighting {#rgb-matrix-lighting} From e4dfbb075e13f79f6a18cfa9f210016fb66dffef Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 6 Jul 2024 12:23:54 +1000 Subject: [PATCH 042/204] `handwired/swiftrax/bumblebee`: fix layout name (#24064) --- .../handwired/swiftrax/bumblebee/keyboard.json | 5 ++++- .../swiftrax/bumblebee/keymaps/default/keymap.c | 6 +++--- .../swiftrax/bumblebee/keymaps/via/keymap.c | 14 ++++---------- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/keyboards/handwired/swiftrax/bumblebee/keyboard.json b/keyboards/handwired/swiftrax/bumblebee/keyboard.json index 9a68fe1b4fe..6dec52b59a4 100644 --- a/keyboards/handwired/swiftrax/bumblebee/keyboard.json +++ b/keyboards/handwired/swiftrax/bumblebee/keyboard.json @@ -36,8 +36,11 @@ }, "processor": "atmega32u4", "bootloader": "atmel-dfu", + "layout_aliases": { + "LAYOUT_all": "LAYOUT" + }, "layouts": { - "LAYOUT_all": { + "LAYOUT": { "layout": [ {"matrix": [0, 0], "x": 0, "y": 0}, {"matrix": [1, 0], "x": 1, "y": 0, "w": 1.5}, diff --git a/keyboards/handwired/swiftrax/bumblebee/keymaps/default/keymap.c b/keyboards/handwired/swiftrax/bumblebee/keymaps/default/keymap.c index fef24f402fa..b3976f33db5 100644 --- a/keyboards/handwired/swiftrax/bumblebee/keymaps/default/keymap.c +++ b/keyboards/handwired/swiftrax/bumblebee/keymaps/default/keymap.c @@ -26,19 +26,19 @@ along with this program. If not, see . #define DRV2605L_V_PEAK 5 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_all( + [0] = LAYOUT( KC_ESC , 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_BSPC, KC_DEL , KC_F13 , 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_HOME, KC_F14 , KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT, KC_UP , KC_END , KC_F15 , KC_LCTL, KC_LALT, KC_SPC , KC_MUTE, MO(1) , MO(2) , KC_LEFT, KC_DOWN, KC_RGHT ), - [1] = LAYOUT_all( + [1] = LAYOUT( _______, _______, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_MINS, KC_EQL , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), - [2] = LAYOUT_all( + [2] = LAYOUT( _______, _______, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, diff --git a/keyboards/handwired/swiftrax/bumblebee/keymaps/via/keymap.c b/keyboards/handwired/swiftrax/bumblebee/keymaps/via/keymap.c index 12791a69dd6..e25de6d7bd2 100644 --- a/keyboards/handwired/swiftrax/bumblebee/keymaps/via/keymap.c +++ b/keyboards/handwired/swiftrax/bumblebee/keymaps/via/keymap.c @@ -26,28 +26,22 @@ along with this program. If not, see . #define DRV2605L_V_PEAK 5 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_all( + [0] = LAYOUT( KC_ESC , 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_BSPC, KC_DEL , KC_F13 , 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_HOME, KC_F14 , KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT, KC_UP , KC_END , KC_F15 , KC_LCTL, KC_LALT, KC_SPC , KC_MUTE, MO(1) , MO(2) , KC_LEFT, KC_DOWN, KC_RGHT ), - [1] = LAYOUT_all( + [1] = LAYOUT( _______, _______, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_MINS, KC_EQL , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), - [2] = LAYOUT_all( + [2] = LAYOUT( _______, _______, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - [3] = LAYOUT_all( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), + ) }; From 1c02c3dfaddc3b781d49d4bd44303734c2ebf51a Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Sat, 6 Jul 2024 16:08:55 +1000 Subject: [PATCH 043/204] [docs] Fixup home link. (#24068) --- builddefs/docsgen/.vitepress/config.mts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builddefs/docsgen/.vitepress/config.mts b/builddefs/docsgen/.vitepress/config.mts index 289e08ef919..54ecae2e86b 100644 --- a/builddefs/docsgen/.vitepress/config.mts +++ b/builddefs/docsgen/.vitepress/config.mts @@ -33,7 +33,7 @@ export default defineConfig(({ mode }) => { }, title: 'QMK Firmware', - nav: [{ text: "Home", link: "./" }], + nav: [{ text: "Home", link: "/" }], search: { provider: "local", From e643fa03ef9ee9c1589aa4c9622bd62e52fd2e91 Mon Sep 17 00:00:00 2001 From: takashicompany Date: Sun, 7 Jul 2024 08:56:57 +0900 Subject: [PATCH 044/204] Fix dogtag/info.json (#23520) --- keyboards/takashicompany/dogtag/keyboard.json | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/keyboards/takashicompany/dogtag/keyboard.json b/keyboards/takashicompany/dogtag/keyboard.json index d65092ecca2..675b8e6bd25 100644 --- a/keyboards/takashicompany/dogtag/keyboard.json +++ b/keyboards/takashicompany/dogtag/keyboard.json @@ -19,7 +19,7 @@ }, "matrix_pins": { "cols": ["F4", "F5", "F6", "F7", "B1"], - "rows": ["B2", "B6", "B3"] + "rows": ["B2", "B6"] }, "diode_direction": "COL2ROW", "encoder": { @@ -34,7 +34,7 @@ "matrix_pins": { "right": { "cols": ["B1", "F7", "F6", "F5", "F4"], - "rows": ["B2", "B6", "B3"] + "rows": ["B2", "B6"] } } }, @@ -65,10 +65,10 @@ {"matrix": [0, 2], "x": 2, "y": 0}, {"matrix": [0, 3], "x": 3, "y": 0}, - {"matrix": [3, 1], "x": 8, "y": 0}, - {"matrix": [3, 2], "x": 9, "y": 0}, - {"matrix": [3, 3], "x": 10, "y": 0}, - {"matrix": [3, 4], "x": 11, "y": 0}, + {"matrix": [2, 1], "x": 8, "y": 0}, + {"matrix": [2, 2], "x": 9, "y": 0}, + {"matrix": [2, 3], "x": 10, "y": 0}, + {"matrix": [2, 4], "x": 11, "y": 0}, {"matrix": [1, 0], "x": 0, "y": 1}, {"matrix": [1, 1], "x": 1, "y": 1}, @@ -76,11 +76,11 @@ {"matrix": [1, 3], "x": 3, "y": 1}, {"matrix": [1, 4], "x": 4, "y": 2}, - {"matrix": [4, 0], "x": 7, "y": 2}, - {"matrix": [4, 1], "x": 8, "y": 1}, - {"matrix": [4, 2], "x": 9, "y": 1}, - {"matrix": [4, 3], "x": 10, "y": 1}, - {"matrix": [4, 4], "x": 11, "y": 1} + {"matrix": [3, 0], "x": 7, "y": 2}, + {"matrix": [3, 1], "x": 8, "y": 1}, + {"matrix": [3, 2], "x": 9, "y": 1}, + {"matrix": [3, 3], "x": 10, "y": 1}, + {"matrix": [3, 4], "x": 11, "y": 1} ] } } From 54f907bfe91f9cf452f7cee18f2534187763c2bc Mon Sep 17 00:00:00 2001 From: "Y.KEISUKE" Date: Mon, 8 Jul 2024 07:45:35 +0900 Subject: [PATCH 045/204] Fix for encoders and support ENCODER_MAP_ENABLE on Planck rev7 (#23967) Co-authored-by: Nick Brassel --- .../planck/rev7/keymaps/default/config.h | 7 ++ .../planck/rev7/keymaps/default/keymap.c | 89 ++++++++++++++++--- keyboards/planck/rev7/matrix.c | 22 +++-- keyboards/planck/rev7/readme.md | 37 +++++++- 4 files changed, 133 insertions(+), 22 deletions(-) diff --git a/keyboards/planck/rev7/keymaps/default/config.h b/keyboards/planck/rev7/keymaps/default/config.h index fbbab996e1e..937d6a5e419 100644 --- a/keyboards/planck/rev7/keymaps/default/config.h +++ b/keyboards/planck/rev7/keymaps/default/config.h @@ -41,3 +41,10 @@ - etc. */ // #define MIDI_ADVANCED + +/* + * Encoder options + */ +// #define PLANCK_ENCODER_SETTLE_PIN_STATE_DELAY 20 +// #define ENCODER_MAP_KEY_DELAY 10 +// #define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/rev7/keymaps/default/keymap.c b/keyboards/planck/rev7/keymaps/default/keymap.c index 4ac4c0de4f8..85f5097332c 100644 --- a/keyboards/planck/rev7/keymaps/default/keymap.c +++ b/keyboards/planck/rev7/keymaps/default/keymap.c @@ -147,13 +147,69 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_ADJUST] = LAYOUT_planck_grid( - _______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, QK_BOOT, DB_TOGG, UG_TOGG, UG_NEXT, UG_HUEU, UG_HUED, UG_SATU, UG_SATD, UG_SPDU, UG_SPDD, KC_DEL , _______, EE_CLR, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) }; + +#ifdef ENCODER_MAP_ENABLE +/* Rotary Encoders + */ +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + /* Qwerty + * v- (index) Clockwise / Counter Clockwise v- (index) Clockwise / Counter Clockwise + * ,---------------------------------------------------------------------------------------. + * | (0) Vol- / Vol+ | | | | | | | | | | | (4) Vol- / Vol+ | + * |-----------------------+---+---+---+---+---+---+---+---+---+---+-----------------------| + * | (1) KC_MNXT / KC_MPRV | | | | | | | | | | | (5) KC_MNXT / KC_MPRV | + * |-----------------------+---+---+---+---+---+---+---+---+---+---+-----------------------| + * | (2) KC_WBAK / KC_WFWD | | | | | | | | | | | (6) KC_SPC / KC_ENT | + * |-----------------------+---+---+---+---+---+---+---+---+---+---+-----------------------| + * | (3) KC_LEFT / KC_RGHT | | | | | | | | | | (7) KC_DOWN / KC_UP | + * `---------------------------------------------------------------------------------------' + */ + [_QWERTY] = { + // LEFT SIDE (index 0 to 3) + ENCODER_CCW_CW(KC_VOLU, KC_VOLD), + ENCODER_CCW_CW(KC_MNXT, KC_MPRV), + ENCODER_CCW_CW(KC_WBAK, KC_WFWD), + ENCODER_CCW_CW(KC_LEFT, KC_RGHT), + // RIGHT SIDE (index 4 to 7) + ENCODER_CCW_CW(KC_VOLU, KC_VOLD), + ENCODER_CCW_CW(KC_MNXT, KC_MPRV), + ENCODER_CCW_CW(KC_SPC, KC_ENT), + ENCODER_CCW_CW(KC_DOWN, KC_UP) + }, + + /* Adjust (Lower + Raise) + * v- (index) Clockwise / Counter Clockwise v- (index) Clockwise / Counter Clockwise + * ,---------------------------------------------------------------------------------------. + * | (0) _______ / _______ | | | | | | | | | | | (4) _______ / _______ | + * |-----------------------+---+---+---+---+---+---+---+---+---+---+-----------------------| + * | (1) _______ / _______ | | | | | | | | | | | (5) _______ / _______ | + * |-----------------------+---+---+---+---+---+---+---+---+---+---+-----------------------| + * | (2) UG_NEXT / UG_PREV | | | | | | | | | | | (6) SAT- / SAT+ | + * |-----------------------+---+---+---+---+---+---+---+---+---+---+-----------------------| + * | (3) UG_VALD / UG_VALU | | | | | | | | | | (7) HUE- / HUE+ | + * `---------------------------------------------------------------------------------------' + */ + [_ADJUST] = { + // LEFT SIDE (index 0 to 3) + ENCODER_CCW_CW(_______, _______), + ENCODER_CCW_CW(_______, _______), + ENCODER_CCW_CW(UG_NEXT, UG_PREV), + ENCODER_CCW_CW(UG_VALD, UG_VALU), + // RIGHT SIDE (index 4 to 7) + ENCODER_CCW_CW(_______, _______), + ENCODER_CCW_CW(_______, _______), + ENCODER_CCW_CW(UG_SATD, UG_SATU), + ENCODER_CCW_CW(UG_HUEU, UG_HUED) + } +}; +#endif /* clang-format on */ #ifdef AUDIO_ENABLE @@ -161,11 +217,18 @@ float plover_song[][2] = SONG(PLOVER_SOUND); float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); #endif +bool play_encoder_melody(uint8_t index, bool clockwise); + layer_state_t layer_state_set_user(layer_state_t state) { return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); } bool process_record_user(uint16_t keycode, keyrecord_t *record) { +#ifdef ENCODER_MAP_ENABLE + if (IS_ENCODEREVENT(record->event) && record->event.pressed) { + play_encoder_melody(record->event.key.col, record->event.type == ENCODER_CCW_EVENT); + } +#endif switch (keycode) { case QWERTY: if (record->event.pressed) { @@ -228,13 +291,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { /* clang-format off */ float melody[8][2][2] = { - {{440.0f, 8}, {440.0f, 24}}, - {{440.0f, 8}, {440.0f, 24}}, - {{440.0f, 8}, {440.0f, 24}}, - {{440.0f, 8}, {440.0f, 24}}, - {{440.0f, 8}, {440.0f, 24}}, - {{440.0f, 8}, {440.0f, 24}}, - {{440.0f, 8}, {440.0f, 24}}, + {{440.0f, 8}, {440.0f, 24}}, + {{440.0f, 8}, {440.0f, 24}}, + {{440.0f, 8}, {440.0f, 24}}, + {{440.0f, 8}, {440.0f, 24}}, + {{440.0f, 8}, {440.0f, 24}}, + {{440.0f, 8}, {440.0f, 24}}, + {{440.0f, 8}, {440.0f, 24}}, {{440.0f, 8}, {440.0f, 24}}, }; /* clang-format on */ @@ -251,7 +314,7 @@ float melody[8][2][2] = { #define ET12_MAJOR_THIRD 1.259921 #define ET12_PERFECT_FOURTH 1.33484 #define ET12_TRITONE 1.414214 -#define ET12_PERFECT_FIFTH 1.498307 +#define ET12_PERFECT_FIFTH 1.498307 deferred_token tokens[8]; @@ -260,7 +323,7 @@ uint32_t reset_note(uint32_t trigger_time, void *note) { return 0; } -bool encoder_update_user(uint8_t index, bool clockwise) { +bool play_encoder_melody(uint8_t index, bool clockwise) { cancel_deferred_exec(tokens[index]); if (clockwise) { melody[index][1][0] = melody[index][1][0] * ET12_MINOR_SECOND; @@ -275,6 +338,10 @@ bool encoder_update_user(uint8_t index, bool clockwise) { return false; } +bool encoder_update_user(uint8_t index, bool clockwise) { + return play_encoder_melody(index, clockwise); +} + bool dip_switch_update_user(uint8_t index, bool active) { switch (index) { case 0: { @@ -303,4 +370,4 @@ bool dip_switch_update_user(uint8_t index, bool active) { } } return true; -} \ No newline at end of file +} diff --git a/keyboards/planck/rev7/matrix.c b/keyboards/planck/rev7/matrix.c index 777bd6a7fe8..44f532db656 100644 --- a/keyboards/planck/rev7/matrix.c +++ b/keyboards/planck/rev7/matrix.c @@ -111,13 +111,21 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) { return changed; } +#if defined(ENCODER_ENABLE) || defined(ENCODER_MAP_ENABLE) +#if !defined(PLANCK_ENCODER_SETTLE_PIN_STATE_DELAY) +# define PLANCK_ENCODER_SETTLE_PIN_STATE_DELAY 10 +#endif + +void encoder_quadrature_init_pin(uint8_t index, bool pad_b) { +} + uint8_t encoder_quadrature_read_pin(uint8_t index, bool pad_b) { - pin_t pin = pad_b ? B13: B12; - gpio_set_pin_input_high(pin); - gpio_write_pin_low(matrix_row_pins[index]); - wait_us(10); - uint8_t ret = gpio_read_pin(pin) ? 1 : 0; - gpio_set_pin_input_low(matrix_row_pins[index]); - gpio_set_pin_input_low(pin); + pin_t col_pin = pad_b ? B13 : B12; + gpio_set_pin_output(col_pin); + gpio_write_pin_high(col_pin); + wait_us(PLANCK_ENCODER_SETTLE_PIN_STATE_DELAY); + uint8_t ret = gpio_read_pin(matrix_row_pins[index]) ? 0 : 1; + gpio_set_pin_input_low(col_pin); return ret; } +#endif // ENCODER_ENABLE || ENCODER_MAP_ENABLE diff --git a/keyboards/planck/rev7/readme.md b/keyboards/planck/rev7/readme.md index 6a4df377046..940976bfce8 100644 --- a/keyboards/planck/rev7/readme.md +++ b/keyboards/planck/rev7/readme.md @@ -14,7 +14,8 @@ See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_to ## Encoders -Encoders must have matching pulse & detent resolutions (e.g. 24/24) for the scanning to work properly. Multiple encoders can be used at the same time, and are zero-indexed (compared to being one-indexed on the PCB's silkscreen) in the `encoder_update_user(uint8_t index, bool clockwise)` function: +Encoders must have matching pulse & detent resolutions (e.g. 24/24) for the scanning to work properly. Multiple encoders can be used at the same time. +If an encoder has a switch built-in, it's connected to the key at that location with index number: ``` ,-----------------------------------------------------------------------------------. @@ -28,7 +29,35 @@ Encoders must have matching pulse & detent resolutions (e.g. 24/24) for the scan `-----------------------------------------------------------------------------------' ``` -If an encoder has a switch built-in, it's connected to the key at that location. On the default keymap, each encoder will play its own rising/falling tone sequence when rotated, and will reset the pitch after one second of inactivity. The encoder map feature is not currently supported. +Planck rev7 supports `ENCODER_ENABLE` and `ENCODER_MAP_ENABLE`. If both `ENCODER_MAP_ENABLE` and `ENCODER_ENABLE` are defined, `ENCODER_MAP_ENABLE` takes precedence. On the default keymap, each encoder will play its own rising/falling tone sequence when rotated, and will reset the pitch after one second of inactivity. + +### With ENCODER_ENABLE + +Define it as follows in `rules.mk`: + +``` +ENCODER_ENABLE = yes +``` + +Zero-indexed (compared to being one-indexed on the PCB's silkscreen) in the `encoder_update_user(uint8_t index, bool clockwise)` function. + +### With ENCODER_MAP_ENABLE + +Define it as follows in `rules.mk`: + +``` +ENCODER_ENABLE = yes +ENCODER_MAP_ENABLE = yes +``` + +If you enable `ENCODER_MAP_ENABLE`, define `const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS]` and configure your keycodes. If you enable `ENCODER_MAP_ENABLE`, `encoder_update_user` is not used directly. + +Additionally, you can use the following `config.h` options: + +```c +#define ENCODER_MAP_KEY_DELAY 10 +#define ENCODER_RESOLUTION 4 +``` ## Some Planck-specific config.h options: @@ -37,6 +66,6 @@ If an encoder has a switch built-in, it's connected to the key at that location. #define PLANCK_WATCHDOG_TIMEOUT 1.0 // disables the watchdog timer - you may want to disable the watchdog timer if you use longer macros #define PLANCK_WATCHDOG_DISABLE -// the resolution of the encoders used in the encoder matrix -#define PLANCK_ENCODER_RESOLUTION 4 +// Sets the time to wait for the rotary encoder pin state to stabilize while scanning (Default is 20(us)) +#define PLANCK_ENCODER_SETTLE_PIN_STATE_DELAY 20 ``` From c97ec805cd1096bb60bf55ab19973dc01bd043b4 Mon Sep 17 00:00:00 2001 From: jack Date: Wed, 10 Jul 2024 13:19:06 -0600 Subject: [PATCH 046/204] [Keyboard] Add boardsource/the_q (#23782) * initial unsplit keyboard * move shared code * unsplit: fix underglow led x,y & remove unecessary code * unsplit: remove split code & tidy readme * unsplit: limit brightness & community layout * rename keyboard * the_q: tidy keymap & readme * lulu: remove accidental build target * rename file --- keyboards/boardsource/lib/oled.c | 20 ++ .../{unicorne/unicorne.h => lib/oled.h} | 95 ++++---- keyboards/boardsource/lulu/avr/rules.mk | 1 + keyboards/boardsource/lulu/lulu.c | 222 +----------------- keyboards/boardsource/lulu/rp2040/rules.mk | 1 + keyboards/boardsource/the_q/keyboard.json | 142 +++++++++++ .../the_q/keymaps/default/keymap.json | 25 ++ .../boardsource/the_q/keymaps/via/keymap.json | 30 +++ keyboards/boardsource/the_q/readme.md | 23 ++ keyboards/boardsource/the_q/rules.mk | 1 + keyboards/boardsource/the_q/the_q.c | 14 ++ keyboards/boardsource/unicorne/rules.mk | 1 + keyboards/boardsource/unicorne/unicorne.c | 22 +- 13 files changed, 314 insertions(+), 283 deletions(-) create mode 100644 keyboards/boardsource/lib/oled.c rename keyboards/boardsource/{unicorne/unicorne.h => lib/oled.h} (84%) create mode 100644 keyboards/boardsource/lulu/avr/rules.mk create mode 100644 keyboards/boardsource/the_q/keyboard.json create mode 100644 keyboards/boardsource/the_q/keymaps/default/keymap.json create mode 100644 keyboards/boardsource/the_q/keymaps/via/keymap.json create mode 100644 keyboards/boardsource/the_q/readme.md create mode 100644 keyboards/boardsource/the_q/rules.mk create mode 100644 keyboards/boardsource/the_q/the_q.c diff --git a/keyboards/boardsource/lib/oled.c b/keyboards/boardsource/lib/oled.c new file mode 100644 index 00000000000..c0fb6ab4a61 --- /dev/null +++ b/keyboards/boardsource/lib/oled.c @@ -0,0 +1,20 @@ +// Copyright 2024 jack (@waffle87) +// SPDX-License-Identifier: GPL-2.0-or-later +#include "oled.h" + +void render_layer_state(void) { + switch (get_highest_layer(layer_state)) { + case 0: + oled_write_raw_P(layer0_img, sizeof(layer0_img)); + break; + case 1: + oled_write_raw_P(layer1_img, sizeof(layer1_img)); + break; + case 2: + oled_write_raw_P(layer2_img, sizeof(layer2_img)); + break; + case 3: + oled_write_raw_P(layer3_img, sizeof(layer3_img)); + break; + } +} diff --git a/keyboards/boardsource/unicorne/unicorne.h b/keyboards/boardsource/lib/oled.h similarity index 84% rename from keyboards/boardsource/unicorne/unicorne.h rename to keyboards/boardsource/lib/oled.h index 68bbeeb18ab..4778be20b0d 100644 --- a/keyboards/boardsource/unicorne/unicorne.h +++ b/keyboards/boardsource/lib/oled.h @@ -1,54 +1,12 @@ -// Copyright 2023 jack (@waffle87) +// Copyright 2024 jack (@waffle87) // SPDX-License-Identifier: GPL-2.0-or-later #pragma once #include "quantum.h" -#ifdef OLED_ENABLE -// clang-format off -static const char PROGMEM logo[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xc0, 0xc0, 0xc0, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, - 0xc0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x01, 0xe3, 0xe7, 0xe7, 0xe3, - 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xc0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0x00, 0x00, 0x00, - 0x80, 0xc0, 0xc0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, - 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xc0, 0xc0, 0xe0, 0xe0, 0xe0, 0x00, 0x00, 0xe0, 0xe0, 0xe0, 0xe0, - 0x80, 0xc0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, - 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xc0, 0xc0, 0xc0, - 0xc0, 0xc0, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x01, 0x01, 0x01, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, - 0x00, 0x00, 0x00, 0x7e, 0xff, 0xff, 0xff, 0xe7, 0xc1, 0x81, 0x81, 0x81, 0xc1, 0x00, 0x00, 0x7f, - 0xff, 0xff, 0xff, 0xe3, 0xc1, 0x81, 0x81, 0xc1, 0xe3, 0xff, 0xff, 0xff, 0xff, 0x3c, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, - 0x03, 0x01, 0x01, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, - 0xcd, 0x8c, 0x8c, 0x8c, 0x8d, 0xcf, 0xcf, 0xcf, 0xcf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x03, 0x03, 0x07, 0x07, 0x07, - 0x07, 0x07, 0x07, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x03, 0x07, 0x07, 0x07, 0x03, 0x03, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x03, 0x03, 0x07, 0x07, 0x07, 0x07, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, - 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x03, - 0x07, 0x07, 0x07, 0x07, 0x07, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; +void render_layer_state(void); -static const char PROGMEM layer_zero[] = { +// clang-format off +static const char PROGMEM layer0_img[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xfc, 0x18, 0x30, 0x60, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -83,8 +41,7 @@ static const char PROGMEM layer_zero[] = { 0x00, 0x01, 0x03, 0x07, 0x06, 0x0c, 0x0c, 0x0c, 0x0c, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; - -static const char PROGMEM layer_one[] = { +static const char PROGMEM layer1_img[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xfc, 0x18, 0x30, 0x60, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -119,8 +76,7 @@ static const char PROGMEM layer_one[] = { 0x00, 0x01, 0x03, 0x07, 0x06, 0x0c, 0x0c, 0x0c, 0x0c, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; - -static const char PROGMEM layer_two[] = { +static const char PROGMEM layer2_img[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xfc, 0x18, 0x30, 0x60, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -155,8 +111,7 @@ static const char PROGMEM layer_two[] = { 0x00, 0x01, 0x03, 0x07, 0x06, 0x0c, 0x0c, 0x0c, 0x0c, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; - -static const char PROGMEM layer_three[] = { +static const char PROGMEM layer3_img[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xfc, 0x18, 0x30, 0x60, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, @@ -190,5 +145,39 @@ static const char PROGMEM layer_three[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x01, 0x03, 0x07, 0x06, 0x0c, 0x0c, 0x0c, 0x0c, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static const char PROGMEM bs_logo_img[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xc0, 0xc0, 0x60, 0x60, 0x60, + 0x60, 0x60, 0xc0, 0xc0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xe0, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, + 0x00, 0xe0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xfc, 0x1e, 0x07, 0x03, 0x01, 0x00, 0x00, 0x00, 0x80, 0xc0, + 0x80, 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, 0x0e, 0xfc, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, + 0xe0, 0xc0, 0x80, 0x80, 0xc0, 0xc0, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x1f, 0xff, 0xff, 0xc0, 0xc0, 0x80, 0xc0, 0xc0, 0xe0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x1f, 0x78, 0xe0, 0xc0, 0x80, 0x80, 0x00, 0x00, 0x00, 0x01, + 0x01, 0x00, 0x00, 0x80, 0x80, 0xc0, 0xe0, 0x78, 0x3f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; // clang-format on -#endif diff --git a/keyboards/boardsource/lulu/avr/rules.mk b/keyboards/boardsource/lulu/avr/rules.mk new file mode 100644 index 00000000000..de6a3d8afca --- /dev/null +++ b/keyboards/boardsource/lulu/avr/rules.mk @@ -0,0 +1 @@ +SRC += lib/oled.c diff --git a/keyboards/boardsource/lulu/lulu.c b/keyboards/boardsource/lulu/lulu.c index 8d011268c4b..b20228a7d7f 100644 --- a/keyboards/boardsource/lulu/lulu.c +++ b/keyboards/boardsource/lulu/lulu.c @@ -1,6 +1,7 @@ // Copyright 2022 Cole Smith // SPDX-License-Identifier: GPL-2.0-or-later #include "quantum.h" +#include "lib/oled.h" #ifdef ENCODER_ENABLE bool encoder_update_kb(uint8_t index, bool clockwise) { @@ -24,225 +25,20 @@ bool encoder_update_kb(uint8_t index, bool clockwise) { #ifdef OLED_ENABLE oled_rotation_t oled_init_kb(oled_rotation_t rotation) { - if (!is_keyboard_master()) { - return OLED_ROTATION_180; - } - return rotation; -} - -void render_layer1_logo(void){ - static const char PROGMEM layer_logo[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xfc, 0x18, 0x30, 0x60, 0xe0, 0xc0, 0x80, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, - 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, - 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, - 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc8, 0xf8, 0xf0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x0f, 0x0f, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, - 0xfc, 0x0e, 0x07, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xf0, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0x80, 0x00, - 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xf0, 0x60, - 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x70, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x07, 0x03, 0x01, 0x03, 0x07, - 0x07, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, - 0x00, 0x01, 0x03, 0x07, 0x06, 0x0c, 0x0c, 0x0c, 0x0c, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 - }; - oled_write_raw_P(layer_logo, sizeof(layer_logo)); -} - -void render_layer2_logo(void){ - static const char PROGMEM layer_logo[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xfc, 0x18, 0x30, 0x60, 0xe0, 0xc0, 0x80, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, - 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc8, 0xf8, 0xf0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x0f, 0x0f, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xf0, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0x80, 0x00, - 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, - 0x3f, 0x70, 0xe0, 0xc0, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xf0, 0x60, - 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x70, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x07, 0x03, 0x01, 0x03, 0x07, - 0x07, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, - 0x00, 0x01, 0x03, 0x07, 0x06, 0x0c, 0x0c, 0x0c, 0x0c, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 - }; - oled_write_raw_P(layer_logo, sizeof(layer_logo)); -} - -void render_layer3_logo(void){ - static const char PROGMEM layer_logo[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xfc, 0x18, 0x30, 0x60, 0xe0, 0xc0, 0x80, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, - 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc8, 0xf8, 0xf0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x0f, 0x0f, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xf0, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0x80, 0x00, - 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xc0, 0xe0, 0x70, 0x38, 0x1f, 0x07, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xf0, 0x60, - 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x70, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x07, 0x03, 0x01, 0x03, 0x07, - 0x07, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, - 0x00, 0x01, 0x03, 0x07, 0x06, 0x0c, 0x0c, 0x0c, 0x0c, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 - }; - oled_write_raw_P(layer_logo, sizeof(layer_logo)); -} - -void render_layer4_logo(void){ - static const char PROGMEM layer_logo[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xfc, 0x18, 0x30, 0x60, 0xe0, 0xc0, 0x80, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, - 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, - 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, - 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc8, 0xf8, 0xf0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x0f, 0x0f, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x07, 0x0e, 0xfc, 0xf0, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xf0, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0x80, 0x00, - 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xf0, 0x60, - 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x70, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x07, 0x03, 0x01, 0x03, 0x07, - 0x07, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, - 0x00, 0x01, 0x03, 0x07, 0x06, 0x0c, 0x0c, 0x0c, 0x0c, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 - }; - oled_write_raw_P(layer_logo, sizeof(layer_logo)); -} - -void render_logo(void) { - static const char PROGMEM logo[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xc0, 0xc0, 0x60, 0x60, 0x60, - 0x60, 0x60, 0xc0, 0xc0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xe0, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, - 0x00, 0xe0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xfc, 0x1e, 0x07, 0x03, 0x01, 0x00, 0x00, 0x00, 0x80, 0xc0, - 0x80, 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, 0x0e, 0xfc, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, - 0xe0, 0xc0, 0x80, 0x80, 0xc0, 0xc0, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, - 0x00, 0x1f, 0xff, 0xff, 0xc0, 0xc0, 0x80, 0xc0, 0xc0, 0xe0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x1f, 0x78, 0xe0, 0xc0, 0x80, 0x80, 0x00, 0x00, 0x00, 0x01, - 0x01, 0x00, 0x00, 0x80, 0x80, 0xc0, 0xe0, 0x78, 0x3f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }; - oled_write_raw_P(logo, sizeof(logo)); -} - -void process_layer_state(void) { - switch (get_highest_layer(layer_state)) { - case 0: - render_layer1_logo(); - break; - case 1: - render_layer2_logo(); - break; - case 2: - render_layer3_logo(); - break; - case 3: - render_layer4_logo(); - break; + if (!is_keyboard_master()) { + return OLED_ROTATION_180; } + return rotation; } bool oled_task_kb(void) { - if (!oled_task_user()) { return false; } + if (!oled_task_user()) { + return false; + } if (is_keyboard_master()) { - process_layer_state(); + render_layer_state(); } else { - render_logo(); + oled_write_raw_P(bs_logo_img, sizeof(bs_logo_img)); } return false; } diff --git a/keyboards/boardsource/lulu/rp2040/rules.mk b/keyboards/boardsource/lulu/rp2040/rules.mk index 161ec22b16e..118c27fc6a2 100644 --- a/keyboards/boardsource/lulu/rp2040/rules.mk +++ b/keyboards/boardsource/lulu/rp2040/rules.mk @@ -1 +1,2 @@ SERIAL_DRIVER = vendor +SRC += lib/oled.c diff --git a/keyboards/boardsource/the_q/keyboard.json b/keyboards/boardsource/the_q/keyboard.json new file mode 100644 index 00000000000..61ff49330ed --- /dev/null +++ b/keyboards/boardsource/the_q/keyboard.json @@ -0,0 +1,142 @@ +{ + "manufacturer": "Boardsource", + "keyboard_name": "The Q", + "maintainer": "waffle87", + "development_board": "promicro", + "diode_direction": "COL2ROW", + "features": { + "bootmagic": true, + "extrakey": true, + "mousekey": true, + "nkro": true, + "rgb_matrix": true, + "oled": true + }, + "matrix_pins": { + "rows": ["B2", "B3", "B1", "F7", "F6", "F5", "F4"], + "cols": ["D4", "C6", "D7", "E6", "B4", "B5"] + }, + "url": "https://boardsource.xyz", + "usb": { + "device_version": "1.0.0", + "pid": "0x7552", + "vid": "0x4273" + }, + "ws2812": { + "pin": "B6" + }, + "rgb_matrix": { + "animations": { + "alphas_mods": true, + "band_sat": true, + "band_val": true, + "breathing": true, + "gradient_left_right": true, + "gradient_up_down": true + }, + "default": { + "animation": "alphas_mods" + }, + "max_brightness": 150, + "driver": "ws2812", + "layout": [ + {"x": 112.2, "y": 10.6, "flags": 2}, + {"x": 181, "y": 5.3, "flags": 2}, + {"x": 215.4, "y": 53.3, "flags": 2}, + {"x": 112.2, "y": 64, "flags": 2}, + {"x": 26.2, "y": 53.3, "flags": 2}, + {"x": 43.4, "y": 5.3, "flags": 2}, + {"matrix": [0, 1], "x": 17.6, "y": 0, "flags": 4}, + {"matrix": [1, 1], "x": 17.6, "y": 42.7, "flags": 4}, + {"matrix": [2, 1], "x": 17.6, "y": 21.4, "flags": 4}, + {"matrix": [2, 2], "x": 34.8, "y": 21.4, "flags": 4}, + {"matrix": [1, 2], "x": 34.8, "y": 42.7, "flags": 4}, + {"matrix": [0, 2], "x": 34.8, "y": 0, "flags": 4}, + {"matrix": [0, 3], "x": 52, "y": 0, "flags": 4}, + {"matrix": [1, 3], "x": 52, "y": 42.7, "flags": 4}, + {"matrix": [2, 3], "x": 52, "y": 21.4, "flags": 4}, + {"matrix": [2, 4], "x": 69.2, "y": 21.4, "flags": 4}, + {"matrix": [1, 4], "x": 69.2, "y": 42.7, "flags": 4}, + {"matrix": [0, 4], "x": 69.2, "y": 0, "flags": 4}, + {"matrix": [0, 5], "x": 86.4, "y": 0, "flags": 4}, + {"matrix": [1, 5], "x": 86.4, "y": 42.7, "flags": 4}, + {"matrix": [2, 5], "x": 86.4, "y": 21.4, "flags": 4}, + {"matrix": [3, 0], "x": 69.2, "y": 20, "flags": 1}, + {"matrix": [3, 1], "x": 86.4, "y": 20, "flags": 1}, + {"matrix": [3, 2], "x": 103.6, "y": 64, "flags": 1}, + {"matrix": [3, 3], "x": 120.8, "y": 64, "flags": 1}, + {"matrix": [3, 4], "x": 138, "y": 20, "flags": 1}, + {"matrix": [3, 5], "x": 155.2, "y": 20, "flags": 1}, + {"matrix": [4, 5], "x": 138, "y": 21.4, "flags": 4}, + {"matrix": [5, 5], "x": 138, "y": 42.7, "flags": 4}, + {"matrix": [6, 5], "x": 138, "y": 0, "flags": 4}, + {"matrix": [6, 4], "x": 155.2, "y": 0, "flags": 4}, + {"matrix": [5, 4], "x": 155.2, "y": 42.7, "flags": 4}, + {"matrix": [4, 4], "x": 155.2, "y": 21.4, "flags": 4}, + {"matrix": [4, 3], "x": 172.4, "y": 21.4, "flags": 4}, + {"matrix": [5, 3], "x": 172.4, "y": 42.7, "flags": 4}, + {"matrix": [6, 3], "x": 172.4, "y": 0, "flags": 4}, + {"matrix": [6, 2], "x": 189.6, "y": 0, "flags": 4}, + {"matrix": [5, 2], "x": 189.6, "y": 42.7, "flags": 4}, + {"matrix": [4, 2], "x": 189.6, "y": 21.4, "flags": 4}, + {"matrix": [4, 1], "x": 206.8, "y": 21.4, "flags": 4}, + {"matrix": [5, 1], "x": 206.8, "y": 42.7, "flags": 4}, + {"matrix": [6, 1], "x": 206.8, "y": 0, "flags": 4}, + {"matrix": [6, 0], "x": 224, "y": 0, "flags": 1}, + {"matrix": [5, 0], "x": 224, "y": 42.7, "flags": 1}, + {"matrix": [4, 0], "x": 224, "y": 21.4, "flags": 1}, + {"matrix": [2, 0], "x": 0, "y": 21.4, "flags": 1}, + {"matrix": [1, 0], "x": 0, "y": 42.7, "flags": 1}, + {"matrix": [0, 0], "x": 0, "y": 0, "flags": 1} + ] + }, + "community_layouts": ["split_3x6_3"], + "layouts": { + "LAYOUT_split_3x6_3": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0.25}, + {"matrix": [0, 1], "x": 1, "y": 0.25}, + {"matrix": [0, 2], "x": 2, "y": 0.125}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0.125}, + {"matrix": [0, 5], "x": 5, "y": 0.25}, + {"matrix": [6, 5], "x": 8, "y": 0.25}, + {"matrix": [6, 4], "x": 9, "y": 0.125}, + {"matrix": [6, 3], "x": 10, "y": 0}, + {"matrix": [6, 2], "x": 11, "y": 0.125}, + {"matrix": [6, 1], "x": 12, "y": 0.25}, + {"matrix": [6, 0], "x": 13, "y": 0.25}, + {"matrix": [1, 0], "x": 0, "y": 1.25}, + {"matrix": [1, 1], "x": 1, "y": 1.25}, + {"matrix": [1, 2], "x": 2, "y": 1.125}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1.125}, + {"matrix": [1, 5], "x": 5, "y": 1.25}, + {"matrix": [5, 5], "x": 8, "y": 1.25}, + {"matrix": [5, 4], "x": 9, "y": 1.125}, + {"matrix": [5, 3], "x": 10, "y": 1}, + {"matrix": [5, 2], "x": 11, "y": 1.125}, + {"matrix": [5, 1], "x": 12, "y": 1.25}, + {"matrix": [5, 0], "x": 13, "y": 1.25}, + {"matrix": [2, 0], "x": 0, "y": 2.25}, + {"matrix": [2, 1], "x": 1, "y": 2.25}, + {"matrix": [2, 2], "x": 2, "y": 2.125}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2.125}, + {"matrix": [2, 5], "x": 5, "y": 2.25}, + {"matrix": [4, 5], "x": 8, "y": 2.25}, + {"matrix": [4, 4], "x": 9, "y": 2.125}, + {"matrix": [4, 3], "x": 10, "y": 2}, + {"matrix": [4, 2], "x": 11, "y": 2.125}, + {"matrix": [4, 1], "x": 12, "y": 2.25}, + {"matrix": [4, 0], "x": 13, "y": 2.25}, + {"matrix": [3, 0], "x": 3.5, "y": 3.25}, + {"matrix": [3, 1], "x": 4.5, "y": 3.5}, + {"matrix": [3, 2], "x": 5.5, "y": 3.75}, + {"matrix": [3, 3], "x": 7.5, "y": 3.75}, + {"matrix": [3, 4], "x": 8.5, "y": 3.5}, + {"matrix": [3, 5], "x": 9.5, "y": 3.25} + ] + } + } +} diff --git a/keyboards/boardsource/the_q/keymaps/default/keymap.json b/keyboards/boardsource/the_q/keymaps/default/keymap.json new file mode 100644 index 00000000000..69aa6f86296 --- /dev/null +++ b/keyboards/boardsource/the_q/keymaps/default/keymap.json @@ -0,0 +1,25 @@ +{ + "keyboard": "boardsource/the_q", + "keymap": "default", + "layout": "LAYOUT_split_3x6_3", + "layers": [ + [ + "KC_TAB", "KC_Q", "KC_W", "KC_E", "KC_R", "KC_T", "KC_Y", "KC_U", "KC_I", "KC_O", "KC_P", "KC_BSPC", + "KC_LCTL", "KC_A", "KC_S", "KC_D", "KC_F", "KC_G", "KC_H", "KC_J", "KC_K", "KC_L", "KC_SCLN", "KC_QUOT", + "KC_LSFT", "KC_Z", "KC_X", "KC_C", "KC_V", "KC_B", "KC_N", "KC_M", "KC_COMM", "KC_DOT", "KC_SLSH", "KC_ESC", + "KC_LGUI", "MO(1)", "KC_SPC", "KC_ENT", "MO(2)", "KC_RALT" + ], + [ + "_______", "KC_1", "KC_2", "KC_3", "KC_4", "KC_5", "KC_6", "KC_7", "KC_8", "KC_9", "KC_0", "_______", + "_______", "KC_EXLM", "KC_AT", "KC_HASH", "KC_DLR", "KC_PERC", "KC_CIRC", "KC_AMPR", "KC_ASTR", "KC_LPRN", "KC_RPRN", "_______", + "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", + "_______", "_______", "_______", "_______", "_______", "_______" + ], + [ + "QK_BOOT", "_______", "_______", "_______", "_______", "_______", "RGB_VAI", "RGB_HUI", "RGB_SAI", "RGB_MOD", "RGB_TOG", "_______", + "EE_CLR", "_______", "_______", "_______", "_______", "_______", "RGB_VAD", "RGB_HUD", "RGB_SAD", "RGB_RMOD", "_______", "_______", + "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", + "_______", "_______", "_______", "_______", "_______", "_______" + ] + ] +} diff --git a/keyboards/boardsource/the_q/keymaps/via/keymap.json b/keyboards/boardsource/the_q/keymaps/via/keymap.json new file mode 100644 index 00000000000..40a68c3f51f --- /dev/null +++ b/keyboards/boardsource/the_q/keymaps/via/keymap.json @@ -0,0 +1,30 @@ +{ + "keyboard": "boardsource/the_q", + "keymap": "via", + "layout": "LAYOUT_split_3x6_3", + "config": { + "features": { + "via": true + } + }, + "layers": [ + [ + "KC_TAB", "KC_Q", "KC_W", "KC_E", "KC_R", "KC_T", "KC_Y", "KC_U", "KC_I", "KC_O", "KC_P", "KC_BSPC", + "KC_LCTL", "KC_A", "KC_S", "KC_D", "KC_F", "KC_G", "KC_H", "KC_J", "KC_K", "KC_L", "KC_SCLN", "KC_QUOT", + "KC_LSFT", "KC_Z", "KC_X", "KC_C", "KC_V", "KC_B", "KC_N", "KC_M", "KC_COMM", "KC_DOT", "KC_SLSH", "KC_ESC", + "KC_LGUI", "MO(1)", "KC_SPC", "KC_ENT", "MO(2)", "KC_RALT" + ], + [ + "_______", "KC_1", "KC_2", "KC_3", "KC_4", "KC_5", "KC_6", "KC_7", "KC_8", "KC_9", "KC_0", "_______", + "_______", "KC_EXLM", "KC_AT", "KC_HASH", "KC_DLR", "KC_PERC", "KC_CIRC", "KC_AMPR", "KC_ASTR", "KC_LPRN", "KC_RPRN", "_______", + "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", + "_______", "_______", "_______", "_______", "_______", "_______" + ], + [ + "QK_BOOT", "_______", "_______", "_______", "_______", "_______", "RGB_VAI", "RGB_HUI", "RGB_SAI", "RGB_MOD", "RGB_TOG", "_______", + "EE_CLR", "_______", "_______", "_______", "_______", "_______", "RGB_VAD", "RGB_HUD", "RGB_SAD", "RGB_RMOD", "_______", "_______", + "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", + "_______", "_______", "_______", "_______", "_______", "_______" + ] + ] +} diff --git a/keyboards/boardsource/the_q/readme.md b/keyboards/boardsource/the_q/readme.md new file mode 100644 index 00000000000..9ec8fe8eda5 --- /dev/null +++ b/keyboards/boardsource/the_q/readme.md @@ -0,0 +1,23 @@ +# The Q + +* Keyboard Maintainer: [waffle87](https://github.com/waffle87) +* Hardware Supported: The Q PCB w/ Pro Micro style microcontroller +* Hardware Availability: [boardsource.xyz](https://boardsource.xyz) + +Make example for this keyboard (after setting up your build environment): + + make boardsource/the_q:default + +Flashing example for this keyboard: + + mke boardsource/the_q: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**: Hold down the key at (0,0) in the matrix (top left key) +* **Physical reset button**: Briefly press the button on the front of the PCB +* **Keycode in layout**: Press the key mapped to `QK_BOOT` diff --git a/keyboards/boardsource/the_q/rules.mk b/keyboards/boardsource/the_q/rules.mk new file mode 100644 index 00000000000..de6a3d8afca --- /dev/null +++ b/keyboards/boardsource/the_q/rules.mk @@ -0,0 +1 @@ +SRC += lib/oled.c diff --git a/keyboards/boardsource/the_q/the_q.c b/keyboards/boardsource/the_q/the_q.c new file mode 100644 index 00000000000..09294569114 --- /dev/null +++ b/keyboards/boardsource/the_q/the_q.c @@ -0,0 +1,14 @@ +// Copyright 2024 jack (@waffle87) +// SPDX-License-Identifier: GPL-2.0-or-later +#include "quantum.h" +#include "lib/oled.h" + +#ifdef OLED_ENABLE +bool oled_task_kb(void) { + if (!oled_task_user()) { + return false; + } + render_layer_state(); + return false; +} +#endif diff --git a/keyboards/boardsource/unicorne/rules.mk b/keyboards/boardsource/unicorne/rules.mk index 48b30dcd51a..448962cf002 100644 --- a/keyboards/boardsource/unicorne/rules.mk +++ b/keyboards/boardsource/unicorne/rules.mk @@ -1,2 +1,3 @@ SERIAL_DRIVER = vendor POINTING_DEVICE_DRIVER = analog_joystick +SRC += lib/oled.c diff --git a/keyboards/boardsource/unicorne/unicorne.c b/keyboards/boardsource/unicorne/unicorne.c index 22cd1e4a37d..f9dac8d3efb 100644 --- a/keyboards/boardsource/unicorne/unicorne.c +++ b/keyboards/boardsource/unicorne/unicorne.c @@ -1,6 +1,7 @@ -// Copyright 2023 jack (@waffle87) +// Copyright 2024 jack (@waffle87) // SPDX-License-Identifier: GPL-2.0-or-later -#include "unicorne.h" +#include "quantum.h" +#include "lib/oled.h" #ifdef OLED_ENABLE oled_rotation_t oled_init_kb(oled_rotation_t rotation) { @@ -15,22 +16,9 @@ bool oled_task_kb(void) { return false; } if (is_keyboard_master()) { - switch (get_highest_layer(layer_state)) { - case 0: - oled_write_raw(layer_zero, sizeof(layer_zero)); - break; - case 1: - oled_write_raw(layer_one, sizeof(layer_one)); - break; - case 2: - oled_write_raw(layer_two, sizeof(layer_two)); - break; - case 3: - oled_write_raw(layer_three, sizeof(layer_three)); - break; - } + render_layer_state(); } else { - oled_write_raw(logo, sizeof(logo)); + oled_write_raw_P(bs_logo_img, sizeof(bs_logo_img)); } return false; } From fb54a59bba20d83be7a42da52faf3e6afebc1c26 Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 11 Jul 2024 10:09:41 +1000 Subject: [PATCH 047/204] `jadookb/jkb65`: move RGB Matrix LED config to data driven (#24080) --- keyboards/jadookb/jkb65/config.h | 19 -------- keyboards/jadookb/jkb65/info.json | 73 +++++++++++++++++++++++++++++++ keyboards/jadookb/jkb65/jkb65.c | 29 +----------- 3 files changed, 74 insertions(+), 47 deletions(-) delete mode 100644 keyboards/jadookb/jkb65/config.h diff --git a/keyboards/jadookb/jkb65/config.h b/keyboards/jadookb/jkb65/config.h deleted file mode 100644 index a0793c58611..00000000000 --- a/keyboards/jadookb/jkb65/config.h +++ /dev/null @@ -1,19 +0,0 @@ - /* Copyright 2021 Wizad-GG - * - * 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 RGB_MATRIX_LED_COUNT 67 diff --git a/keyboards/jadookb/jkb65/info.json b/keyboards/jadookb/jkb65/info.json index 054b1c5452c..c4a44a0d744 100644 --- a/keyboards/jadookb/jkb65/info.json +++ b/keyboards/jadookb/jkb65/info.json @@ -77,6 +77,79 @@ "animation": "cycle_all" }, "driver": "ws2812", + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0, "flags": 1}, + {"matrix": [0, 1], "x": 15, "y": 0, "flags": 4}, + {"matrix": [0, 2], "x": 30, "y": 0, "flags": 4}, + {"matrix": [0, 3], "x": 45, "y": 0, "flags": 4}, + {"matrix": [0, 4], "x": 60, "y": 0, "flags": 4}, + {"matrix": [0, 5], "x": 75, "y": 0, "flags": 4}, + {"matrix": [0, 6], "x": 90, "y": 0, "flags": 4}, + {"matrix": [0, 7], "x": 105, "y": 0, "flags": 4}, + {"matrix": [0, 8], "x": 120, "y": 0, "flags": 4}, + {"matrix": [0, 9], "x": 134, "y": 0, "flags": 4}, + {"matrix": [0, 10], "x": 149, "y": 0, "flags": 4}, + {"matrix": [0, 11], "x": 164, "y": 0, "flags": 4}, + {"matrix": [0, 12], "x": 179, "y": 0, "flags": 4}, + {"matrix": [0, 14], "x": 202, "y": 0, "flags": 1}, + {"matrix": [0, 15], "x": 224, "y": 0, "flags": 1}, + + {"matrix": [1, 0], "x": 4, "y": 16, "flags": 1}, + {"matrix": [1, 1], "x": 22, "y": 16, "flags": 4}, + {"matrix": [1, 2], "x": 37, "y": 16, "flags": 4}, + {"matrix": [1, 3], "x": 52, "y": 16, "flags": 4}, + {"matrix": [1, 4], "x": 67, "y": 16, "flags": 4}, + {"matrix": [1, 5], "x": 82, "y": 16, "flags": 4}, + {"matrix": [1, 6], "x": 97, "y": 16, "flags": 4}, + {"matrix": [1, 7], "x": 112, "y": 16, "flags": 4}, + {"matrix": [1, 8], "x": 127, "y": 16, "flags": 4}, + {"matrix": [1, 9], "x": 142, "y": 16, "flags": 4}, + {"matrix": [1, 10], "x": 157, "y": 16, "flags": 4}, + {"matrix": [1, 11], "x": 172, "y": 16, "flags": 4}, + {"matrix": [1, 12], "x": 187, "y": 16, "flags": 4}, + {"matrix": [1, 13], "x": 205, "y": 16, "flags": 4}, + {"matrix": [1, 15], "x": 224, "y": 16, "flags": 1}, + + {"matrix": [2, 0], "x": 6, "y": 32, "flags": 1}, + {"matrix": [2, 1], "x": 26, "y": 32, "flags": 4}, + {"matrix": [2, 2], "x": 41, "y": 32, "flags": 4}, + {"matrix": [2, 3], "x": 56, "y": 32, "flags": 4}, + {"matrix": [2, 4], "x": 71, "y": 32, "flags": 4}, + {"matrix": [2, 5], "x": 86, "y": 32, "flags": 4}, + {"matrix": [2, 6], "x": 101, "y": 32, "flags": 4}, + {"matrix": [2, 7], "x": 116, "y": 32, "flags": 4}, + {"matrix": [2, 8], "x": 131, "y": 32, "flags": 4}, + {"matrix": [2, 9], "x": 146, "y": 32, "flags": 4}, + {"matrix": [2, 10], "x": 161, "y": 32, "flags": 4}, + {"matrix": [2, 11], "x": 175, "y": 32, "flags": 4}, + {"matrix": [2, 13], "x": 200, "y": 32, "flags": 1}, + {"matrix": [2, 15], "x": 224, "y": 32, "flags": 1}, + + {"matrix": [3, 0], "x": 9, "y": 48, "flags": 1}, + {"matrix": [3, 2], "x": 34, "y": 48, "flags": 4}, + {"matrix": [3, 3], "x": 49, "y": 48, "flags": 4}, + {"matrix": [3, 4], "x": 63, "y": 48, "flags": 4}, + {"matrix": [3, 5], "x": 78, "y": 48, "flags": 4}, + {"matrix": [3, 6], "x": 93, "y": 48, "flags": 4}, + {"matrix": [3, 7], "x": 108, "y": 48, "flags": 4}, + {"matrix": [3, 8], "x": 123, "y": 48, "flags": 4}, + {"matrix": [3, 9], "x": 138, "y": 48, "flags": 4}, + {"matrix": [3, 10], "x": 153, "y": 48, "flags": 4}, + {"matrix": [3, 11], "x": 168, "y": 48, "flags": 4}, + {"matrix": [3, 12], "x": 189, "y": 48, "flags": 1}, + {"matrix": [3, 13], "x": 209, "y": 48, "flags": 1}, + {"matrix": [3, 15], "x": 224, "y": 48, "flags": 1}, + + {"matrix": [4, 0], "x": 2, "y": 64, "flags": 1}, + {"matrix": [4, 1], "x": 21, "y": 64, "flags": 1}, + {"matrix": [4, 2], "x": 39, "y": 64, "flags": 1}, + {"matrix": [4, 6], "x": 95, "y": 64, "flags": 4}, + {"matrix": [4, 10], "x": 151, "y": 64, "flags": 1}, + {"matrix": [4, 11], "x": 170, "y": 64, "flags": 1}, + {"matrix": [4, 12], "x": 194, "y": 64, "flags": 1}, + {"matrix": [4, 13], "x": 209, "y": 64, "flags": 1}, + {"matrix": [4, 15], "x": 224, "y": 64, "flags": 1} + ], "led_process_limit": 4, "led_flush_limit": 26, "sleep": true, diff --git a/keyboards/jadookb/jkb65/jkb65.c b/keyboards/jadookb/jkb65/jkb65.c index 0e76162b5ab..54037899dca 100644 --- a/keyboards/jadookb/jkb65/jkb65.c +++ b/keyboards/jadookb/jkb65/jkb65.c @@ -17,38 +17,11 @@ #include "quantum.h" #ifdef RGB_MATRIX_ENABLE - -led_config_t g_led_config = { { - // Key Matrix to LED Index - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, - { 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 }, - { 30, NO_LED, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43 }, - { NO_LED, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57 }, - { 58, 59, 60, NO_LED, NO_LED, NO_LED, 61, NO_LED, NO_LED, 62, 63, 64, 65, 66 } -}, { - // LED Index to Physical Position - { 0, 0}, { 15, 0}, { 30, 0}, { 45, 0}, { 60, 0}, { 75, 0}, { 90, 0}, {105, 0}, {120, 0}, {135, 0}, {150, 0}, {165, 0}, {180, 0}, {202, 0}, {225, 0}, // Esc, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, -, =, Backspace, Delete - { 4, 16}, { 22, 16}, { 37, 16}, { 52, 16}, { 67, 16}, { 82, 16}, { 97, 16}, {112, 16}, {127, 16}, {142, 16}, {157, 16}, {172, 16}, {187, 16}, {206, 16}, {225, 16}, // Tab, Q, W, E, R, T, Y, U, I, O, P, [, ], backslash , Home - { 6, 32}, { 26, 32}, { 41, 32}, { 56, 32}, { 71, 32}, { 86, 32}, {101, 32}, {116, 32}, {131, 32}, {146, 32}, {161, 32}, {176, 32}, {201, 32}, {225, 32}, // Capslock, A, S, D, F, G, H, J, K, L, ;, ', Enter, Page up - { 9, 48}, { 34, 48}, { 49, 48}, { 64, 48}, { 79, 48}, { 94, 48}, {109, 48}, {124, 48}, {139, 48}, {154, 48}, {169, 48}, {189, 48}, {208, 48}, {225, 48}, // LShift, Z, X, C, V, B, N, M, ,, ., /, Shift, Up, Page Down - { 2, 64}, { 21, 64}, { 39, 64}, { 94, 64}, {148, 64}, {163, 64}, {193, 64}, {208, 64}, {225, 64}, // Ctrl, GUI, Alt, Space, RAlt, FN, Ctrl, Left, Down, Right - -}, { - // LED Index to Flag - 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, // Esc, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, -, =, Backspace, Delete - 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, // Tab, Q, W, E, R, T, Y, U, I, O, P, [, ], backslash , Home - 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, // Capslock, A, S, D, F, G, H, J, K, L, ;, ', Enter, Page up - 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, // LShift, Z, X, C, V, B, N, M, ,, ., /, Shift, Up, Page Down - 1, 1, 1, 4, 1, 1, 1, 1, 1, // Ctrl, GUI, Alt, Space, Alt, FN, Left, Down, Right - -} }; - - bool rgb_matrix_indicators_kb(void) { if (!rgb_matrix_indicators_user()) { return false; } - if (host_keyboard_led_state().caps_lock) { + if (host_keyboard_led_state().caps_lock) { rgb_matrix_set_color(30, 0xFF, 0xFF, 0xFF); } return true; From d69b44e68a3e00a229df860b1f0af01790bf49ca Mon Sep 17 00:00:00 2001 From: Will Hedges <36576135+will-hedges@users.noreply.github.com> Date: Wed, 10 Jul 2024 19:15:35 -0500 Subject: [PATCH 048/204] refactor bear_face/v1, v2 (#24060) Co-authored-by: jack --- keyboards/bear_face/info.json | 22 ++-- keyboards/bear_face/rules.mk | 1 - keyboards/bear_face/v1/keyboard.json | 6 +- .../bear_face/v1/keymaps/default/keymap.c | 32 ++---- keyboards/bear_face/v2/keyboard.json | 100 +++++++++++++++++- .../bear_face/v2/keymaps/default/keymap.c | 22 +--- .../bear_face/v2/keymaps/default/readme.md | 4 + .../bear_face/v2/keymaps/default_iso/keymap.c | 22 +--- .../bear_face/v3/keymaps/default/keymap.c | 2 +- .../bear_face/v3/keymaps/default_iso/keymap.c | 2 +- 10 files changed, 135 insertions(+), 78 deletions(-) delete mode 100644 keyboards/bear_face/rules.mk diff --git a/keyboards/bear_face/info.json b/keyboards/bear_face/info.json index ad5b1dd7d9d..90191299d87 100644 --- a/keyboards/bear_face/info.json +++ b/keyboards/bear_face/info.json @@ -1,22 +1,18 @@ { - "keyboard_name": "bear_face", - "manufacturer": "chemicalwill", - "url": "https://github.com/chemicalwill/bear_face_pcb", - "maintainer": "chemicalwill", - "debounce": 6, + "manufacturer": "will-hedges", + "url": "https://github.com/will-hedges", + "maintainer": "will-hedges", "usb": { "vid": "0xFEED", - "pid": "0x09F5", - "force_nkro": true + "pid": "0x09F5" }, "features": { "backlight": true, - "bootmagic": false, + "bootmagic": true, "command": false, "console": false, "extrakey": true, - "mousekey": false, - "nkro": true + "mousekey": false }, "qmk": { "locking": { @@ -24,16 +20,14 @@ "resync": true } }, - "indicators": { - "caps_lock": "F7" - }, "matrix_pins": { "cols": ["B5", "C7", "C6", "F0", "E6", "B7", "D0", "D1", "D2", "D3", "D5", "D4", "D6", "D7", "B4"], "rows": ["F5", "F6", "F4", "F1", "B0", "B6"] }, "diode_direction": "COL2ROW", "backlight": { - "driver": "timer", + "as_caps_lock": true, + "driver": "software", "pin": "F7" }, "processor": "atmega32u4", diff --git a/keyboards/bear_face/rules.mk b/keyboards/bear_face/rules.mk deleted file mode 100644 index f11303978e8..00000000000 --- a/keyboards/bear_face/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = bear_face/v1 diff --git a/keyboards/bear_face/v1/keyboard.json b/keyboards/bear_face/v1/keyboard.json index 8dedc0b1c7b..8c60089bbbb 100644 --- a/keyboards/bear_face/v1/keyboard.json +++ b/keyboards/bear_face/v1/keyboard.json @@ -1,9 +1,13 @@ { + "keyboard_name": "bear_face v1", "usb": { "device_version": "1.0.0" }, + "backlight": { + "on_state": 0 + }, "layouts": { - "LAYOUT_83_ansi": { + "LAYOUT": { "layout": [ {"matrix": [0, 0], "x": 0, "y": 0, "w": 1.5}, {"matrix": [0, 1], "x": 1.5, "y": 0}, diff --git a/keyboards/bear_face/v1/keymaps/default/keymap.c b/keyboards/bear_face/v1/keymaps/default/keymap.c index fc92c783dbe..e615a3915d8 100644 --- a/keyboards/bear_face/v1/keymaps/default/keymap.c +++ b/keyboards/bear_face/v1/keymaps/default/keymap.c @@ -1,19 +1,5 @@ -/* -Copyright 2020 chemicalwill - -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 . -*/ +/* Copyright 2024 will-hedges */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ #include QMK_KEYBOARD_H @@ -28,13 +14,13 @@ enum layers { //custom keycode enums enum custom_keycodes { - BASE_QWER = SAFE_RANGE, + BASE_QWER = QK_USER, BASE_COLE, BASE_DVOR }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWER] = LAYOUT_83_ansi( + [_QWER] = LAYOUT( KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_DEL, 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_HOME, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, @@ -43,7 +29,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ), - [_COLE] = LAYOUT_83_ansi( + [_COLE] = LAYOUT( KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_DEL, 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_HOME, KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, @@ -52,7 +38,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ), - [_DVOR] = LAYOUT_83_ansi( + [_DVOR] = LAYOUT( KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_DEL, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSPC, KC_HOME, KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, KC_PGUP, @@ -61,7 +47,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ), - [_FN1] = LAYOUT_83_ansi( + [_FN1] = LAYOUT( _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, KC_PSCR, KC_SCRL, KC_PAUS, _______, _______, KC_INS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_CALC, BASE_QWER, _______, _______, _______, _______, QK_BOOT, _______, _______, _______, _______, QK_BOOT, _______, _______, _______, _______, BASE_COLE, @@ -71,7 +57,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), /* - [_BLANK] = LAYOUT_83_ansi( + [_BLANK] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -82,8 +68,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ }; -//macros to allow the user to set whatever default layer they want, even after reboot +// macros to allow the user to set whatever default layer they want, even after reboot bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case BASE_QWER: diff --git a/keyboards/bear_face/v2/keyboard.json b/keyboards/bear_face/v2/keyboard.json index 908165babb0..456c920066f 100644 --- a/keyboards/bear_face/v2/keyboard.json +++ b/keyboards/bear_face/v2/keyboard.json @@ -1,8 +1,106 @@ { + "keyboard_name": "bear_face v2", "usb": { - "device_version": "2.0.0" + "device_version": "2.1.0" + }, + "backlight": { + "on_state": 0 }, "layouts": { + "LAYOUT_all": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0, "w": 1.5}, + {"matrix": [0, 1], "x": 1.5, "y": 0}, + {"matrix": [0, 2], "x": 2.5, "y": 0}, + {"matrix": [0, 3], "x": 3.5, "y": 0}, + {"matrix": [0, 4], "x": 4.5, "y": 0}, + {"matrix": [0, 5], "x": 5.5, "y": 0}, + {"matrix": [0, 6], "x": 6.5, "y": 0}, + {"matrix": [0, 7], "x": 7.5, "y": 0}, + {"matrix": [0, 8], "x": 8.5, "y": 0}, + {"matrix": [0, 9], "x": 9.5, "y": 0}, + {"matrix": [0, 10], "x": 10.5, "y": 0}, + {"matrix": [0, 11], "x": 11.5, "y": 0}, + {"matrix": [0, 12], "x": 12.5, "y": 0}, + {"matrix": [0, 13], "x": 13.5, "y": 0}, + {"matrix": [0, 14], "x": 14.5, "y": 0, "w": 1.5}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + {"matrix": [1, 6], "x": 6, "y": 1}, + {"matrix": [1, 7], "x": 7, "y": 1}, + {"matrix": [1, 8], "x": 8, "y": 1}, + {"matrix": [1, 9], "x": 9, "y": 1}, + {"matrix": [1, 10], "x": 10, "y": 1}, + {"matrix": [1, 11], "x": 11, "y": 1}, + {"matrix": [1, 12], "x": 12, "y": 1}, + {"matrix": [1, 13], "x": 13, "y": 1, "w": 2}, + {"matrix": [1, 14], "x": 15, "y": 1}, + + {"matrix": [2, 0], "x": 0, "y": 2, "w": 1.5}, + {"matrix": [2, 1], "x": 1.5, "y": 2}, + {"matrix": [2, 2], "x": 2.5, "y": 2}, + {"matrix": [2, 3], "x": 3.5, "y": 2}, + {"matrix": [2, 4], "x": 4.5, "y": 2}, + {"matrix": [2, 5], "x": 5.5, "y": 2}, + {"matrix": [2, 6], "x": 6.5, "y": 2}, + {"matrix": [2, 7], "x": 7.5, "y": 2}, + {"matrix": [2, 8], "x": 8.5, "y": 2}, + {"matrix": [2, 9], "x": 9.5, "y": 2}, + {"matrix": [2, 10], "x": 10.5, "y": 2}, + {"matrix": [2, 11], "x": 11.5, "y": 2}, + {"matrix": [2, 12], "x": 12.5, "y": 2}, + {"matrix": [2, 13], "x": 13.5, "y": 2, "w": 1.5}, + {"matrix": [2, 14], "x": 15, "y": 2}, + + {"matrix": [3, 0], "x": 0, "y": 3, "w": 1.75}, + {"matrix": [3, 1], "x": 1.75, "y": 3}, + {"matrix": [3, 2], "x": 2.75, "y": 3}, + {"matrix": [3, 3], "x": 3.75, "y": 3}, + {"matrix": [3, 4], "x": 4.75, "y": 3}, + {"matrix": [3, 5], "x": 5.75, "y": 3}, + {"matrix": [3, 6], "x": 6.75, "y": 3}, + {"matrix": [3, 7], "x": 7.75, "y": 3}, + {"matrix": [3, 8], "x": 8.75, "y": 3}, + {"matrix": [3, 9], "x": 9.75, "y": 3}, + {"matrix": [3, 10], "x": 10.75, "y": 3}, + {"matrix": [3, 11], "x": 11.75, "y": 3}, + {"matrix": [3, 12], "x": 12.75, "y": 3}, + {"matrix": [3, 13], "x": 13.75, "y": 2, "w": 1.25, "h": 2}, + {"matrix": [3, 14], "x": 15, "y": 3}, + + {"matrix": [4, 0], "x": 0, "y": 4, "w": 1.25}, + {"matrix": [4, 1], "x": 1.25, "y": 4}, + {"matrix": [4, 2], "x": 2.25, "y": 4}, + {"matrix": [4, 3], "x": 3.25, "y": 4}, + {"matrix": [4, 4], "x": 4.25, "y": 4}, + {"matrix": [4, 5], "x": 5.25, "y": 4}, + {"matrix": [4, 6], "x": 6.25, "y": 4}, + {"matrix": [4, 7], "x": 7.25, "y": 4}, + {"matrix": [4, 8], "x": 8.25, "y": 4}, + {"matrix": [4, 9], "x": 9.25, "y": 4}, + {"matrix": [4, 10], "x": 10.25, "y": 4}, + {"matrix": [4, 11], "x": 11.25, "y": 4}, + {"matrix": [4, 12], "x": 12.25, "y": 4, "w": 1.75}, + {"matrix": [4, 13], "x": 14, "y": 4}, + {"matrix": [4, 14], "x": 15, "y": 4}, + + {"matrix": [5, 0], "x": 0, "y": 5, "w": 1.25}, + {"matrix": [5, 1], "x": 1.25, "y": 5, "w": 1.25}, + {"matrix": [5, 2], "x": 2.5, "y": 5, "w": 1.25}, + {"matrix": [5, 5], "x": 3.75, "y": 5, "w": 6.25}, + {"matrix": [5, 9], "x": 10, "y": 5}, + {"matrix": [5, 10], "x": 11, "y": 5}, + {"matrix": [5, 11], "x": 12, "y": 5}, + {"matrix": [5, 12], "x": 13, "y": 5}, + {"matrix": [5, 13], "x": 14, "y": 5}, + {"matrix": [5, 14], "x": 15, "y": 5} + ] + }, "LAYOUT_83_ansi": { "layout": [ {"matrix": [0, 0], "x": 0, "y": 0, "w": 1.5}, diff --git a/keyboards/bear_face/v2/keymaps/default/keymap.c b/keyboards/bear_face/v2/keymaps/default/keymap.c index 0d536b68f38..08f193052ad 100644 --- a/keyboards/bear_face/v2/keymaps/default/keymap.c +++ b/keyboards/bear_face/v2/keymaps/default/keymap.c @@ -1,19 +1,5 @@ -/* -Copyright 2020 chemicalwill - -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 . -*/ +/* Copyright 2024 will-hedges */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ #include QMK_KEYBOARD_H @@ -28,7 +14,7 @@ enum layers { //custom keycode enums enum custom_keycodes { - BASE_QWER = SAFE_RANGE, + BASE_QWER = QK_USER, BASE_COLE, BASE_DVOR }; @@ -82,8 +68,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ }; -//macros to allow the user to set whatever default layer they want, even after reboot +// macros to allow the user to set whatever default layer they want, even after reboot bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case BASE_QWER: diff --git a/keyboards/bear_face/v2/keymaps/default/readme.md b/keyboards/bear_face/v2/keymaps/default/readme.md index 5f9e635dfec..517baa5726c 100644 --- a/keyboards/bear_face/v2/keymaps/default/readme.md +++ b/keyboards/bear_face/v2/keymaps/default/readme.md @@ -13,3 +13,7 @@ This layout replaces the stock layout on the Vortex Race 3. * 'Reset' will put the keyboard into DFU mode * 'APP' sends 'KC_APP' * Base layer toggles for QWERTY, COLEMAK, and DVORAK layouts (will persist after reboot) + +- New things in v2: + * Option of ANSI or ISO layout + * Optional stepped caps (will require compatible plate) diff --git a/keyboards/bear_face/v2/keymaps/default_iso/keymap.c b/keyboards/bear_face/v2/keymaps/default_iso/keymap.c index e9e6c837f4d..a5e96207f69 100644 --- a/keyboards/bear_face/v2/keymaps/default_iso/keymap.c +++ b/keyboards/bear_face/v2/keymaps/default_iso/keymap.c @@ -1,19 +1,5 @@ -/* -Copyright 2020 chemicalwill - -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 . -*/ +/* Copyright 2024 will-hedges */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ #include QMK_KEYBOARD_H @@ -28,7 +14,7 @@ enum layers { //custom keycode enums enum custom_keycodes { - BASE_QWER = SAFE_RANGE, + BASE_QWER = QK_USER, BASE_COLE, BASE_DVOR }; @@ -82,8 +68,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ }; -//macros to allow the user to set whatever default layer they want, even after reboot +//macros to allow the user to set whatever default layer they want, even after reboot bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case BASE_QWER: diff --git a/keyboards/bear_face/v3/keymaps/default/keymap.c b/keyboards/bear_face/v3/keymaps/default/keymap.c index 77f161a7104..f6e71f1b34e 100644 --- a/keyboards/bear_face/v3/keymaps/default/keymap.c +++ b/keyboards/bear_face/v3/keymaps/default/keymap.c @@ -14,7 +14,7 @@ enum layers { //custom keycode enums enum custom_keycodes { - BASE_QWER = QK_KB_0, + BASE_QWER = QK_USER, BASE_COLE, BASE_DVOR }; diff --git a/keyboards/bear_face/v3/keymaps/default_iso/keymap.c b/keyboards/bear_face/v3/keymaps/default_iso/keymap.c index 73a1155b6a5..cc97d54a9be 100644 --- a/keyboards/bear_face/v3/keymaps/default_iso/keymap.c +++ b/keyboards/bear_face/v3/keymaps/default_iso/keymap.c @@ -14,7 +14,7 @@ enum layers { //custom keycode enums enum custom_keycodes { - BASE_QWER = SAFE_RANGE, + BASE_QWER = QK_USER, BASE_COLE, BASE_DVOR }; From f5319d891185d4c8099861a303701d312bfca9d1 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Thu, 11 Jul 2024 01:17:08 +0100 Subject: [PATCH 049/204] Remove DEFAULT_FOLDER from maple_computing/lets_split_eh (#24054) --- data/mappings/keyboard_aliases.hjson | 5 ++++- keyboards/maple_computing/lets_split_eh/{eh => }/config.h | 0 keyboards/maple_computing/lets_split_eh/eh/rules.mk | 2 -- .../maple_computing/lets_split_eh/{eh => }/keyboard.json | 3 ++- .../lets_split_eh/{eh/eh.c => lets_split_eh.c} | 0 keyboards/maple_computing/lets_split_eh/readme.md | 2 +- keyboards/maple_computing/lets_split_eh/rules.mk | 3 ++- 7 files changed, 9 insertions(+), 6 deletions(-) rename keyboards/maple_computing/lets_split_eh/{eh => }/config.h (100%) delete mode 100644 keyboards/maple_computing/lets_split_eh/eh/rules.mk rename keyboards/maple_computing/lets_split_eh/{eh => }/keyboard.json (98%) rename keyboards/maple_computing/lets_split_eh/{eh/eh.c => lets_split_eh.c} (100%) diff --git a/data/mappings/keyboard_aliases.hjson b/data/mappings/keyboard_aliases.hjson index 57585aae923..14eec52e313 100644 --- a/data/mappings/keyboard_aliases.hjson +++ b/data/mappings/keyboard_aliases.hjson @@ -1060,7 +1060,7 @@ "target": "lyso1/lefishe" }, "lets_split_eh/eh": { - "target": "maple_computing/lets_split_eh/eh" + "target": "maple_computing/lets_split_eh" }, "ls_60": { "target": "weirdo/ls_60" @@ -1080,6 +1080,9 @@ "macro1": { "target": "laneware/macro1" }, + "maple_computing/lets_split_eh/eh": { + "target": "maple_computing/lets_split_eh" + }, "massdrop/thekey": { "target": "drop/thekey/v1" }, diff --git a/keyboards/maple_computing/lets_split_eh/eh/config.h b/keyboards/maple_computing/lets_split_eh/config.h similarity index 100% rename from keyboards/maple_computing/lets_split_eh/eh/config.h rename to keyboards/maple_computing/lets_split_eh/config.h diff --git a/keyboards/maple_computing/lets_split_eh/eh/rules.mk b/keyboards/maple_computing/lets_split_eh/eh/rules.mk deleted file mode 100644 index 271780b75ec..00000000000 --- a/keyboards/maple_computing/lets_split_eh/eh/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -# Disable unsupported hardware -AUDIO_SUPPORTED = no diff --git a/keyboards/maple_computing/lets_split_eh/eh/keyboard.json b/keyboards/maple_computing/lets_split_eh/keyboard.json similarity index 98% rename from keyboards/maple_computing/lets_split_eh/eh/keyboard.json rename to keyboards/maple_computing/lets_split_eh/keyboard.json index f40b15098f5..62d489d60c4 100644 --- a/keyboards/maple_computing/lets_split_eh/eh/keyboard.json +++ b/keyboards/maple_computing/lets_split_eh/keyboard.json @@ -19,6 +19,7 @@ "rgblight": { "led_count": 12, "split_count": [6, 6], + "sleep": true, "animations": { "breathing": true, "rainbow_mood": true, @@ -42,7 +43,7 @@ "processor": "atmega32u4", "bootloader": "atmel-dfu", "features": { - "bootmagic": false, + "bootmagic": true, "mousekey": false, "extrakey": true, "nkro": true, diff --git a/keyboards/maple_computing/lets_split_eh/eh/eh.c b/keyboards/maple_computing/lets_split_eh/lets_split_eh.c similarity index 100% rename from keyboards/maple_computing/lets_split_eh/eh/eh.c rename to keyboards/maple_computing/lets_split_eh/lets_split_eh.c diff --git a/keyboards/maple_computing/lets_split_eh/readme.md b/keyboards/maple_computing/lets_split_eh/readme.md index 90ae5393d1c..dc769b72c44 100644 --- a/keyboards/maple_computing/lets_split_eh/readme.md +++ b/keyboards/maple_computing/lets_split_eh/readme.md @@ -8,6 +8,6 @@ Keyboard Maintainer: [Christopher Poole (That-Canadian)](https://github.com/That Make example for this keyboard (after setting up your build environment): - make maple_computing/lets_split_eh/eh:default + make maple_computing/lets_split_eh:default See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/maple_computing/lets_split_eh/rules.mk b/keyboards/maple_computing/lets_split_eh/rules.mk index 9bae45fde84..271780b75ec 100644 --- a/keyboards/maple_computing/lets_split_eh/rules.mk +++ b/keyboards/maple_computing/lets_split_eh/rules.mk @@ -1 +1,2 @@ -DEFAULT_FOLDER = maple_computing/lets_split_eh/eh +# Disable unsupported hardware +AUDIO_SUPPORTED = no From efa5b30cfdc0649c18ba5315a11cb3294c928dbd Mon Sep 17 00:00:00 2001 From: era <73109780+eerraa@users.noreply.github.com> Date: Thu, 11 Jul 2024 11:50:09 +0900 Subject: [PATCH 050/204] [Keyboard] Add Linx3 FAve65S (#24034) Co-authored-by: Duncan Sutherland --- keyboards/era/linx3/fave65s/config.h | 8 + keyboards/era/linx3/fave65s/fave65s.c | 16 + keyboards/era/linx3/fave65s/keyboard.json | 771 ++++++++++++++++++ .../linx3/fave65s/keymaps/default/keymap.c | 21 + .../era/linx3/fave65s/keymaps/via/keymap.c | 21 + .../era/linx3/fave65s/keymaps/via/rules.mk | 1 + keyboards/era/linx3/fave65s/readme.md | 26 + 7 files changed, 864 insertions(+) create mode 100644 keyboards/era/linx3/fave65s/config.h create mode 100644 keyboards/era/linx3/fave65s/fave65s.c create mode 100644 keyboards/era/linx3/fave65s/keyboard.json create mode 100644 keyboards/era/linx3/fave65s/keymaps/default/keymap.c create mode 100644 keyboards/era/linx3/fave65s/keymaps/via/keymap.c create mode 100644 keyboards/era/linx3/fave65s/keymaps/via/rules.mk create mode 100644 keyboards/era/linx3/fave65s/readme.md diff --git a/keyboards/era/linx3/fave65s/config.h b/keyboards/era/linx3/fave65s/config.h new file mode 100644 index 00000000000..28d7f4f370d --- /dev/null +++ b/keyboards/era/linx3/fave65s/config.h @@ -0,0 +1,8 @@ +// Copyright 2024 Hyojin Bak (@eerraa) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +/* Reset */ +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 2000U diff --git a/keyboards/era/linx3/fave65s/fave65s.c b/keyboards/era/linx3/fave65s/fave65s.c new file mode 100644 index 00000000000..751594bc933 --- /dev/null +++ b/keyboards/era/linx3/fave65s/fave65s.c @@ -0,0 +1,16 @@ +// Copyright 2024 Hyojin Bak (@eerraa) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "quantum.h" + +bool rgb_matrix_indicators_kb(void) { + if (!rgb_matrix_indicators_user()) { + return false; + } + if (host_keyboard_led_state().caps_lock) { + rgb_matrix_set_color(0, 0, 128, 128); + } else { + rgb_matrix_set_color(0, 0, 0, 0); + } + return true; +} diff --git a/keyboards/era/linx3/fave65s/keyboard.json b/keyboards/era/linx3/fave65s/keyboard.json new file mode 100644 index 00000000000..9bb1e456949 --- /dev/null +++ b/keyboards/era/linx3/fave65s/keyboard.json @@ -0,0 +1,771 @@ +{ + "manufacturer": "eerraa", + "keyboard_name": "FAve65S", + "maintainer": "eerraa", + "bootloader": "rp2040", + "build": { + "debounce_type": "sym_defer_pk" + }, + "diode_direction": "COL2ROW", + "features": { + "bootmagic": true, + "extrakey": true, + "mousekey": true, + "nkro": true, + "rgb_matrix": true + }, + "matrix_pins": { + "cols": ["GP28", "GP27", "GP26", "GP0", "GP1", "GP2", "GP3", "GP4", "GP5", "GP6", "GP7", "GP8", "GP9", "GP12", "GP11", "GP10"], + "rows": ["GP25", "GP29", "GP18", "GP23", "GP24"] + }, + "processor": "RP2040", + "rgb_matrix": { + "animations": { + "alphas_mods": true, + "band_pinwheel_sat": true, + "band_pinwheel_val": true, + "band_sat": true, + "band_spiral_sat": true, + "band_spiral_val": true, + "band_val": true, + "breathing": true, + "cycle_all": true, + "cycle_left_right": true, + "cycle_out_in": true, + "cycle_out_in_dual": true, + "cycle_pinwheel": true, + "cycle_spiral": true, + "cycle_up_down": true, + "dual_beacon": true, + "flower_blooming": true, + "gradient_left_right": true, + "gradient_up_down": true, + "hue_breathing": true, + "hue_pendulum": true, + "hue_wave": true, + "jellybean_raindrops": true, + "pixel_flow": true, + "pixel_fractal": true, + "pixel_rain": true, + "rainbow_beacon": true, + "rainbow_moving_chevron": true, + "rainbow_pinwheels": true, + "raindrops": true, + "riverflow": true, + "starlight": true, + "starlight_dual_hue": true, + "starlight_dual_sat": true + }, + "default": { + "animation": "rainbow_moving_chevron" + }, + "driver": "ws2812", + "layout": [ + {"matrix": [2, 0], "x": 10, "y": 39, "flags": 8}, + {"x": 0, "y": 0, "flags": 2}, + {"x": 13, "y": 0, "flags": 2}, + {"x": 26, "y": 0, "flags": 2}, + {"x": 40, "y": 0, "flags": 2}, + {"x": 53, "y": 0, "flags": 2}, + {"x": 66, "y": 0, "flags": 2}, + {"x": 79, "y": 0, "flags": 2}, + {"x": 92, "y": 0, "flags": 2}, + {"x": 105, "y": 0, "flags": 2}, + {"x": 119, "y": 0, "flags": 2}, + {"x": 132, "y": 0, "flags": 2}, + {"x": 145, "y": 0, "flags": 2}, + {"x": 158, "y": 0, "flags": 2}, + {"x": 171, "y": 0, "flags": 2}, + {"x": 184, "y": 0, "flags": 2}, + {"x": 198, "y": 0, "flags": 2}, + {"x": 211, "y": 0, "flags": 2}, + {"x": 224, "y": 0, "flags": 2}, + {"x": 224, "y": 13, "flags": 2}, + {"x": 224, "y": 26, "flags": 2}, + {"x": 224, "y": 38, "flags": 2}, + {"x": 224, "y": 51, "flags": 2}, + {"x": 224, "y": 64, "flags": 2}, + {"x": 211, "y": 64, "flags": 2}, + {"x": 198, "y": 64, "flags": 2}, + {"x": 184, "y": 64, "flags": 2}, + {"x": 171, "y": 64, "flags": 2}, + {"x": 158, "y": 64, "flags": 2}, + {"x": 145, "y": 64, "flags": 2}, + {"x": 132, "y": 64, "flags": 2}, + {"x": 119, "y": 64, "flags": 2}, + {"x": 105, "y": 64, "flags": 2}, + {"x": 92, "y": 64, "flags": 2}, + {"x": 79, "y": 64, "flags": 2}, + {"x": 66, "y": 64, "flags": 2}, + {"x": 53, "y": 64, "flags": 2}, + {"x": 40, "y": 64, "flags": 2}, + {"x": 26, "y": 64, "flags": 2}, + {"x": 13, "y": 64, "flags": 2}, + {"x": 0, "y": 64, "flags": 2}, + {"x": 0, "y": 51, "flags": 2}, + {"x": 0, "y": 38, "flags": 2}, + {"x": 0, "y": 26, "flags": 2}, + {"x": 0, "y": 13, "flags": 2} + ], + "sleep": true + }, + "url": "", + "usb": { + "device_version": "1.0.0", + "pid": "0x0011", + "vid": "0x4552" + }, + "ws2812": { + "driver": "vendor", + "pin": "GP19" + }, + "community_layouts": ["65_ansi_blocker", "65_ansi_blocker_split_bs", "65_ansi_blocker_tsangan", "65_ansi_blocker_tsangan_split_bs", "65_iso_blocker", "65_iso_blocker_split_bs", "65_iso_blocker_tsangan", "65_iso_blocker_tsangan_split_bs"], + "layouts": { + "LAYOUT_65_ansi_blocker": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [0, 6], "x": 6, "y": 0}, + {"matrix": [0, 7], "x": 7, "y": 0}, + {"matrix": [0, 8], "x": 8, "y": 0}, + {"matrix": [0, 9], "x": 9, "y": 0}, + {"matrix": [0, 10], "x": 10, "y": 0}, + {"matrix": [0, 11], "x": 11, "y": 0}, + {"matrix": [0, 12], "x": 12, "y": 0}, + {"matrix": [0, 14], "x": 13, "y": 0, "w": 2}, + {"matrix": [0, 15], "x": 15, "y": 0}, + {"matrix": [1, 0], "x": 0, "y": 1, "w": 1.5}, + {"matrix": [1, 1], "x": 1.5, "y": 1}, + {"matrix": [1, 2], "x": 2.5, "y": 1}, + {"matrix": [1, 3], "x": 3.5, "y": 1}, + {"matrix": [1, 4], "x": 4.5, "y": 1}, + {"matrix": [1, 5], "x": 5.5, "y": 1}, + {"matrix": [1, 6], "x": 6.5, "y": 1}, + {"matrix": [1, 7], "x": 7.5, "y": 1}, + {"matrix": [1, 8], "x": 8.5, "y": 1}, + {"matrix": [1, 9], "x": 9.5, "y": 1}, + {"matrix": [1, 10], "x": 10.5, "y": 1}, + {"matrix": [1, 11], "x": 11.5, "y": 1}, + {"matrix": [1, 12], "x": 12.5, "y": 1}, + {"matrix": [1, 14], "x": 13.5, "y": 1, "w": 1.5}, + {"matrix": [1, 15], "x": 15, "y": 1}, + {"matrix": [2, 0], "x": 0, "y": 2, "w": 1.75}, + {"matrix": [2, 1], "x": 1.75, "y": 2}, + {"matrix": [2, 2], "x": 2.75, "y": 2}, + {"matrix": [2, 3], "x": 3.75, "y": 2}, + {"matrix": [2, 4], "x": 4.75, "y": 2}, + {"matrix": [2, 5], "x": 5.75, "y": 2}, + {"matrix": [2, 6], "x": 6.75, "y": 2}, + {"matrix": [2, 7], "x": 7.75, "y": 2}, + {"matrix": [2, 8], "x": 8.75, "y": 2}, + {"matrix": [2, 9], "x": 9.75, "y": 2}, + {"matrix": [2, 10], "x": 10.75, "y": 2}, + {"matrix": [2, 11], "x": 11.75, "y": 2}, + {"matrix": [2, 13], "x": 12.75, "y": 2, "w": 2.25}, + {"matrix": [2, 15], "x": 15, "y": 2}, + {"matrix": [3, 0], "x": 0, "y": 3, "w": 2.25}, + {"matrix": [3, 2], "x": 2.25, "y": 3}, + {"matrix": [3, 3], "x": 3.25, "y": 3}, + {"matrix": [3, 4], "x": 4.25, "y": 3}, + {"matrix": [3, 5], "x": 5.25, "y": 3}, + {"matrix": [3, 6], "x": 6.25, "y": 3}, + {"matrix": [3, 7], "x": 7.25, "y": 3}, + {"matrix": [3, 8], "x": 8.25, "y": 3}, + {"matrix": [3, 9], "x": 9.25, "y": 3}, + {"matrix": [3, 10], "x": 10.25, "y": 3}, + {"matrix": [3, 11], "x": 11.25, "y": 3}, + {"matrix": [3, 12], "x": 12.25, "y": 3, "w": 1.75}, + {"matrix": [3, 14], "x": 14, "y": 3}, + {"matrix": [3, 15], "x": 15, "y": 3}, + {"matrix": [4, 0], "x": 0, "y": 4, "w": 1.25}, + {"matrix": [4, 1], "x": 1.25, "y": 4, "w": 1.25}, + {"matrix": [4, 2], "x": 2.5, "y": 4, "w": 1.25}, + {"matrix": [4, 5], "x": 3.75, "y": 4, "w": 6.25}, + {"matrix": [4, 10], "x": 10, "y": 4, "w": 1.25}, + {"matrix": [4, 11], "x": 11.25, "y": 4, "w": 1.25}, + {"matrix": [4, 13], "x": 13, "y": 4}, + {"matrix": [4, 14], "x": 14, "y": 4}, + {"matrix": [4, 15], "x": 15, "y": 4} + ] + }, + "LAYOUT_65_ansi_blocker_split_bs": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [0, 6], "x": 6, "y": 0}, + {"matrix": [0, 7], "x": 7, "y": 0}, + {"matrix": [0, 8], "x": 8, "y": 0}, + {"matrix": [0, 9], "x": 9, "y": 0}, + {"matrix": [0, 10], "x": 10, "y": 0}, + {"matrix": [0, 11], "x": 11, "y": 0}, + {"matrix": [0, 12], "x": 12, "y": 0}, + {"matrix": [0, 13], "x": 13, "y": 0}, + {"matrix": [0, 14], "x": 14, "y": 0}, + {"matrix": [0, 15], "x": 15, "y": 0}, + {"matrix": [1, 0], "x": 0, "y": 1, "w": 1.5}, + {"matrix": [1, 1], "x": 1.5, "y": 1}, + {"matrix": [1, 2], "x": 2.5, "y": 1}, + {"matrix": [1, 3], "x": 3.5, "y": 1}, + {"matrix": [1, 4], "x": 4.5, "y": 1}, + {"matrix": [1, 5], "x": 5.5, "y": 1}, + {"matrix": [1, 6], "x": 6.5, "y": 1}, + {"matrix": [1, 7], "x": 7.5, "y": 1}, + {"matrix": [1, 8], "x": 8.5, "y": 1}, + {"matrix": [1, 9], "x": 9.5, "y": 1}, + {"matrix": [1, 10], "x": 10.5, "y": 1}, + {"matrix": [1, 11], "x": 11.5, "y": 1}, + {"matrix": [1, 12], "x": 12.5, "y": 1}, + {"matrix": [1, 14], "x": 13.5, "y": 1, "w": 1.5}, + {"matrix": [1, 15], "x": 15, "y": 1}, + {"matrix": [2, 0], "x": 0, "y": 2, "w": 1.75}, + {"matrix": [2, 1], "x": 1.75, "y": 2}, + {"matrix": [2, 2], "x": 2.75, "y": 2}, + {"matrix": [2, 3], "x": 3.75, "y": 2}, + {"matrix": [2, 4], "x": 4.75, "y": 2}, + {"matrix": [2, 5], "x": 5.75, "y": 2}, + {"matrix": [2, 6], "x": 6.75, "y": 2}, + {"matrix": [2, 7], "x": 7.75, "y": 2}, + {"matrix": [2, 8], "x": 8.75, "y": 2}, + {"matrix": [2, 9], "x": 9.75, "y": 2}, + {"matrix": [2, 10], "x": 10.75, "y": 2}, + {"matrix": [2, 11], "x": 11.75, "y": 2}, + {"matrix": [2, 13], "x": 12.75, "y": 2, "w": 2.25}, + {"matrix": [2, 15], "x": 15, "y": 2}, + {"matrix": [3, 0], "x": 0, "y": 3, "w": 2.25}, + {"matrix": [3, 2], "x": 2.25, "y": 3}, + {"matrix": [3, 3], "x": 3.25, "y": 3}, + {"matrix": [3, 4], "x": 4.25, "y": 3}, + {"matrix": [3, 5], "x": 5.25, "y": 3}, + {"matrix": [3, 6], "x": 6.25, "y": 3}, + {"matrix": [3, 7], "x": 7.25, "y": 3}, + {"matrix": [3, 8], "x": 8.25, "y": 3}, + {"matrix": [3, 9], "x": 9.25, "y": 3}, + {"matrix": [3, 10], "x": 10.25, "y": 3}, + {"matrix": [3, 11], "x": 11.25, "y": 3}, + {"matrix": [3, 12], "x": 12.25, "y": 3, "w": 1.75}, + {"matrix": [3, 14], "x": 14, "y": 3}, + {"matrix": [3, 15], "x": 15, "y": 3}, + {"matrix": [4, 0], "x": 0, "y": 4, "w": 1.25}, + {"matrix": [4, 1], "x": 1.25, "y": 4, "w": 1.25}, + {"matrix": [4, 2], "x": 2.5, "y": 4, "w": 1.25}, + {"matrix": [4, 5], "x": 3.75, "y": 4, "w": 6.25}, + {"matrix": [4, 10], "x": 10, "y": 4, "w": 1.25}, + {"matrix": [4, 11], "x": 11.25, "y": 4, "w": 1.25}, + {"matrix": [4, 13], "x": 13, "y": 4}, + {"matrix": [4, 14], "x": 14, "y": 4}, + {"matrix": [4, 15], "x": 15, "y": 4} + ] + }, + "LAYOUT_65_ansi_blocker_tsangan": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [0, 6], "x": 6, "y": 0}, + {"matrix": [0, 7], "x": 7, "y": 0}, + {"matrix": [0, 8], "x": 8, "y": 0}, + {"matrix": [0, 9], "x": 9, "y": 0}, + {"matrix": [0, 10], "x": 10, "y": 0}, + {"matrix": [0, 11], "x": 11, "y": 0}, + {"matrix": [0, 12], "x": 12, "y": 0}, + {"matrix": [0, 14], "x": 13, "y": 0, "w": 2}, + {"matrix": [0, 15], "x": 15, "y": 0}, + {"matrix": [1, 0], "x": 0, "y": 1, "w": 1.5}, + {"matrix": [1, 1], "x": 1.5, "y": 1}, + {"matrix": [1, 2], "x": 2.5, "y": 1}, + {"matrix": [1, 3], "x": 3.5, "y": 1}, + {"matrix": [1, 4], "x": 4.5, "y": 1}, + {"matrix": [1, 5], "x": 5.5, "y": 1}, + {"matrix": [1, 6], "x": 6.5, "y": 1}, + {"matrix": [1, 7], "x": 7.5, "y": 1}, + {"matrix": [1, 8], "x": 8.5, "y": 1}, + {"matrix": [1, 9], "x": 9.5, "y": 1}, + {"matrix": [1, 10], "x": 10.5, "y": 1}, + {"matrix": [1, 11], "x": 11.5, "y": 1}, + {"matrix": [1, 12], "x": 12.5, "y": 1}, + {"matrix": [1, 14], "x": 13.5, "y": 1, "w": 1.5}, + {"matrix": [1, 15], "x": 15, "y": 1}, + {"matrix": [2, 0], "x": 0, "y": 2, "w": 1.75}, + {"matrix": [2, 1], "x": 1.75, "y": 2}, + {"matrix": [2, 2], "x": 2.75, "y": 2}, + {"matrix": [2, 3], "x": 3.75, "y": 2}, + {"matrix": [2, 4], "x": 4.75, "y": 2}, + {"matrix": [2, 5], "x": 5.75, "y": 2}, + {"matrix": [2, 6], "x": 6.75, "y": 2}, + {"matrix": [2, 7], "x": 7.75, "y": 2}, + {"matrix": [2, 8], "x": 8.75, "y": 2}, + {"matrix": [2, 9], "x": 9.75, "y": 2}, + {"matrix": [2, 10], "x": 10.75, "y": 2}, + {"matrix": [2, 11], "x": 11.75, "y": 2}, + {"matrix": [2, 13], "x": 12.75, "y": 2, "w": 2.25}, + {"matrix": [2, 15], "x": 15, "y": 2}, + {"matrix": [3, 0], "x": 0, "y": 3, "w": 2.25}, + {"matrix": [3, 2], "x": 2.25, "y": 3}, + {"matrix": [3, 3], "x": 3.25, "y": 3}, + {"matrix": [3, 4], "x": 4.25, "y": 3}, + {"matrix": [3, 5], "x": 5.25, "y": 3}, + {"matrix": [3, 6], "x": 6.25, "y": 3}, + {"matrix": [3, 7], "x": 7.25, "y": 3}, + {"matrix": [3, 8], "x": 8.25, "y": 3}, + {"matrix": [3, 9], "x": 9.25, "y": 3}, + {"matrix": [3, 10], "x": 10.25, "y": 3}, + {"matrix": [3, 11], "x": 11.25, "y": 3}, + {"matrix": [3, 12], "x": 12.25, "y": 3, "w": 1.75}, + {"matrix": [3, 14], "x": 14, "y": 3}, + {"matrix": [3, 15], "x": 15, "y": 3}, + {"matrix": [4, 0], "x": 0, "y": 4, "w": 1.5}, + {"matrix": [4, 1], "x": 1.5, "y": 4}, + {"matrix": [4, 2], "x": 2.5, "y": 4, "w": 1.5}, + {"matrix": [4, 5], "x": 4, "y": 4, "w": 7}, + {"matrix": [4, 11], "x": 11, "y": 4, "w": 1.5}, + {"matrix": [4, 13], "x": 13, "y": 4}, + {"matrix": [4, 14], "x": 14, "y": 4}, + {"matrix": [4, 15], "x": 15, "y": 4} + ] + }, + "LAYOUT_65_ansi_blocker_tsangan_split_bs": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [0, 6], "x": 6, "y": 0}, + {"matrix": [0, 7], "x": 7, "y": 0}, + {"matrix": [0, 8], "x": 8, "y": 0}, + {"matrix": [0, 9], "x": 9, "y": 0}, + {"matrix": [0, 10], "x": 10, "y": 0}, + {"matrix": [0, 11], "x": 11, "y": 0}, + {"matrix": [0, 12], "x": 12, "y": 0}, + {"matrix": [0, 13], "x": 13, "y": 0}, + {"matrix": [0, 14], "x": 14, "y": 0}, + {"matrix": [0, 15], "x": 15, "y": 0}, + {"matrix": [1, 0], "x": 0, "y": 1, "w": 1.5}, + {"matrix": [1, 1], "x": 1.5, "y": 1}, + {"matrix": [1, 2], "x": 2.5, "y": 1}, + {"matrix": [1, 3], "x": 3.5, "y": 1}, + {"matrix": [1, 4], "x": 4.5, "y": 1}, + {"matrix": [1, 5], "x": 5.5, "y": 1}, + {"matrix": [1, 6], "x": 6.5, "y": 1}, + {"matrix": [1, 7], "x": 7.5, "y": 1}, + {"matrix": [1, 8], "x": 8.5, "y": 1}, + {"matrix": [1, 9], "x": 9.5, "y": 1}, + {"matrix": [1, 10], "x": 10.5, "y": 1}, + {"matrix": [1, 11], "x": 11.5, "y": 1}, + {"matrix": [1, 12], "x": 12.5, "y": 1}, + {"matrix": [1, 14], "x": 13.5, "y": 1, "w": 1.5}, + {"matrix": [1, 15], "x": 15, "y": 1}, + {"matrix": [2, 0], "x": 0, "y": 2, "w": 1.75}, + {"matrix": [2, 1], "x": 1.75, "y": 2}, + {"matrix": [2, 2], "x": 2.75, "y": 2}, + {"matrix": [2, 3], "x": 3.75, "y": 2}, + {"matrix": [2, 4], "x": 4.75, "y": 2}, + {"matrix": [2, 5], "x": 5.75, "y": 2}, + {"matrix": [2, 6], "x": 6.75, "y": 2}, + {"matrix": [2, 7], "x": 7.75, "y": 2}, + {"matrix": [2, 8], "x": 8.75, "y": 2}, + {"matrix": [2, 9], "x": 9.75, "y": 2}, + {"matrix": [2, 10], "x": 10.75, "y": 2}, + {"matrix": [2, 11], "x": 11.75, "y": 2}, + {"matrix": [2, 13], "x": 12.75, "y": 2, "w": 2.25}, + {"matrix": [2, 15], "x": 15, "y": 2}, + {"matrix": [3, 0], "x": 0, "y": 3, "w": 2.25}, + {"matrix": [3, 2], "x": 2.25, "y": 3}, + {"matrix": [3, 3], "x": 3.25, "y": 3}, + {"matrix": [3, 4], "x": 4.25, "y": 3}, + {"matrix": [3, 5], "x": 5.25, "y": 3}, + {"matrix": [3, 6], "x": 6.25, "y": 3}, + {"matrix": [3, 7], "x": 7.25, "y": 3}, + {"matrix": [3, 8], "x": 8.25, "y": 3}, + {"matrix": [3, 9], "x": 9.25, "y": 3}, + {"matrix": [3, 10], "x": 10.25, "y": 3}, + {"matrix": [3, 11], "x": 11.25, "y": 3}, + {"matrix": [3, 12], "x": 12.25, "y": 3, "w": 1.75}, + {"matrix": [3, 14], "x": 14, "y": 3}, + {"matrix": [3, 15], "x": 15, "y": 3}, + {"matrix": [4, 0], "x": 0, "y": 4, "w": 1.5}, + {"matrix": [4, 1], "x": 1.5, "y": 4}, + {"matrix": [4, 2], "x": 2.5, "y": 4, "w": 1.5}, + {"matrix": [4, 5], "x": 4, "y": 4, "w": 7}, + {"matrix": [4, 11], "x": 11, "y": 4, "w": 1.5}, + {"matrix": [4, 13], "x": 13, "y": 4}, + {"matrix": [4, 14], "x": 14, "y": 4}, + {"matrix": [4, 15], "x": 15, "y": 4} + ] + }, + "LAYOUT_65_iso_blocker": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [0, 6], "x": 6, "y": 0}, + {"matrix": [0, 7], "x": 7, "y": 0}, + {"matrix": [0, 8], "x": 8, "y": 0}, + {"matrix": [0, 9], "x": 9, "y": 0}, + {"matrix": [0, 10], "x": 10, "y": 0}, + {"matrix": [0, 11], "x": 11, "y": 0}, + {"matrix": [0, 12], "x": 12, "y": 0}, + {"matrix": [0, 14], "x": 13, "y": 0, "w": 2}, + {"matrix": [0, 15], "x": 15, "y": 0}, + {"matrix": [1, 0], "x": 0, "y": 1, "w": 1.5}, + {"matrix": [1, 1], "x": 1.5, "y": 1}, + {"matrix": [1, 2], "x": 2.5, "y": 1}, + {"matrix": [1, 3], "x": 3.5, "y": 1}, + {"matrix": [1, 4], "x": 4.5, "y": 1}, + {"matrix": [1, 5], "x": 5.5, "y": 1}, + {"matrix": [1, 6], "x": 6.5, "y": 1}, + {"matrix": [1, 7], "x": 7.5, "y": 1}, + {"matrix": [1, 8], "x": 8.5, "y": 1}, + {"matrix": [1, 9], "x": 9.5, "y": 1}, + {"matrix": [1, 10], "x": 10.5, "y": 1}, + {"matrix": [1, 11], "x": 11.5, "y": 1}, + {"matrix": [1, 12], "x": 12.5, "y": 1}, + {"matrix": [1, 15], "x": 15, "y": 1}, + {"matrix": [2, 0], "x": 0, "y": 2, "w": 1.75}, + {"matrix": [2, 1], "x": 1.75, "y": 2}, + {"matrix": [2, 2], "x": 2.75, "y": 2}, + {"matrix": [2, 3], "x": 3.75, "y": 2}, + {"matrix": [2, 4], "x": 4.75, "y": 2}, + {"matrix": [2, 5], "x": 5.75, "y": 2}, + {"matrix": [2, 6], "x": 6.75, "y": 2}, + {"matrix": [2, 7], "x": 7.75, "y": 2}, + {"matrix": [2, 8], "x": 8.75, "y": 2}, + {"matrix": [2, 9], "x": 9.75, "y": 2}, + {"matrix": [2, 10], "x": 10.75, "y": 2}, + {"matrix": [2, 11], "x": 11.75, "y": 2}, + {"matrix": [2, 12], "x": 12.75, "y": 2}, + {"matrix": [2, 13], "x": 13.75, "y": 1, "w": 1.25, "h": 2}, + {"matrix": [2, 15], "x": 15, "y": 2}, + {"matrix": [3, 0], "x": 0, "y": 3, "w": 1.25}, + {"matrix": [3, 1], "x": 1.25, "y": 3}, + {"matrix": [3, 2], "x": 2.25, "y": 3}, + {"matrix": [3, 3], "x": 3.25, "y": 3}, + {"matrix": [3, 4], "x": 4.25, "y": 3}, + {"matrix": [3, 5], "x": 5.25, "y": 3}, + {"matrix": [3, 6], "x": 6.25, "y": 3}, + {"matrix": [3, 7], "x": 7.25, "y": 3}, + {"matrix": [3, 8], "x": 8.25, "y": 3}, + {"matrix": [3, 9], "x": 9.25, "y": 3}, + {"matrix": [3, 10], "x": 10.25, "y": 3}, + {"matrix": [3, 11], "x": 11.25, "y": 3}, + {"matrix": [3, 12], "x": 12.25, "y": 3, "w": 1.75}, + {"matrix": [3, 14], "x": 14, "y": 3}, + {"matrix": [3, 15], "x": 15, "y": 3}, + {"matrix": [4, 0], "x": 0, "y": 4, "w": 1.25}, + {"matrix": [4, 1], "x": 1.25, "y": 4, "w": 1.25}, + {"matrix": [4, 2], "x": 2.5, "y": 4, "w": 1.25}, + {"matrix": [4, 5], "x": 3.75, "y": 4, "w": 6.25}, + {"matrix": [4, 10], "x": 10, "y": 4, "w": 1.25}, + {"matrix": [4, 11], "x": 11.25, "y": 4, "w": 1.25}, + {"matrix": [4, 13], "x": 13, "y": 4}, + {"matrix": [4, 14], "x": 14, "y": 4}, + {"matrix": [4, 15], "x": 15, "y": 4} + ] + }, + "LAYOUT_65_iso_blocker_split_bs": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [0, 6], "x": 6, "y": 0}, + {"matrix": [0, 7], "x": 7, "y": 0}, + {"matrix": [0, 8], "x": 8, "y": 0}, + {"matrix": [0, 9], "x": 9, "y": 0}, + {"matrix": [0, 10], "x": 10, "y": 0}, + {"matrix": [0, 11], "x": 11, "y": 0}, + {"matrix": [0, 12], "x": 12, "y": 0}, + {"matrix": [0, 13], "x": 13, "y": 0}, + {"matrix": [0, 14], "x": 14, "y": 0}, + {"matrix": [0, 15], "x": 15, "y": 0}, + {"matrix": [1, 0], "x": 0, "y": 1, "w": 1.5}, + {"matrix": [1, 1], "x": 1.5, "y": 1}, + {"matrix": [1, 2], "x": 2.5, "y": 1}, + {"matrix": [1, 3], "x": 3.5, "y": 1}, + {"matrix": [1, 4], "x": 4.5, "y": 1}, + {"matrix": [1, 5], "x": 5.5, "y": 1}, + {"matrix": [1, 6], "x": 6.5, "y": 1}, + {"matrix": [1, 7], "x": 7.5, "y": 1}, + {"matrix": [1, 8], "x": 8.5, "y": 1}, + {"matrix": [1, 9], "x": 9.5, "y": 1}, + {"matrix": [1, 10], "x": 10.5, "y": 1}, + {"matrix": [1, 11], "x": 11.5, "y": 1}, + {"matrix": [1, 12], "x": 12.5, "y": 1}, + {"matrix": [1, 15], "x": 15, "y": 1}, + {"matrix": [2, 0], "x": 0, "y": 2, "w": 1.75}, + {"matrix": [2, 1], "x": 1.75, "y": 2}, + {"matrix": [2, 2], "x": 2.75, "y": 2}, + {"matrix": [2, 3], "x": 3.75, "y": 2}, + {"matrix": [2, 4], "x": 4.75, "y": 2}, + {"matrix": [2, 5], "x": 5.75, "y": 2}, + {"matrix": [2, 6], "x": 6.75, "y": 2}, + {"matrix": [2, 7], "x": 7.75, "y": 2}, + {"matrix": [2, 8], "x": 8.75, "y": 2}, + {"matrix": [2, 9], "x": 9.75, "y": 2}, + {"matrix": [2, 10], "x": 10.75, "y": 2}, + {"matrix": [2, 11], "x": 11.75, "y": 2}, + {"matrix": [2, 12], "x": 12.75, "y": 2}, + {"matrix": [2, 13], "x": 13.75, "y": 1, "w": 1.25, "h": 2}, + {"matrix": [2, 15], "x": 15, "y": 2}, + {"matrix": [3, 0], "x": 0, "y": 3, "w": 1.25}, + {"matrix": [3, 1], "x": 1.25, "y": 3}, + {"matrix": [3, 2], "x": 2.25, "y": 3}, + {"matrix": [3, 3], "x": 3.25, "y": 3}, + {"matrix": [3, 4], "x": 4.25, "y": 3}, + {"matrix": [3, 5], "x": 5.25, "y": 3}, + {"matrix": [3, 6], "x": 6.25, "y": 3}, + {"matrix": [3, 7], "x": 7.25, "y": 3}, + {"matrix": [3, 8], "x": 8.25, "y": 3}, + {"matrix": [3, 9], "x": 9.25, "y": 3}, + {"matrix": [3, 10], "x": 10.25, "y": 3}, + {"matrix": [3, 11], "x": 11.25, "y": 3}, + {"matrix": [3, 12], "x": 12.25, "y": 3, "w": 1.75}, + {"matrix": [3, 14], "x": 14, "y": 3}, + {"matrix": [3, 15], "x": 15, "y": 3}, + {"matrix": [4, 0], "x": 0, "y": 4, "w": 1.25}, + {"matrix": [4, 1], "x": 1.25, "y": 4, "w": 1.25}, + {"matrix": [4, 2], "x": 2.5, "y": 4, "w": 1.25}, + {"matrix": [4, 5], "x": 3.75, "y": 4, "w": 6.25}, + {"matrix": [4, 10], "x": 10, "y": 4, "w": 1.25}, + {"matrix": [4, 11], "x": 11.25, "y": 4, "w": 1.25}, + {"matrix": [4, 13], "x": 13, "y": 4}, + {"matrix": [4, 14], "x": 14, "y": 4}, + {"matrix": [4, 15], "x": 15, "y": 4} + ] + }, + "LAYOUT_65_iso_blocker_tsangan": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [0, 6], "x": 6, "y": 0}, + {"matrix": [0, 7], "x": 7, "y": 0}, + {"matrix": [0, 8], "x": 8, "y": 0}, + {"matrix": [0, 9], "x": 9, "y": 0}, + {"matrix": [0, 10], "x": 10, "y": 0}, + {"matrix": [0, 11], "x": 11, "y": 0}, + {"matrix": [0, 12], "x": 12, "y": 0}, + {"matrix": [0, 14], "x": 13, "y": 0, "w": 2}, + {"matrix": [0, 15], "x": 15, "y": 0}, + {"matrix": [1, 0], "x": 0, "y": 1, "w": 1.5}, + {"matrix": [1, 1], "x": 1.5, "y": 1}, + {"matrix": [1, 2], "x": 2.5, "y": 1}, + {"matrix": [1, 3], "x": 3.5, "y": 1}, + {"matrix": [1, 4], "x": 4.5, "y": 1}, + {"matrix": [1, 5], "x": 5.5, "y": 1}, + {"matrix": [1, 6], "x": 6.5, "y": 1}, + {"matrix": [1, 7], "x": 7.5, "y": 1}, + {"matrix": [1, 8], "x": 8.5, "y": 1}, + {"matrix": [1, 9], "x": 9.5, "y": 1}, + {"matrix": [1, 10], "x": 10.5, "y": 1}, + {"matrix": [1, 11], "x": 11.5, "y": 1}, + {"matrix": [1, 12], "x": 12.5, "y": 1}, + {"matrix": [1, 15], "x": 15, "y": 1}, + {"matrix": [2, 0], "x": 0, "y": 2, "w": 1.75}, + {"matrix": [2, 1], "x": 1.75, "y": 2}, + {"matrix": [2, 2], "x": 2.75, "y": 2}, + {"matrix": [2, 3], "x": 3.75, "y": 2}, + {"matrix": [2, 4], "x": 4.75, "y": 2}, + {"matrix": [2, 5], "x": 5.75, "y": 2}, + {"matrix": [2, 6], "x": 6.75, "y": 2}, + {"matrix": [2, 7], "x": 7.75, "y": 2}, + {"matrix": [2, 8], "x": 8.75, "y": 2}, + {"matrix": [2, 9], "x": 9.75, "y": 2}, + {"matrix": [2, 10], "x": 10.75, "y": 2}, + {"matrix": [2, 11], "x": 11.75, "y": 2}, + {"matrix": [2, 12], "x": 12.75, "y": 2}, + {"matrix": [2, 13], "x": 13.75, "y": 1, "w": 1.25, "h": 2}, + {"matrix": [2, 15], "x": 15, "y": 2}, + {"matrix": [3, 0], "x": 0, "y": 3, "w": 1.25}, + {"matrix": [3, 1], "x": 1.25, "y": 3}, + {"matrix": [3, 2], "x": 2.25, "y": 3}, + {"matrix": [3, 3], "x": 3.25, "y": 3}, + {"matrix": [3, 4], "x": 4.25, "y": 3}, + {"matrix": [3, 5], "x": 5.25, "y": 3}, + {"matrix": [3, 6], "x": 6.25, "y": 3}, + {"matrix": [3, 7], "x": 7.25, "y": 3}, + {"matrix": [3, 8], "x": 8.25, "y": 3}, + {"matrix": [3, 9], "x": 9.25, "y": 3}, + {"matrix": [3, 10], "x": 10.25, "y": 3}, + {"matrix": [3, 11], "x": 11.25, "y": 3}, + {"matrix": [3, 12], "x": 12.25, "y": 3, "w": 1.75}, + {"matrix": [3, 14], "x": 14, "y": 3}, + {"matrix": [3, 15], "x": 15, "y": 3}, + {"matrix": [4, 0], "x": 0, "y": 4, "w": 1.5}, + {"matrix": [4, 1], "x": 1.5, "y": 4}, + {"matrix": [4, 2], "x": 2.5, "y": 4, "w": 1.5}, + {"matrix": [4, 5], "x": 4, "y": 4, "w": 7}, + {"matrix": [4, 11], "x": 11, "y": 4, "w": 1.5}, + {"matrix": [4, 13], "x": 13, "y": 4}, + {"matrix": [4, 14], "x": 14, "y": 4}, + {"matrix": [4, 15], "x": 15, "y": 4} + ] + }, + "LAYOUT_65_iso_blocker_tsangan_split_bs": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [0, 6], "x": 6, "y": 0}, + {"matrix": [0, 7], "x": 7, "y": 0}, + {"matrix": [0, 8], "x": 8, "y": 0}, + {"matrix": [0, 9], "x": 9, "y": 0}, + {"matrix": [0, 10], "x": 10, "y": 0}, + {"matrix": [0, 11], "x": 11, "y": 0}, + {"matrix": [0, 12], "x": 12, "y": 0}, + {"matrix": [0, 13], "x": 13, "y": 0}, + {"matrix": [0, 14], "x": 14, "y": 0}, + {"matrix": [0, 15], "x": 15, "y": 0}, + {"matrix": [1, 0], "x": 0, "y": 1, "w": 1.5}, + {"matrix": [1, 1], "x": 1.5, "y": 1}, + {"matrix": [1, 2], "x": 2.5, "y": 1}, + {"matrix": [1, 3], "x": 3.5, "y": 1}, + {"matrix": [1, 4], "x": 4.5, "y": 1}, + {"matrix": [1, 5], "x": 5.5, "y": 1}, + {"matrix": [1, 6], "x": 6.5, "y": 1}, + {"matrix": [1, 7], "x": 7.5, "y": 1}, + {"matrix": [1, 8], "x": 8.5, "y": 1}, + {"matrix": [1, 9], "x": 9.5, "y": 1}, + {"matrix": [1, 10], "x": 10.5, "y": 1}, + {"matrix": [1, 11], "x": 11.5, "y": 1}, + {"matrix": [1, 12], "x": 12.5, "y": 1}, + {"matrix": [1, 15], "x": 15, "y": 1}, + {"matrix": [2, 0], "x": 0, "y": 2, "w": 1.75}, + {"matrix": [2, 1], "x": 1.75, "y": 2}, + {"matrix": [2, 2], "x": 2.75, "y": 2}, + {"matrix": [2, 3], "x": 3.75, "y": 2}, + {"matrix": [2, 4], "x": 4.75, "y": 2}, + {"matrix": [2, 5], "x": 5.75, "y": 2}, + {"matrix": [2, 6], "x": 6.75, "y": 2}, + {"matrix": [2, 7], "x": 7.75, "y": 2}, + {"matrix": [2, 8], "x": 8.75, "y": 2}, + {"matrix": [2, 9], "x": 9.75, "y": 2}, + {"matrix": [2, 10], "x": 10.75, "y": 2}, + {"matrix": [2, 11], "x": 11.75, "y": 2}, + {"matrix": [2, 12], "x": 12.75, "y": 2}, + {"matrix": [2, 13], "x": 13.75, "y": 1, "w": 1.25, "h": 2}, + {"matrix": [2, 15], "x": 15, "y": 2}, + {"matrix": [3, 0], "x": 0, "y": 3, "w": 1.25}, + {"matrix": [3, 1], "x": 1.25, "y": 3}, + {"matrix": [3, 2], "x": 2.25, "y": 3}, + {"matrix": [3, 3], "x": 3.25, "y": 3}, + {"matrix": [3, 4], "x": 4.25, "y": 3}, + {"matrix": [3, 5], "x": 5.25, "y": 3}, + {"matrix": [3, 6], "x": 6.25, "y": 3}, + {"matrix": [3, 7], "x": 7.25, "y": 3}, + {"matrix": [3, 8], "x": 8.25, "y": 3}, + {"matrix": [3, 9], "x": 9.25, "y": 3}, + {"matrix": [3, 10], "x": 10.25, "y": 3}, + {"matrix": [3, 11], "x": 11.25, "y": 3}, + {"matrix": [3, 12], "x": 12.25, "y": 3, "w": 1.75}, + {"matrix": [3, 14], "x": 14, "y": 3}, + {"matrix": [3, 15], "x": 15, "y": 3}, + {"matrix": [4, 0], "x": 0, "y": 4, "w": 1.5}, + {"matrix": [4, 1], "x": 1.5, "y": 4}, + {"matrix": [4, 2], "x": 2.5, "y": 4, "w": 1.5}, + {"matrix": [4, 5], "x": 4, "y": 4, "w": 7}, + {"matrix": [4, 11], "x": 11, "y": 4, "w": 1.5}, + {"matrix": [4, 13], "x": 13, "y": 4}, + {"matrix": [4, 14], "x": 14, "y": 4}, + {"matrix": [4, 15], "x": 15, "y": 4} + ] + }, + "LAYOUT_all": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [0, 6], "x": 6, "y": 0}, + {"matrix": [0, 7], "x": 7, "y": 0}, + {"matrix": [0, 8], "x": 8, "y": 0}, + {"matrix": [0, 9], "x": 9, "y": 0}, + {"matrix": [0, 10], "x": 10, "y": 0}, + {"matrix": [0, 11], "x": 11, "y": 0}, + {"matrix": [0, 12], "x": 12, "y": 0}, + {"matrix": [0, 13], "x": 13, "y": 0}, + {"matrix": [0, 14], "x": 14, "y": 0}, + {"matrix": [0, 15], "x": 15, "y": 0}, + {"matrix": [1, 0], "x": 0, "y": 1, "w": 1.5}, + {"matrix": [1, 1], "x": 1.5, "y": 1}, + {"matrix": [1, 2], "x": 2.5, "y": 1}, + {"matrix": [1, 3], "x": 3.5, "y": 1}, + {"matrix": [1, 4], "x": 4.5, "y": 1}, + {"matrix": [1, 5], "x": 5.5, "y": 1}, + {"matrix": [1, 6], "x": 6.5, "y": 1}, + {"matrix": [1, 7], "x": 7.5, "y": 1}, + {"matrix": [1, 8], "x": 8.5, "y": 1}, + {"matrix": [1, 9], "x": 9.5, "y": 1}, + {"matrix": [1, 10], "x": 10.5, "y": 1}, + {"matrix": [1, 11], "x": 11.5, "y": 1}, + {"matrix": [1, 12], "x": 12.5, "y": 1}, + {"matrix": [1, 14], "x": 13.5, "y": 1, "w": 1.5}, + {"matrix": [1, 15], "x": 15, "y": 1}, + {"matrix": [2, 0], "x": 0, "y": 2, "w": 1.75}, + {"matrix": [2, 1], "x": 1.75, "y": 2}, + {"matrix": [2, 2], "x": 2.75, "y": 2}, + {"matrix": [2, 3], "x": 3.75, "y": 2}, + {"matrix": [2, 4], "x": 4.75, "y": 2}, + {"matrix": [2, 5], "x": 5.75, "y": 2}, + {"matrix": [2, 6], "x": 6.75, "y": 2}, + {"matrix": [2, 7], "x": 7.75, "y": 2}, + {"matrix": [2, 8], "x": 8.75, "y": 2}, + {"matrix": [2, 9], "x": 9.75, "y": 2}, + {"matrix": [2, 10], "x": 10.75, "y": 2}, + {"matrix": [2, 11], "x": 11.75, "y": 2}, + {"matrix": [2, 12], "x": 12.75, "y": 2}, + {"matrix": [2, 13], "x": 13.75, "y": 2, "w": 1.25}, + {"matrix": [2, 15], "x": 15, "y": 2}, + {"matrix": [3, 0], "x": 0, "y": 3, "w": 1.25}, + {"matrix": [3, 1], "x": 1.25, "y": 3}, + {"matrix": [3, 2], "x": 2.25, "y": 3}, + {"matrix": [3, 3], "x": 3.25, "y": 3}, + {"matrix": [3, 4], "x": 4.25, "y": 3}, + {"matrix": [3, 5], "x": 5.25, "y": 3}, + {"matrix": [3, 6], "x": 6.25, "y": 3}, + {"matrix": [3, 7], "x": 7.25, "y": 3}, + {"matrix": [3, 8], "x": 8.25, "y": 3}, + {"matrix": [3, 9], "x": 9.25, "y": 3}, + {"matrix": [3, 10], "x": 10.25, "y": 3}, + {"matrix": [3, 11], "x": 11.25, "y": 3}, + {"matrix": [3, 12], "x": 12.25, "y": 3, "w": 1.75}, + {"matrix": [3, 14], "x": 14, "y": 3}, + {"matrix": [3, 15], "x": 15, "y": 3}, + {"matrix": [4, 0], "x": 0, "y": 4, "w": 1.25}, + {"matrix": [4, 1], "x": 1.25, "y": 4, "w": 1.25}, + {"matrix": [4, 2], "x": 2.5, "y": 4, "w": 1.25}, + {"matrix": [4, 5], "x": 3.75, "y": 4, "w": 6.25}, + {"matrix": [4, 10], "x": 10, "y": 4, "w": 1.25}, + {"matrix": [4, 11], "x": 11.25, "y": 4, "w": 1.25}, + {"matrix": [4, 13], "x": 13, "y": 4}, + {"matrix": [4, 14], "x": 14, "y": 4}, + {"matrix": [4, 15], "x": 15, "y": 4} + ] + } + } +} diff --git a/keyboards/era/linx3/fave65s/keymaps/default/keymap.c b/keyboards/era/linx3/fave65s/keymaps/default/keymap.c new file mode 100644 index 00000000000..85eb4fb4ee2 --- /dev/null +++ b/keyboards/era/linx3/fave65s/keymaps/default/keymap.c @@ -0,0 +1,21 @@ +// Copyright 2024 QMK (@qmk) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_all( + QK_GESC, 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_BSPC, KC_INS, + 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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_PGUP, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT + ), + [1] = LAYOUT_all( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) +}; diff --git a/keyboards/era/linx3/fave65s/keymaps/via/keymap.c b/keyboards/era/linx3/fave65s/keymaps/via/keymap.c new file mode 100644 index 00000000000..85eb4fb4ee2 --- /dev/null +++ b/keyboards/era/linx3/fave65s/keymaps/via/keymap.c @@ -0,0 +1,21 @@ +// Copyright 2024 QMK (@qmk) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_all( + QK_GESC, 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_BSPC, KC_INS, + 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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_PGUP, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT + ), + [1] = LAYOUT_all( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) +}; diff --git a/keyboards/era/linx3/fave65s/keymaps/via/rules.mk b/keyboards/era/linx3/fave65s/keymaps/via/rules.mk new file mode 100644 index 00000000000..1e5b99807cb --- /dev/null +++ b/keyboards/era/linx3/fave65s/keymaps/via/rules.mk @@ -0,0 +1 @@ +VIA_ENABLE = yes diff --git a/keyboards/era/linx3/fave65s/readme.md b/keyboards/era/linx3/fave65s/readme.md new file mode 100644 index 00000000000..e31b3acef94 --- /dev/null +++ b/keyboards/era/linx3/fave65s/readme.md @@ -0,0 +1,26 @@ +# FAve 65S, Solder Ver + +![head](https://i.imgur.com/4Sc42zO.jpg) +![tail](https://i.imgur.com/hgCPtWg.jpg) + +* Keyboard Maintainer: [ERA](https://github.com/eerraa) +* Hardware supported: LINWORKS +* Hardware availability: [LINWORKS](https://allthatkeyboard.com/) + +Make example for this keyboard (after setting up your build environment): + + make era/linx3/fave65s:default + +Flashing example for this keyboard: + + make era/linx3/fave65s: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**: Hold down the key at ESC(0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard +* **Physical reset button**: Briefly short the `RESET` and `GND` pads on the SWD header twice, or short the `BOOT` header and plug in keyboard +* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available \ No newline at end of file From 494af672ced0f10bf5c60f9d5a8dac68d579640f Mon Sep 17 00:00:00 2001 From: jack Date: Thu, 11 Jul 2024 00:14:49 -0600 Subject: [PATCH 051/204] Fixup boardsource/the_q RGB matrix coordinates (#24086) --- keyboards/boardsource/the_q/keyboard.json | 86 +++++++++++------------ 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/keyboards/boardsource/the_q/keyboard.json b/keyboards/boardsource/the_q/keyboard.json index 61ff49330ed..b48b5e080b4 100644 --- a/keyboards/boardsource/the_q/keyboard.json +++ b/keyboards/boardsource/the_q/keyboard.json @@ -40,53 +40,53 @@ "max_brightness": 150, "driver": "ws2812", "layout": [ - {"x": 112.2, "y": 10.6, "flags": 2}, - {"x": 181, "y": 5.3, "flags": 2}, - {"x": 215.4, "y": 53.3, "flags": 2}, - {"x": 112.2, "y": 64, "flags": 2}, - {"x": 26.2, "y": 53.3, "flags": 2}, - {"x": 43.4, "y": 5.3, "flags": 2}, - {"matrix": [0, 1], "x": 17.6, "y": 0, "flags": 4}, - {"matrix": [1, 1], "x": 17.6, "y": 42.7, "flags": 4}, - {"matrix": [2, 1], "x": 17.6, "y": 21.4, "flags": 4}, - {"matrix": [2, 2], "x": 34.8, "y": 21.4, "flags": 4}, - {"matrix": [1, 2], "x": 34.8, "y": 42.7, "flags": 4}, - {"matrix": [0, 2], "x": 34.8, "y": 0, "flags": 4}, + {"x": 112, "y": 10, "flags": 2}, + {"x": 181, "y": 5, "flags": 2}, + {"x": 215, "y": 53, "flags": 2}, + {"x": 112, "y": 64, "flags": 2}, + {"x": 26, "y": 53, "flags": 2}, + {"x": 43, "y": 5, "flags": 2}, + {"matrix": [0, 1], "x": 17, "y": 0, "flags": 4}, + {"matrix": [1, 1], "x": 17, "y": 42, "flags": 4}, + {"matrix": [2, 1], "x": 17, "y": 21, "flags": 4}, + {"matrix": [2, 2], "x": 34, "y": 21, "flags": 4}, + {"matrix": [1, 2], "x": 34, "y": 42, "flags": 4}, + {"matrix": [0, 2], "x": 34, "y": 0, "flags": 4}, {"matrix": [0, 3], "x": 52, "y": 0, "flags": 4}, - {"matrix": [1, 3], "x": 52, "y": 42.7, "flags": 4}, - {"matrix": [2, 3], "x": 52, "y": 21.4, "flags": 4}, - {"matrix": [2, 4], "x": 69.2, "y": 21.4, "flags": 4}, - {"matrix": [1, 4], "x": 69.2, "y": 42.7, "flags": 4}, - {"matrix": [0, 4], "x": 69.2, "y": 0, "flags": 4}, - {"matrix": [0, 5], "x": 86.4, "y": 0, "flags": 4}, - {"matrix": [1, 5], "x": 86.4, "y": 42.7, "flags": 4}, - {"matrix": [2, 5], "x": 86.4, "y": 21.4, "flags": 4}, - {"matrix": [3, 0], "x": 69.2, "y": 20, "flags": 1}, - {"matrix": [3, 1], "x": 86.4, "y": 20, "flags": 1}, - {"matrix": [3, 2], "x": 103.6, "y": 64, "flags": 1}, - {"matrix": [3, 3], "x": 120.8, "y": 64, "flags": 1}, + {"matrix": [1, 3], "x": 52, "y": 42, "flags": 4}, + {"matrix": [2, 3], "x": 52, "y": 21, "flags": 4}, + {"matrix": [2, 4], "x": 69, "y": 21, "flags": 4}, + {"matrix": [1, 4], "x": 69, "y": 42, "flags": 4}, + {"matrix": [0, 4], "x": 69, "y": 0, "flags": 4}, + {"matrix": [0, 5], "x": 86, "y": 0, "flags": 4}, + {"matrix": [1, 5], "x": 86, "y": 42, "flags": 4}, + {"matrix": [2, 5], "x": 86, "y": 21, "flags": 4}, + {"matrix": [3, 0], "x": 69, "y": 20, "flags": 1}, + {"matrix": [3, 1], "x": 86, "y": 20, "flags": 1}, + {"matrix": [3, 2], "x": 103, "y": 64, "flags": 1}, + {"matrix": [3, 3], "x": 120, "y": 64, "flags": 1}, {"matrix": [3, 4], "x": 138, "y": 20, "flags": 1}, - {"matrix": [3, 5], "x": 155.2, "y": 20, "flags": 1}, - {"matrix": [4, 5], "x": 138, "y": 21.4, "flags": 4}, - {"matrix": [5, 5], "x": 138, "y": 42.7, "flags": 4}, + {"matrix": [3, 5], "x": 155, "y": 20, "flags": 1}, + {"matrix": [4, 5], "x": 138, "y": 21, "flags": 4}, + {"matrix": [5, 5], "x": 138, "y": 42, "flags": 4}, {"matrix": [6, 5], "x": 138, "y": 0, "flags": 4}, - {"matrix": [6, 4], "x": 155.2, "y": 0, "flags": 4}, - {"matrix": [5, 4], "x": 155.2, "y": 42.7, "flags": 4}, - {"matrix": [4, 4], "x": 155.2, "y": 21.4, "flags": 4}, - {"matrix": [4, 3], "x": 172.4, "y": 21.4, "flags": 4}, - {"matrix": [5, 3], "x": 172.4, "y": 42.7, "flags": 4}, - {"matrix": [6, 3], "x": 172.4, "y": 0, "flags": 4}, - {"matrix": [6, 2], "x": 189.6, "y": 0, "flags": 4}, - {"matrix": [5, 2], "x": 189.6, "y": 42.7, "flags": 4}, - {"matrix": [4, 2], "x": 189.6, "y": 21.4, "flags": 4}, - {"matrix": [4, 1], "x": 206.8, "y": 21.4, "flags": 4}, - {"matrix": [5, 1], "x": 206.8, "y": 42.7, "flags": 4}, - {"matrix": [6, 1], "x": 206.8, "y": 0, "flags": 4}, + {"matrix": [6, 4], "x": 155, "y": 0, "flags": 4}, + {"matrix": [5, 4], "x": 155, "y": 42, "flags": 4}, + {"matrix": [4, 4], "x": 155, "y": 21, "flags": 4}, + {"matrix": [4, 3], "x": 172, "y": 21, "flags": 4}, + {"matrix": [5, 3], "x": 172, "y": 42, "flags": 4}, + {"matrix": [6, 3], "x": 172, "y": 0, "flags": 4}, + {"matrix": [6, 2], "x": 189, "y": 0, "flags": 4}, + {"matrix": [5, 2], "x": 189, "y": 42, "flags": 4}, + {"matrix": [4, 2], "x": 189, "y": 21, "flags": 4}, + {"matrix": [4, 1], "x": 206, "y": 21, "flags": 4}, + {"matrix": [5, 1], "x": 206, "y": 42, "flags": 4}, + {"matrix": [6, 1], "x": 206, "y": 0, "flags": 4}, {"matrix": [6, 0], "x": 224, "y": 0, "flags": 1}, - {"matrix": [5, 0], "x": 224, "y": 42.7, "flags": 1}, - {"matrix": [4, 0], "x": 224, "y": 21.4, "flags": 1}, - {"matrix": [2, 0], "x": 0, "y": 21.4, "flags": 1}, - {"matrix": [1, 0], "x": 0, "y": 42.7, "flags": 1}, + {"matrix": [5, 0], "x": 224, "y": 42, "flags": 1}, + {"matrix": [4, 0], "x": 224, "y": 21, "flags": 1}, + {"matrix": [2, 0], "x": 0, "y": 21, "flags": 1}, + {"matrix": [1, 0], "x": 0, "y": 42, "flags": 1}, {"matrix": [0, 0], "x": 0, "y": 0, "flags": 1} ] }, From b066c86e432347e8abd52eb0faffc3db26dd4ede Mon Sep 17 00:00:00 2001 From: zvecr Date: Thu, 11 Jul 2024 11:03:11 +0100 Subject: [PATCH 052/204] bad_kb_funcs1 --- keyboards/40percentclub/ut47/ut47.c | 2 ++ keyboards/acheron/athena/alpha/alpha.c | 2 ++ keyboards/acheron/elongate/delta/delta.c | 2 ++ keyboards/clueboard/2x1800/2021/2021.c | 2 ++ keyboards/converter/xmk/xmk.c | 2 ++ keyboards/durgod/k310/k310.c | 2 ++ keyboards/durgod/k320/k320.c | 2 ++ keyboards/evyd13/gud70/gud70.c | 2 ++ keyboards/handwired/aek64/aek64.c | 13 +++++-------- .../battleship_gamepad/battleship_gamepad.c | 2 ++ keyboards/ibm/model_m/mschwingen/mschwingen.c | 2 ++ keyboards/idb/idb_60/idb_60.c | 2 ++ keyboards/kbdfans/phaseone/phaseone.c | 2 ++ keyboards/matrix/falcon/falcon.c | 1 + keyboards/mechlovin/zed1800/zed1800.c | 4 ++++ keyboards/monsgeek/m3/m3.c | 2 ++ keyboards/system76/launch_1/launch_1.c | 6 +++++- .../overnumpad_1xb/overnumpad_1xb.c | 2 ++ .../overnumpad_1xb/overnumpad_1xb.c | 2 ++ keyboards/wilba_tech/wt70_jb/wt70_jb.c | 2 ++ keyboards/yandrstudio/nz64/nz64.c | 4 ++++ keyboards/yandrstudio/nz67v2/nz67v2.c | 4 ++++ 22 files changed, 55 insertions(+), 9 deletions(-) diff --git a/keyboards/40percentclub/ut47/ut47.c b/keyboards/40percentclub/ut47/ut47.c index d5675e1047c..867d8c02024 100644 --- a/keyboards/40percentclub/ut47/ut47.c +++ b/keyboards/40percentclub/ut47/ut47.c @@ -19,6 +19,8 @@ void matrix_init_kb(void) { uart_init(9600); + + matrix_init_user(); } #endif diff --git a/keyboards/acheron/athena/alpha/alpha.c b/keyboards/acheron/athena/alpha/alpha.c index 8fe47eff821..4dea24b93d6 100644 --- a/keyboards/acheron/athena/alpha/alpha.c +++ b/keyboards/acheron/athena/alpha/alpha.c @@ -24,6 +24,8 @@ void board_init(void) { void keyboard_post_init_kb(void){ // Defining the backlight pin (A6) as an floating (no pullup or pulldown resistor) opendrain output pin palSetLineMode(BACKLIGHT_PIN, PAL_MODE_ALTERNATE(2) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_OSPEED_HIGHEST | PAL_STM32_PUPDR_FLOATING); + + keyboard_post_init_user(); } void led_init_ports(void) { diff --git a/keyboards/acheron/elongate/delta/delta.c b/keyboards/acheron/elongate/delta/delta.c index 98b60bae614..839151521a2 100755 --- a/keyboards/acheron/elongate/delta/delta.c +++ b/keyboards/acheron/elongate/delta/delta.c @@ -74,4 +74,6 @@ layer_state_t layer_state_set_kb(layer_state_t state) { // Since the keyboard starts at layer 0, the init function starts LED4 as lit up. void keyboard_post_init_kb(void){ gpio_write_pin(LED4_PIN, 0); + + keyboard_post_init_user(); } diff --git a/keyboards/clueboard/2x1800/2021/2021.c b/keyboards/clueboard/2x1800/2021/2021.c index 2a3f1304c7e..e575a7544cb 100644 --- a/keyboards/clueboard/2x1800/2021/2021.c +++ b/keyboards/clueboard/2x1800/2021/2021.c @@ -90,6 +90,8 @@ void matrix_init_kb(void) { #elif defined(DRAWING_TOY_MODE) max7219_set_led(0, 0, true); #endif + + matrix_init_user(); } __attribute__ ((weak)) diff --git a/keyboards/converter/xmk/xmk.c b/keyboards/converter/xmk/xmk.c index e0df96fc2d2..8a24e5f9648 100644 --- a/keyboards/converter/xmk/xmk.c +++ b/keyboards/converter/xmk/xmk.c @@ -10,5 +10,7 @@ void keyboard_post_init_kb(void) { debug_enable=true; debug_matrix=true; debug_keyboard=true; + + keyboard_post_init_user(); } #endif diff --git a/keyboards/durgod/k310/k310.c b/keyboards/durgod/k310/k310.c index 7879b13f4ea..c176587ef27 100644 --- a/keyboards/durgod/k310/k310.c +++ b/keyboards/durgod/k310/k310.c @@ -87,4 +87,6 @@ void keyboard_pre_init_kb(void) { bootloader_jump(); } #endif + + keyboard_pre_init_user(); } diff --git a/keyboards/durgod/k320/k320.c b/keyboards/durgod/k320/k320.c index 0a544fe3189..50b87d7241b 100644 --- a/keyboards/durgod/k320/k320.c +++ b/keyboards/durgod/k320/k320.c @@ -87,4 +87,6 @@ void keyboard_pre_init_kb(void) { bootloader_jump(); } #endif + + keyboard_pre_init_user(); } diff --git a/keyboards/evyd13/gud70/gud70.c b/keyboards/evyd13/gud70/gud70.c index 5c400455211..118c68e5667 100644 --- a/keyboards/evyd13/gud70/gud70.c +++ b/keyboards/evyd13/gud70/gud70.c @@ -19,4 +19,6 @@ void keyboard_pre_init_kb(void) { // Enable top LED gpio_set_pin_output(B3); gpio_write_pin_low(B3); + + keyboard_pre_init_user(); } diff --git a/keyboards/handwired/aek64/aek64.c b/keyboards/handwired/aek64/aek64.c index 130d014616c..21589b6910b 100644 --- a/keyboards/handwired/aek64/aek64.c +++ b/keyboards/handwired/aek64/aek64.c @@ -16,21 +16,18 @@ along with this program. If not, see . */ #include "quantum.h" -/* - * Hardware function pre initialisation. - * See https://docs.qmk.fm/#/custom_quantum_functions?id=example-keyboard_pre_init_user-implementation - */ -void keyboard_pre_init_user(void) { - // Call the keyboard pre init code. - +void keyboard_pre_init_kb(void) { // Set our LED pins as output gpio_set_pin_output(C3); + + keyboard_pre_init_user(); } void matrix_init_kb(void) { - // Flash the led 1 sec on startup. gpio_write_pin_high(C3); wait_ms(1000); gpio_write_pin_low(C3); + + matrix_init_user(); } diff --git a/keyboards/handwired/battleship_gamepad/battleship_gamepad.c b/keyboards/handwired/battleship_gamepad/battleship_gamepad.c index 7b5e65a9907..6bfcb17fd43 100644 --- a/keyboards/handwired/battleship_gamepad/battleship_gamepad.c +++ b/keyboards/handwired/battleship_gamepad/battleship_gamepad.c @@ -19,4 +19,6 @@ /* joystick button code (thumbstick pressed) */ void keyboard_pre_init_kb(void) { gpio_set_pin_input_high(F6); + + keyboard_pre_init_user(); } diff --git a/keyboards/ibm/model_m/mschwingen/mschwingen.c b/keyboards/ibm/model_m/mschwingen/mschwingen.c index 7112ab63a57..11407d12062 100644 --- a/keyboards/ibm/model_m/mschwingen/mschwingen.c +++ b/keyboards/ibm/model_m/mschwingen/mschwingen.c @@ -114,6 +114,8 @@ void keyboard_pre_init_kb(void) { gpio_set_pin_output(SR_CLK_PIN); gpio_set_pin_output(SR_DOUT_PIN); // MOSI - unused gpio_write_pin_low(SR_CLK_PIN); + + keyboard_pre_init_user(); } #ifdef KEYBOARD_ibm_model_m_mschwingen_led_ws2812 diff --git a/keyboards/idb/idb_60/idb_60.c b/keyboards/idb/idb_60/idb_60.c index 77485a42734..183892f3632 100644 --- a/keyboards/idb/idb_60/idb_60.c +++ b/keyboards/idb/idb_60/idb_60.c @@ -3,6 +3,8 @@ void keyboard_pre_init_kb(void) { gpio_set_pin_output(C4); gpio_set_pin_output(C5); + + keyboard_pre_init_user(); } inline void _idb_60_caps_led_on(void) { diff --git a/keyboards/kbdfans/phaseone/phaseone.c b/keyboards/kbdfans/phaseone/phaseone.c index a44e5011090..97cc7d2d2ac 100644 --- a/keyboards/kbdfans/phaseone/phaseone.c +++ b/keyboards/kbdfans/phaseone/phaseone.c @@ -18,4 +18,6 @@ void keyboard_pre_init_kb(void) { gpio_set_pin_output(D4); + + keyboard_pre_init_user(); } diff --git a/keyboards/matrix/falcon/falcon.c b/keyboards/matrix/falcon/falcon.c index 74677ab0d1f..bfc878a79c7 100644 --- a/keyboards/matrix/falcon/falcon.c +++ b/keyboards/matrix/falcon/falcon.c @@ -25,4 +25,5 @@ void matrix_init_kb(void) gpio_set_pin_output(LED_POWER_PIN); gpio_write_pin_high(LED_POWER_PIN); + matrix_init_user(); } diff --git a/keyboards/mechlovin/zed1800/zed1800.c b/keyboards/mechlovin/zed1800/zed1800.c index e86b4d5a5a8..a7b526b7a6f 100644 --- a/keyboards/mechlovin/zed1800/zed1800.c +++ b/keyboards/mechlovin/zed1800/zed1800.c @@ -27,9 +27,13 @@ RGBLIGHT_LAYERS_LIST( my_numlock_layer, my_scroll_layer ); + void keyboard_post_init_kb(void) { rgblight_layers = my_rgb_layers; + + keyboard_post_init_user(); } + // Activate rgb layer for caps when capslock is enabled bool led_update_kb(led_t led_state) { rgblight_set_layer_state(0, led_state.caps_lock); diff --git a/keyboards/monsgeek/m3/m3.c b/keyboards/monsgeek/m3/m3.c index 04a9f0ca96f..1752ddc3b3a 100644 --- a/keyboards/monsgeek/m3/m3.c +++ b/keyboards/monsgeek/m3/m3.c @@ -140,6 +140,8 @@ void matrix_init_kb(void) { gpio_write_pin_low(LED_MAC_OS_PIN); gpio_set_pin_output(LED_WIN_LOCK_PIN); // LED3 Win Lock gpio_write_pin_low(LED_WIN_LOCK_PIN); + + matrix_init_user(); } void housekeeping_task_kb(void){ diff --git a/keyboards/system76/launch_1/launch_1.c b/keyboards/system76/launch_1/launch_1.c index 7a5000d9baa..630305194ea 100644 --- a/keyboards/system76/launch_1/launch_1.c +++ b/keyboards/system76/launch_1/launch_1.c @@ -139,6 +139,8 @@ void matrix_init_kb(void) { } system76_ec_rgb_layer(layer_state); + + matrix_init_user(); } void matrix_scan_kb(void) { @@ -238,9 +240,11 @@ layer_state_t layer_state_set_kb(layer_state_t layer_state) { } #ifdef CONSOLE_ENABLE -void keyboard_post_init_user(void) { +void keyboard_post_init_kb(void) { debug_enable = true; debug_matrix = false; debug_keyboard = false; + + keyboard_post_init_user(); } #endif // CONSOLE_ENABLE diff --git a/keyboards/unicomp/spacesaver_m_post_2013/overnumpad_1xb/overnumpad_1xb.c b/keyboards/unicomp/spacesaver_m_post_2013/overnumpad_1xb/overnumpad_1xb.c index f441285c9ad..488ace3f91d 100644 --- a/keyboards/unicomp/spacesaver_m_post_2013/overnumpad_1xb/overnumpad_1xb.c +++ b/keyboards/unicomp/spacesaver_m_post_2013/overnumpad_1xb/overnumpad_1xb.c @@ -23,6 +23,8 @@ void keyboard_post_init_kb(void) gpio_set_pin_output(C11); // middle led, always off on Spacesaver M gpio_write_pin(C11, 0); gpio_set_pin_output(C10); // right-most led, normally Scroll Lock, but on Spacesaver M indicates function layer + + keyboard_post_init_user(); } diff --git a/keyboards/unicomp/spacesaver_m_pre_2013/overnumpad_1xb/overnumpad_1xb.c b/keyboards/unicomp/spacesaver_m_pre_2013/overnumpad_1xb/overnumpad_1xb.c index bad0c76e433..9f5f592ff6b 100644 --- a/keyboards/unicomp/spacesaver_m_pre_2013/overnumpad_1xb/overnumpad_1xb.c +++ b/keyboards/unicomp/spacesaver_m_pre_2013/overnumpad_1xb/overnumpad_1xb.c @@ -23,6 +23,8 @@ void keyboard_post_init_kb(void) gpio_set_pin_output(C11); // middle led, always off on Spacesaver M gpio_write_pin(C11, 0); gpio_set_pin_output(C10); // right-most led, normally Scroll Lock, but on Spacesaver M indicates function layer + + keyboard_post_init_user(); } layer_state_t layer_state_set_kb(layer_state_t state) { diff --git a/keyboards/wilba_tech/wt70_jb/wt70_jb.c b/keyboards/wilba_tech/wt70_jb/wt70_jb.c index ad480ece227..e4d0efc5e48 100644 --- a/keyboards/wilba_tech/wt70_jb/wt70_jb.c +++ b/keyboards/wilba_tech/wt70_jb/wt70_jb.c @@ -42,6 +42,8 @@ void keyboard_post_init_kb(void) { if ( g_first_execution ) { rgblight_mode(RGBLIGHT_MODE_RGB_TEST); } + + keyboard_post_init_user(); } #endif // VIA_ENABLE diff --git a/keyboards/yandrstudio/nz64/nz64.c b/keyboards/yandrstudio/nz64/nz64.c index b5a53273dfc..66ba9fb6ee0 100644 --- a/keyboards/yandrstudio/nz64/nz64.c +++ b/keyboards/yandrstudio/nz64/nz64.c @@ -84,10 +84,14 @@ bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) { void eeconfig_init_kb(void) { kb_cums.raw = 0; eeconfig_update_kb(kb_cums.raw); + + eeconfig_init_user(); } void keyboard_post_init_kb(void) { kb_cums.underground_rgb_sw = eeconfig_read_kb(); + + keyboard_post_init_user(); } #endif diff --git a/keyboards/yandrstudio/nz67v2/nz67v2.c b/keyboards/yandrstudio/nz67v2/nz67v2.c index 346556c25ed..c3162dd9611 100644 --- a/keyboards/yandrstudio/nz67v2/nz67v2.c +++ b/keyboards/yandrstudio/nz67v2/nz67v2.c @@ -85,10 +85,14 @@ bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) { void eeconfig_init_kb(void) { kb_cums.raw = 0; eeconfig_update_kb(kb_cums.raw); + + eeconfig_init_user(); } void keyboard_post_init_kb(void) { kb_cums.underground_rgb_sw = eeconfig_read_kb(); + + keyboard_post_init_user(); } #endif From f8cf58a512d3e85f491b884672353acefab2f7bc Mon Sep 17 00:00:00 2001 From: Dasky <32983009+daskygit@users.noreply.github.com> Date: Thu, 11 Jul 2024 13:10:28 +0100 Subject: [PATCH 053/204] Remove a user keymap from crkbd. (#24091) remove personal keymap --- keyboards/crkbd/keymaps/colemak_luna/config.h | 115 ------ keyboards/crkbd/keymaps/colemak_luna/keymap.c | 385 ------------------ .../crkbd/keymaps/colemak_luna/readme.md | 17 - keyboards/crkbd/keymaps/colemak_luna/rules.mk | 7 - 4 files changed, 524 deletions(-) delete mode 100644 keyboards/crkbd/keymaps/colemak_luna/config.h delete mode 100644 keyboards/crkbd/keymaps/colemak_luna/keymap.c delete mode 100644 keyboards/crkbd/keymaps/colemak_luna/readme.md delete mode 100644 keyboards/crkbd/keymaps/colemak_luna/rules.mk diff --git a/keyboards/crkbd/keymaps/colemak_luna/config.h b/keyboards/crkbd/keymaps/colemak_luna/config.h deleted file mode 100644 index 546e01bdba9..00000000000 --- a/keyboards/crkbd/keymaps/colemak_luna/config.h +++ /dev/null @@ -1,115 +0,0 @@ -/* -Copyright 2019 @foostan -Copyright 2023 @asdfire1 - -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 - -/* Select hand configuration */ - -#define MASTER_LEFT -// #define MASTER_RIGHT -// #define EE_HANDS - -#ifdef RGBLIGHT_ENABLE - #define RGBLIGHT_EFFECT_BREATHING - #define RGBLIGHT_EFFECT_RAINBOW_MOOD - #define RGBLIGHT_EFFECT_RAINBOW_SWIRL - #define RGBLIGHT_EFFECT_SNAKE - #define RGBLIGHT_EFFECT_KNIGHT - #define RGBLIGHT_EFFECT_CHRISTMAS - #define RGBLIGHT_EFFECT_STATIC_GRADIENT -// #define RGBLIGHT_EFFECT_RGB_TEST -// #define RGBLIGHT_EFFECT_ALTERNATING -// #define RGBLIGHT_EFFECT_TWINKLE - #define RGBLIGHT_LIMIT_VAL 120 - #define RGBLIGHT_HUE_STEP 10 - #define RGBLIGHT_SAT_STEP 17 - #define RGBLIGHT_VAL_STEP 17 -#endif - -#ifdef RGB_MATRIX_ENABLE -//# define RGB_MATRIX_KEYPRESSES // reacts to keypresses -// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses) -// # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects -# define RGB_MATRIX_SLEEP // turn off effects when suspended -//# define RGB_MATRIX_FRAMEBUFFER_EFFECTS -// # define RGB_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness) -// # define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness) -# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 // limits maximum brightness of LEDs to 150 out of 255. Higher may cause the controller to crash. -# define RGB_MATRIX_HUE_STEP 8 -# define RGB_MATRIX_SAT_STEP 8 -# define RGB_MATRIX_VAL_STEP 8 -# define RGB_MATRIX_SPD_STEP 10 - -/* Enable the animations you want/need. You may need to enable only a small number of these because * - * they take up a lot of space. Enable and confirm that you can still successfully compile your firmware. */ -// RGB Matrix Animation modes. Explicitly enabled -// For full list of effects, see: -// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects -# define ENABLE_RGB_MATRIX_ALPHAS_MODS -//# define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN -//# define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT -//# define ENABLE_RGB_MATRIX_BREATHING -//# define ENABLE_RGB_MATRIX_BAND_SAT -//# define ENABLE_RGB_MATRIX_BAND_VAL -//# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT -//# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL -//# define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT -//# define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL -//# define ENABLE_RGB_MATRIX_CYCLE_ALL -//# define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT -# define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN -//# define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON -//# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN -//# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL -//# define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL -//# define ENABLE_RGB_MATRIX_CYCLE_SPIRAL -//# define ENABLE_RGB_MATRIX_DUAL_BEACON -//# define ENABLE_RGB_MATRIX_RAINBOW_BEACON -//# define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS -//# define ENABLE_RGB_MATRIX_RAINDROPS -//# define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS -//# define ENABLE_RGB_MATRIX_HUE_BREATHING -//# define ENABLE_RGB_MATRIX_HUE_PENDULUM -//# define ENABLE_RGB_MATRIX_HUE_WAVE -//# define ENABLE_RGB_MATRIX_PIXEL_RAIN -//# define ENABLE_RGB_MATRIX_PIXEL_FLOW -//# define ENABLE_RGB_MATRIX_PIXEL_FRACTAL -// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined -//# define ENABLE_RGB_MATRIX_TYPING_HEATMAP -//# define ENABLE_RGB_MATRIX_DIGITAL_RAIN -// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined -//# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE -//# define ENABLE_RGB_MATRIX_SOLID_REACTIVE -//# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE -//# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE -//# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS -//# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS -//# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS -//# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS -//# define ENABLE_RGB_MATRIX_SPLASH -//# define ENABLE_RGB_MATRIX_MULTISPLASH -//# define ENABLE_RGB_MATRIX_SOLID_SPLASH -//# define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH -#endif -#define OLED_FONT_H "keyboards/crkbd/lib/glcdfont.c" -#define SPLIT_LAYER_STATE_ENABLE -#define SPLIT_WPM_ENABLE //Enable WPM across split keyboards (+268). -#define NO_ACTION_ONESHOT -//#define SPLIT_OLED_ENABLE - -#define DYNAMIC_KEYMAP_LAYER_COUNT 6 \ No newline at end of file diff --git a/keyboards/crkbd/keymaps/colemak_luna/keymap.c b/keyboards/crkbd/keymaps/colemak_luna/keymap.c deleted file mode 100644 index 39cfd1ca256..00000000000 --- a/keyboards/crkbd/keymaps/colemak_luna/keymap.c +++ /dev/null @@ -1,385 +0,0 @@ -/* -Copyright 2019 @foostan -Copyright 2021 @HellSingCoder -Copyright 2023 @asdfire1 - -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 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - //COLEMAK - [0] = LAYOUT_split_3x6_3( - //,-----------------------------------------------------. ,-----------------------------------------------------. - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, - //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - KC_LSFT, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, - //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ESC, - //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| - KC_LGUI, MO(3), KC_SPC, KC_ENT, MO(4), KC_RALT - //`--------------------------' `--------------------------' - - ), - //GAME1 - [1] = LAYOUT_split_3x6_3( - //,-----------------------------------------------------. ,-----------------------------------------------------. - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ESC, - //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| - KC_LALT, MO(2), KC_SPC, KC_ENT, MO(4), KC_RALT - //`--------------------------' `--------------------------' - ), - //GAME2 - [2] = LAYOUT_split_3x6_3( - //,-----------------------------------------------------. ,-----------------------------------------------------. - KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_DEL, - //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - KC_LSFT, KC_F1, KC_F2, XXXXXXX, XXXXXXX, KC_6, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - KC_LCTL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F13, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F13, - //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| - KC_LGUI, _______, KC_SPC, KC_ENT, MO(5), KC_RALT - //`--------------------------' `--------------------------' - ), - //LOWER - [3] = LAYOUT_split_3x6_3( - //,-----------------------------------------------------. ,-----------------------------------------------------. - KC_TAB, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, KC_MPRV, XXXXXXX, KC_MINS, KC_P7, KC_P8, KC_P9, KC_DEL, - //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - KC_LSFT, KC_LEFT, KC_DOWN,KC_RIGHT, XXXXXXX, KC_MPLY, XXXXXXX, KC_PLUS, KC_P4, KC_P5, KC_P6, XXXXXXX, - //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - KC_LCTL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MNXT, XXXXXXX, KC_EQL, KC_P1, KC_P2, KC_P3, KC_F13, - //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| - KC_LGUI, _______, KC_SPC, KC_SPC, MO(5), KC_P0 - //`--------------------------' `--------------------------' - ), - //RAISE - [4] = LAYOUT_split_3x6_3( - //,-----------------------------------------------------. ,-----------------------------------------------------. - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_PGUP, - //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - KC_CAPS, KC_CIRC, KC_AMPR, KC_LCBR, KC_LBRC, KC_LPRN, KC_RPRN, KC_RBRC, KC_RCBR, XXXXXXX, KC_END, KC_PGDN, - //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - KC_LCTL, KC_ASTR, KC_UNDS, KC_BSLS, KC_PIPE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSCR, - //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| - KC_LGUI, MO(5), KC_BSPC, _______, _______, KC_LALT - //`--------------------------' `--------------------------' - ), - //ADJUST - [5] = LAYOUT_split_3x6_3( - //,-----------------------------------------------------. ,-----------------------------------------------------. - QK_BOOT, TG(1), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, - //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, XXXXXXX, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, - //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| - KC_LGUI, _______, _______, _______, _______, KC_LALT - //`--------------------------' `--------------------------' - ) -}; -// clang-format on - -#ifdef OLED_ENABLE - - -/* 32 * 32 logo */ -static void render_logo(void) { - static const char PROGMEM hexagram_logo[] = { - 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0x70, 0x18, 0x06, - 0x06, 0x18, 0x70, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x07, 0x1f, 0x32, 0x66, 0xc4, 0x6c, 0x38, 0x1e, 0x37, 0x61, 0xc0, 0x80, 0x80, - 0x80, 0x80, 0xc0, 0x61, 0x37, 0x1e, 0x38, 0x6c, 0xc4, 0x66, 0x32, 0x1f, 0x07, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x80, 0xe0, 0xf8, 0x4c, 0x66, 0x23, 0x36, 0x1c, 0x78, 0xec, 0x86, 0x03, 0x01, 0x01, - 0x01, 0x01, 0x03, 0x86, 0xec, 0x78, 0x1c, 0x36, 0x23, 0x66, 0x4c, 0xf8, 0xe0, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x0e, 0x18, 0x60, - 0x60, 0x18, 0x0e, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 -}; - oled_write_raw_P(hexagram_logo, sizeof(hexagram_logo)); -} - - - -/* KEYBOARD PET START */ - -/* settings */ -# define MIN_WALK_SPEED 10 -# define MIN_RUN_SPEED 40 - -/* advanced settings */ -# define ANIM_FRAME_DURATION 200 // how long each frame lasts in ms -# define ANIM_SIZE 96 // number of bytes in array. If you change sprites, minimize for adequate firmware size. max is 1024 - -/* timers */ -uint32_t anim_timer = 0; -uint32_t anim_sleep = 0; - -/* current frame */ -uint8_t current_frame = 0; - -/* status variables */ -int current_wpm = 0; -led_t led_usb_state; - -bool isSneaking = false; -bool isJumping = false; -bool showedJump = true; -bool isBarking = false; - -/* logic */ -static void render_luna(int LUNA_X, int LUNA_Y) { - /* Sit */ - static const char PROGMEM sit[2][ANIM_SIZE] = {/* 'sit1', 32x22px */ - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1c, 0x02, 0x05, 0x02, 0x24, 0x04, 0x04, 0x02, 0xa9, 0x1e, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x10, 0x08, 0x68, 0x10, 0x08, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x82, 0x7c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x0c, 0x10, 0x10, 0x20, 0x20, 0x20, 0x28, 0x3e, 0x1c, 0x20, 0x20, 0x3e, 0x0f, 0x11, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - - /* 'sit2', 32x22px */ - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1c, 0x02, 0x05, 0x02, 0x24, 0x04, 0x04, 0x02, 0xa9, 0x1e, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x90, 0x08, 0x18, 0x60, 0x10, 0x08, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0e, 0x82, 0x7c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x0c, 0x10, 0x10, 0x20, 0x20, 0x20, 0x28, 0x3e, 0x1c, 0x20, 0x20, 0x3e, 0x0f, 0x11, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}; - - /* Walk */ - static const char PROGMEM walk[2][ANIM_SIZE] = {/* 'walk1', 32x22px */ - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x90, 0x90, 0x90, 0xa0, 0xc0, 0x80, 0x80, 0x80, 0x70, 0x08, 0x14, 0x08, 0x90, 0x10, 0x10, 0x08, 0xa4, 0x78, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x18, 0xea, 0x10, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x1c, 0x20, 0x20, 0x3c, 0x0f, 0x11, 0x1f, 0x03, 0x06, 0x18, 0x20, 0x20, 0x3c, 0x0c, 0x12, 0x1e, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - - /* 'walk2', 32x22px */ - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x20, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x10, 0x28, 0x10, 0x20, 0x20, 0x20, 0x10, 0x48, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x20, 0xf8, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x30, 0xd5, 0x20, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x20, 0x30, 0x0c, 0x02, 0x05, 0x09, 0x12, 0x1e, 0x02, 0x1c, 0x14, 0x08, 0x10, 0x20, 0x2c, 0x32, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }}; - - /* Run */ - static const char PROGMEM run[2][ANIM_SIZE] = {/* 'run1', 32x22px */ - { - 0x00, 0x00, 0x00, 0x00, 0xe0, 0x10, 0x08, 0x08, 0xc8, 0xb0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x40, 0x40, 0x3c, 0x14, 0x04, 0x08, 0x90, 0x18, 0x04, 0x08, 0xb0, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0xc4, 0xa4, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc8, 0x58, 0x28, 0x2a, 0x10, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x09, 0x04, 0x04, 0x04, 0x04, 0x02, 0x03, 0x02, 0x01, 0x01, 0x02, 0x02, 0x04, 0x08, 0x10, 0x26, 0x2b, 0x32, 0x04, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - - /* 'run2', 32x22px */ - { - 0x00, 0x00, 0x00, 0xe0, 0x10, 0x10, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x78, 0x28, 0x08, 0x10, 0x20, 0x30, 0x08, 0x10, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 0x08, 0x10, 0x11, 0xf9, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0xb0, 0x50, 0x55, 0x20, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x0c, 0x10, 0x20, 0x28, 0x37, 0x02, 0x1e, 0x20, 0x20, 0x18, 0x0c, 0x14, 0x1e, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }}; - - /* Bark */ - static const char PROGMEM bark[2][ANIM_SIZE] = {/* 'bark1', 32x22px */ - { - 0x00, 0xc0, 0x20, 0x10, 0xd0, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x40, 0x3c, 0x14, 0x04, 0x08, 0x90, 0x18, 0x04, 0x08, 0xb0, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 0x08, 0x10, 0x11, 0xf9, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc8, 0x48, 0x28, 0x2a, 0x10, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x0c, 0x10, 0x20, 0x28, 0x37, 0x02, 0x02, 0x04, 0x08, 0x10, 0x26, 0x2b, 0x32, 0x04, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - - /* 'bark2', 32x22px */ - { - 0x00, 0xe0, 0x10, 0x10, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x40, 0x40, 0x2c, 0x14, 0x04, 0x08, 0x90, 0x18, 0x04, 0x08, 0xb0, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 0x08, 0x10, 0x11, 0xf9, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0x48, 0x28, 0x2a, 0x10, 0x0f, 0x20, 0x4a, 0x09, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x0c, 0x10, 0x20, 0x28, 0x37, 0x02, 0x02, 0x04, 0x08, 0x10, 0x26, 0x2b, 0x32, 0x04, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }}; - - /* Sneak */ - static const char PROGMEM sneak[2][ANIM_SIZE] = {/* 'sneak1', 32x22px */ - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x40, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x40, 0x40, 0x80, 0x00, 0x80, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x21, 0xf0, 0x04, 0x02, 0x02, 0x02, 0x02, 0x03, 0x02, 0x02, 0x04, 0x04, 0x04, 0x03, 0x01, 0x00, 0x00, 0x09, 0x01, 0x80, 0x80, 0xab, 0x04, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x1c, 0x20, 0x20, 0x3c, 0x0f, 0x11, 0x1f, 0x02, 0x06, 0x18, 0x20, 0x20, 0x38, 0x08, 0x10, 0x18, 0x04, 0x04, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, - }, - - /* 'sneak2', 32x22px */ - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xa0, 0x20, 0x40, 0x80, 0xc0, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x41, 0xf0, 0x04, 0x02, 0x02, 0x02, 0x03, 0x02, 0x02, 0x02, 0x04, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x40, 0x40, 0x55, 0x82, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x20, 0x30, 0x0c, 0x02, 0x05, 0x09, 0x12, 0x1e, 0x04, 0x18, 0x10, 0x08, 0x10, 0x20, 0x28, 0x34, 0x06, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - }}; - - /* animation */ - void animate_luna(void) { - /* jump */ - if (isJumping || !showedJump) { - /* clear */ - oled_set_cursor(LUNA_X, LUNA_Y + 2); - oled_write(" ", false); - - oled_set_cursor(LUNA_X, LUNA_Y - 1); - - showedJump = true; - } else { - /* clear */ - oled_set_cursor(LUNA_X, LUNA_Y - 1); - oled_write(" ", false); - - oled_set_cursor(LUNA_X, LUNA_Y); - } - - /* switch frame */ - current_frame = (current_frame + 1) % 2; - - /* current status */ - if (led_usb_state.caps_lock) { - oled_write_raw_P(bark[abs(1 - current_frame)], ANIM_SIZE); - - } else if (isSneaking) { - oled_write_raw_P(sneak[abs(1 - current_frame)], ANIM_SIZE); - - } else if (current_wpm <= MIN_WALK_SPEED) { - oled_write_raw_P(sit[abs(1 - current_frame)], ANIM_SIZE); - - } else if (current_wpm <= MIN_RUN_SPEED) { - oled_write_raw_P(walk[abs(1 - current_frame)], ANIM_SIZE); - - } else { - oled_write_raw_P(run[abs(1 - current_frame)], ANIM_SIZE); - } - } - - /* animation timer */ - if (timer_elapsed32(anim_timer) > ANIM_FRAME_DURATION) { - anim_timer = timer_read32(); - animate_luna(); - } - - /* this fixes the screen on and off bug */ - if (current_wpm > 0) { - oled_on(); - anim_sleep = timer_read32(); - } else if(timer_elapsed32(anim_sleep) > OLED_TIMEOUT) { - /* clear */ - oled_set_cursor(0,0); - oled_write(" ", false); - oled_off(); - oled_set_cursor(LUNA_X,LUNA_Y); - } -} - -/* KEYBOARD PET END */ - -static void print_logo_narrow(void) { - render_logo(); -if (current_wpm > 0) { - anim_sleep = timer_read32(); - /* wpm counter */ - oled_set_cursor(0, 14); - oled_write(get_u8_str(get_current_wpm(), '0'), false); - - oled_set_cursor(0, 15); - oled_write(" wpm", false); - - /* this fixes the screen on and off bug */ - - } else if(timer_elapsed32(anim_sleep) > OLED_TIMEOUT) { - /* clear */ - oled_set_cursor(0,0); - oled_write(" ", false); - oled_off(); - - - } -} - -layer_state_t layer_state_set_user(layer_state_t state) { - switch (get_highest_layer(state)) { - case 0: - rgb_matrix_reload_from_eeprom(); - break; - case 1: - rgb_matrix_mode_noeeprom(RGB_MATRIX_ALPHAS_MODS); - rgb_matrix_sethsv_noeeprom(HSV_TEAL); - break; - case 2: - rgb_matrix_mode_noeeprom(RGB_MATRIX_ALPHAS_MODS); - rgb_matrix_sethsv_noeeprom(HSV_PURPLE); - break; - case 5: - rgb_matrix_mode_noeeprom(RGB_MATRIX_ALPHAS_MODS); - rgb_matrix_sethsv_noeeprom(HSV_YELLOW); - break; - } - return state; -} - -static void print_status_narrow(void) { - - - /* Print current layer */ - oled_write("LAYER", false); - - oled_set_cursor(0, 6); - - switch (get_highest_layer(layer_state)) { - case 0: - oled_write("Base ", false); - break; - case 1: - oled_write("Game ", false); - break; - case 2: - oled_write("Game2", false); - break; - case 3: - oled_write("Lower", false); - break; - case 4: - oled_write("Raise", false); - break; - case 5: - oled_write("Adj ", false); - break; - default: - oled_write("Undef", false); - } - - - /* KEYBOARD PET RENDER START */ - - render_luna(0, 13); - - /* KEYBOARD PET RENDER END */ -} - -oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_270; } - -bool oled_task_user(void) { - /* KEYBOARD PET VARIABLES START */ - - current_wpm = get_current_wpm(); - led_usb_state = host_keyboard_led_state(); - - /* KEYBOARD PET VARIABLES END */ - - if (is_keyboard_master()) { - print_status_narrow(); - } else { - print_logo_narrow(); - } - return false; -} - -#endif - bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - /* KEYBOARD PET STATUS START */ - - case KC_LCTL: - isSneaking = record->event.pressed; - break; - case KC_SPC: - isJumping = record->event.pressed; - if (isJumping) { - showedJump = false; - } - break; - case KC_CAPS: - isBarking = record->event.pressed; - break; - - /* KEYBOARD PET STATUS END */ -} - -return true; -} diff --git a/keyboards/crkbd/keymaps/colemak_luna/readme.md b/keyboards/crkbd/keymaps/colemak_luna/readme.md deleted file mode 100644 index 0f729e702ce..00000000000 --- a/keyboards/crkbd/keymaps/colemak_luna/readme.md +++ /dev/null @@ -1,17 +0,0 @@ -# Personal keymap for the CRKBD -My own keymap with some custom OLED features, Colemak base layer and gaming layers. The F13 key on multiple layers can be bound to something, I use it as toggle mute microphone on Discord. -## Layers -- Colemak - Default layer -- Lower - Has numbers and arrows -- Raise - Has symbols -- Game1 - A QWERTY Gaming layer -- Game2 - An alternate lower layer when Game1 is active, has numbers and other keys that may be needed -- Adjust - Has F-keys and settings, allows to set the Game1 as base layer. -## Custom OLED -- Left side: - - Layer indicator - - Keyboard pet Luna from @HellSingCoder -- Right side - - Unicursal hexagram pixel art logo - - WPM counter - diff --git a/keyboards/crkbd/keymaps/colemak_luna/rules.mk b/keyboards/crkbd/keymaps/colemak_luna/rules.mk deleted file mode 100644 index 9ff3128931a..00000000000 --- a/keyboards/crkbd/keymaps/colemak_luna/rules.mk +++ /dev/null @@ -1,7 +0,0 @@ -MOUSEKEY_ENABLE = no # Mouse keys -RGBLIGHT_ENABLE = no -RGB_MATRIX_ENABLE = yes # Enable WS2812 RGB underlight. -VIA_ENABLE = yes # Enable VIA -OLED_ENABLE = yes -LTO_ENABLE = yes -WPM_ENABLE = yes From e3ef5b2d9d3e9d97f86b0da42d1a2e2bd2ae194b Mon Sep 17 00:00:00 2001 From: tarxvf Date: Thu, 11 Jul 2024 08:46:54 -0400 Subject: [PATCH 054/204] mntre_v3: fix matrix bottom row (#24077) --- keyboards/mntre_v3/keyboard.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/mntre_v3/keyboard.json b/keyboards/mntre_v3/keyboard.json index d9cee6aede8..e00fe1deb28 100644 --- a/keyboards/mntre_v3/keyboard.json +++ b/keyboards/mntre_v3/keyboard.json @@ -108,12 +108,12 @@ {"matrix": [5, 2], "x": 2.75, "y": 5, "w": 1.5}, {"matrix": [5, 3], "x": 4.25, "y": 5, "w": 1.5}, {"matrix": [5, 4], "x": 5.75, "y": 5,"w": 2}, - {"matrix": [5, 5], "x": 7.75, "y": 5,"w": 1.5}, - {"matrix": [5, 6], "x": 9.25, "y": 5}, - {"matrix": [5, 7], "x": 10.25, "y": 5}, - {"matrix": [5, 8], "x": 11.25, "y": 5}, - {"matrix": [5, 9], "x": 12.25, "y": 5}, - {"matrix": [5, 10], "x": 13.25, "y": 5,"w": 1.25} + {"matrix": [5, 6], "x": 7.75, "y": 5,"w": 1.5}, + {"matrix": [5, 7], "x": 9.25, "y": 5}, + {"matrix": [5, 8], "x": 10.25, "y": 5}, + {"matrix": [5, 9], "x": 11.25, "y": 5}, + {"matrix": [5, 10], "x": 12.25, "y": 5}, + {"matrix": [5, 11], "x": 13.25, "y": 5,"w": 1.25} ] } } From e0809eade5b054035a2bc0d00b1a8e9a02ba0d19 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Thu, 11 Jul 2024 13:47:53 +0100 Subject: [PATCH 055/204] Various fixes for keyboards not implementing callbacks correctly (#24092) --- keyboards/aeboards/ext65/rev3/rev3.c | 4 +++- keyboards/clueboard/2x1800/2021/2021.c | 2 ++ .../commissions/mini1800/mini1800.c | 18 +++++++++++------- keyboards/exclusive/e6_rgb/e6_rgb.c | 4 ++++ keyboards/handwired/selene/selene.c | 4 +++- keyboards/inett_studio/sqx/hotswap/hotswap.c | 4 ++++ .../inett_studio/sqx/universal/universal.c | 4 ++++ .../mechlovin/adelais/rgb_led/rev2/rev2.c | 4 ++++ keyboards/mechlovin/hannah60rgb/rev2/rev2.c | 4 ++++ keyboards/mechlovin/kay65/kay65.c | 6 +++--- .../zed65/no_backlight/wearhaus66/wearhaus66.c | 5 +++-- keyboards/omnikeyish/omnikeyish.c | 8 ++++++-- keyboards/projectd/75/ansi/ansi.c | 3 +++ keyboards/yandrstudio/nz64/nz64.c | 4 ++++ 14 files changed, 58 insertions(+), 16 deletions(-) diff --git a/keyboards/aeboards/ext65/rev3/rev3.c b/keyboards/aeboards/ext65/rev3/rev3.c index f8fc2ef5023..7b0f2018c2c 100644 --- a/keyboards/aeboards/ext65/rev3/rev3.c +++ b/keyboards/aeboards/ext65/rev3/rev3.c @@ -19,10 +19,12 @@ // Tested and verified working on EXT65 Rev3 void matrix_io_delay(void) { __asm__ volatile("nop\nnop\nnop\n"); } -void keyboard_pre_init_user(void) { +void keyboard_pre_init_kb(void) { // Call the keyboard pre init code. // Set our LED pins as output gpio_set_pin_output(LED_LAYERS_PIN); + + keyboard_pre_init_user(); } layer_state_t layer_state_set_kb(layer_state_t state) { diff --git a/keyboards/clueboard/2x1800/2021/2021.c b/keyboards/clueboard/2x1800/2021/2021.c index e575a7544cb..5274f76e9c2 100644 --- a/keyboards/clueboard/2x1800/2021/2021.c +++ b/keyboards/clueboard/2x1800/2021/2021.c @@ -26,6 +26,8 @@ void matrix_scan_kb(void) { max7219_message_sign_task(true); led_frame_timer = timer_read(); } + + matrix_scan_user(); } #endif diff --git a/keyboards/enviousdesign/commissions/mini1800/mini1800.c b/keyboards/enviousdesign/commissions/mini1800/mini1800.c index 86757dab8af..4f4be779ca7 100644 --- a/keyboards/enviousdesign/commissions/mini1800/mini1800.c +++ b/keyboards/enviousdesign/commissions/mini1800/mini1800.c @@ -1,23 +1,27 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ +// SPDX-License-Identifier: GPL-2.0-or-later #include "quantum.h" -void matrix_init_user(void) { +void matrix_init_kb(void) { gpio_set_pin_output(GP9); //init gpio gpio_write_pin_low(GP9); gpio_set_pin_output(GP11); //init and turn off inverted power led gpio_write_pin_high(GP11); + + matrix_init_user(); } //layer, capslock and numlock -layer_state_t layer_state_set_user(layer_state_t state) { +__attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) { gpio_write_pin(GP9, layer_state_cmp(state, 1)); - return state; + return state; } -bool led_update_user(led_t led_state) { +bool led_update_kb(led_t led_state) { + bool res = led_update_user(led_state); + if(res) { led_state.num_lock = !led_state.num_lock; led_update_ports(led_state); - return false; + } + return res; } - diff --git a/keyboards/exclusive/e6_rgb/e6_rgb.c b/keyboards/exclusive/e6_rgb/e6_rgb.c index 19dd96a073d..9a7856306bb 100644 --- a/keyboards/exclusive/e6_rgb/e6_rgb.c +++ b/keyboards/exclusive/e6_rgb/e6_rgb.c @@ -168,6 +168,10 @@ led_config_t g_led_config = { { #endif bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + if (!process_record_user(keycode, record)) { + return false; + } + if (record->event.pressed) { switch(keycode) { #if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE) diff --git a/keyboards/handwired/selene/selene.c b/keyboards/handwired/selene/selene.c index 3d0ef667cf1..49df43314b3 100644 --- a/keyboards/handwired/selene/selene.c +++ b/keyboards/handwired/selene/selene.c @@ -17,6 +17,8 @@ #include "quantum.h" -void keyboard_post_init_user(void) { +void keyboard_post_init_kb(void) { rgblight_setrgb(0xff, 0xff, 0xff); + + keyboard_post_init_user(); } diff --git a/keyboards/inett_studio/sqx/hotswap/hotswap.c b/keyboards/inett_studio/sqx/hotswap/hotswap.c index 079889e7274..c04d7ef02cc 100644 --- a/keyboards/inett_studio/sqx/hotswap/hotswap.c +++ b/keyboards/inett_studio/sqx/hotswap/hotswap.c @@ -165,6 +165,10 @@ bool rgb_matrix_indicators_kb(void) { #endif //RGB_MATRIX_ENABLE bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + if (!process_record_user(keycode, record)) { + return false; + } + if (record->event.pressed) { switch(keycode) { #if defined(RGB_MATRIX_DISABLE_KEYCODES) diff --git a/keyboards/inett_studio/sqx/universal/universal.c b/keyboards/inett_studio/sqx/universal/universal.c index 519df575055..6c2af3a3b99 100644 --- a/keyboards/inett_studio/sqx/universal/universal.c +++ b/keyboards/inett_studio/sqx/universal/universal.c @@ -169,6 +169,10 @@ bool rgb_matrix_indicators_kb(void) { #endif //RGB_MATRIX_ENABLE bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + if (!process_record_user(keycode, record)) { + return false; + } + if (record->event.pressed) { switch(keycode) { #if defined(RGB_MATRIX_DISABLE_KEYCODES) diff --git a/keyboards/mechlovin/adelais/rgb_led/rev2/rev2.c b/keyboards/mechlovin/adelais/rgb_led/rev2/rev2.c index d49d16e85a1..cc3853cacd1 100644 --- a/keyboards/mechlovin/adelais/rgb_led/rev2/rev2.c +++ b/keyboards/mechlovin/adelais/rgb_led/rev2/rev2.c @@ -131,6 +131,10 @@ bool rgb_matrix_indicators_kb(void) { #endif bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + if (!process_record_user(keycode, record)) { + return false; + } + if (record->event.pressed) { switch(keycode) { #ifdef RGBLIGHT_ENABLE diff --git a/keyboards/mechlovin/hannah60rgb/rev2/rev2.c b/keyboards/mechlovin/hannah60rgb/rev2/rev2.c index c6943cc3578..3fdc5713801 100644 --- a/keyboards/mechlovin/hannah60rgb/rev2/rev2.c +++ b/keyboards/mechlovin/hannah60rgb/rev2/rev2.c @@ -223,6 +223,10 @@ layer_state_t layer_state_set_user(layer_state_t state) { #endif bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + if (!process_record_user(keycode, record)) { + return false; + } + if (record->event.pressed) { switch(keycode) { #ifdef RGB_MATRIX_DISABLE_KEYCODES diff --git a/keyboards/mechlovin/kay65/kay65.c b/keyboards/mechlovin/kay65/kay65.c index f59f23e13d9..b125cf1f798 100644 --- a/keyboards/mechlovin/kay65/kay65.c +++ b/keyboards/mechlovin/kay65/kay65.c @@ -17,9 +17,9 @@ along with this program. If not, see . #include "quantum.h" -void keyboard_pre_init_user(void) { - // Call the keyboard pre init code. - +void keyboard_pre_init_kb(void) { // Set our LED pins as output gpio_set_pin_output(D7); + + keyboard_pre_init_user(); } diff --git a/keyboards/mechlovin/zed65/no_backlight/wearhaus66/wearhaus66.c b/keyboards/mechlovin/zed65/no_backlight/wearhaus66/wearhaus66.c index a6942a2cb82..de1c73a0e03 100644 --- a/keyboards/mechlovin/zed65/no_backlight/wearhaus66/wearhaus66.c +++ b/keyboards/mechlovin/zed65/no_backlight/wearhaus66/wearhaus66.c @@ -17,8 +17,9 @@ along with this program. If not, see . #include "quantum.h" -void keyboard_pre_init_user(void) { - // Call the keyboard pre init code. +void keyboard_pre_init_kb(void) { // Set our LED pins as output gpio_set_pin_output(B7); + + keyboard_pre_init_user(); } diff --git a/keyboards/omnikeyish/omnikeyish.c b/keyboards/omnikeyish/omnikeyish.c index 4a8a7fa4d6c..8e7e316524e 100644 --- a/keyboards/omnikeyish/omnikeyish.c +++ b/keyboards/omnikeyish/omnikeyish.c @@ -1,10 +1,12 @@ #include "omnikeyish.h" -void keyboard_pre_init_user(void) { +void keyboard_pre_init_kb(void) { dynamic_macro_init(); + + keyboard_pre_init_user(); } -void keyboard_post_init_user(void) { +void keyboard_post_init_kb(void) { /* Customise these values to desired behaviour */ //debug_enable = true; //debug_matrix=true; @@ -19,6 +21,8 @@ void keyboard_post_init_user(void) { /* Send numlock keycode to attempt to force numlock back on. */ register_code(KC_NUM_LOCK); unregister_code(KC_NUM_LOCK); + + keyboard_post_init_user(); } bool process_record_user(uint16_t keycode, keyrecord_t *record) { diff --git a/keyboards/projectd/75/ansi/ansi.c b/keyboards/projectd/75/ansi/ansi.c index 8257cf39c26..3bb695b5590 100644 --- a/keyboards/projectd/75/ansi/ansi.c +++ b/keyboards/projectd/75/ansi/ansi.c @@ -162,6 +162,9 @@ bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) { } bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + if (!process_record_user(keycode, record)) { + return false; + } switch (keycode) { diff --git a/keyboards/yandrstudio/nz64/nz64.c b/keyboards/yandrstudio/nz64/nz64.c index 66ba9fb6ee0..928b0b5114f 100644 --- a/keyboards/yandrstudio/nz64/nz64.c +++ b/keyboards/yandrstudio/nz64/nz64.c @@ -97,6 +97,10 @@ void keyboard_post_init_kb(void) { #endif bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + if (!process_record_user(keycode, record)) { + return false; + } + switch(keycode) { #ifdef RGB_MATRIX_ENABLE case URGB_K: From 3d10171e2ced2923568d197a5a5f53d8d9355243 Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 11 Jul 2024 22:49:45 +1000 Subject: [PATCH 056/204] `mt/mt84`: move RGB Matrix config to data driven (#24090) --- keyboards/mt/mt84/config.h | 2 - keyboards/mt/mt84/keyboard.json | 91 +++++++++++++++++++++++++++++++++ keyboards/mt/mt84/mt84.c | 23 --------- 3 files changed, 91 insertions(+), 25 deletions(-) diff --git a/keyboards/mt/mt84/config.h b/keyboards/mt/mt84/config.h index 9b115d527d5..e2b30400a93 100644 --- a/keyboards/mt/mt84/config.h +++ b/keyboards/mt/mt84/config.h @@ -18,8 +18,6 @@ #define IS31FL3737_I2C_ADDRESS_1 IS31FL3737_I2C_ADDRESS_GND #define IS31FL3737_I2C_ADDRESS_2 IS31FL3737_I2C_ADDRESS_VCC -#define RGB_MATRIX_LED_COUNT 84 - /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ diff --git a/keyboards/mt/mt84/keyboard.json b/keyboards/mt/mt84/keyboard.json index 8833f77ed98..fd03c2cf71f 100644 --- a/keyboards/mt/mt84/keyboard.json +++ b/keyboards/mt/mt84/keyboard.json @@ -57,6 +57,97 @@ "animation": "cycle_all" }, "driver": "is31fl3737", + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0, "flags": 1}, + {"matrix": [0, 1], "x": 15, "y": 0, "flags": 1}, + {"matrix": [0, 2], "x": 30, "y": 0, "flags": 1}, + {"matrix": [0, 3], "x": 45, "y": 0, "flags": 1}, + {"matrix": [0, 4], "x": 60, "y": 0, "flags": 1}, + {"matrix": [0, 5], "x": 75, "y": 0, "flags": 1}, + {"matrix": [0, 6], "x": 90, "y": 0, "flags": 1}, + {"matrix": [0, 7], "x": 105, "y": 0, "flags": 1}, + {"matrix": [0, 8], "x": 119, "y": 0, "flags": 1}, + {"matrix": [0, 9], "x": 134, "y": 0, "flags": 1}, + {"matrix": [0, 10], "x": 149, "y": 0, "flags": 1}, + {"matrix": [0, 11], "x": 164, "y": 0, "flags": 1}, + {"matrix": [0, 12], "x": 179, "y": 0, "flags": 1}, + {"matrix": [0, 13], "x": 194, "y": 0, "flags": 1}, + {"matrix": [0, 14], "x": 209, "y": 0, "flags": 1}, + {"matrix": [4, 14], "x": 224, "y": 0, "flags": 1}, + + {"matrix": [1, 0], "x": 0, "y": 13, "flags": 1}, + {"matrix": [1, 1], "x": 15, "y": 13, "flags": 4}, + {"matrix": [1, 2], "x": 30, "y": 13, "flags": 4}, + {"matrix": [1, 3], "x": 45, "y": 13, "flags": 4}, + {"matrix": [1, 4], "x": 60, "y": 13, "flags": 4}, + {"matrix": [1, 5], "x": 75, "y": 13, "flags": 4}, + {"matrix": [1, 6], "x": 90, "y": 13, "flags": 4}, + {"matrix": [1, 7], "x": 105, "y": 13, "flags": 4}, + {"matrix": [1, 8], "x": 119, "y": 13, "flags": 4}, + {"matrix": [1, 9], "x": 134, "y": 13, "flags": 4}, + {"matrix": [1, 10], "x": 149, "y": 13, "flags": 4}, + {"matrix": [1, 11], "x": 164, "y": 13, "flags": 4}, + {"matrix": [1, 12], "x": 179, "y": 13, "flags": 4}, + {"matrix": [1, 13], "x": 202, "y": 13, "flags": 4}, + {"matrix": [1, 14], "x": 224, "y": 13, "flags": 1}, + + {"matrix": [2, 0], "x": 4, "y": 26, "flags": 1}, + {"matrix": [2, 1], "x": 22, "y": 26, "flags": 4}, + {"matrix": [2, 2], "x": 37, "y": 26, "flags": 4}, + {"matrix": [2, 3], "x": 52, "y": 26, "flags": 4}, + {"matrix": [2, 4], "x": 67, "y": 26, "flags": 4}, + {"matrix": [2, 5], "x": 82, "y": 26, "flags": 4}, + {"matrix": [2, 6], "x": 97, "y": 26, "flags": 4}, + {"matrix": [2, 7], "x": 112, "y": 26, "flags": 4}, + {"matrix": [2, 8], "x": 127, "y": 26, "flags": 4}, + {"matrix": [2, 9], "x": 142, "y": 26, "flags": 4}, + {"matrix": [2, 10], "x": 157, "y": 26, "flags": 4}, + {"matrix": [2, 11], "x": 172, "y": 26, "flags": 4}, + {"matrix": [2, 12], "x": 187, "y": 26, "flags": 4}, + {"matrix": [2, 13], "x": 205, "y": 26, "flags": 4}, + {"matrix": [2, 14], "x": 224, "y": 26, "flags": 1}, + + {"matrix": [3, 0], "x": 6, "y": 38, "flags": 1}, + {"matrix": [3, 1], "x": 26, "y": 38, "flags": 4}, + {"matrix": [3, 2], "x": 41, "y": 38, "flags": 4}, + {"matrix": [3, 3], "x": 56, "y": 38, "flags": 4}, + {"matrix": [3, 4], "x": 71, "y": 38, "flags": 4}, + {"matrix": [3, 5], "x": 86, "y": 38, "flags": 4}, + {"matrix": [3, 6], "x": 101, "y": 38, "flags": 4}, + {"matrix": [3, 7], "x": 116, "y": 38, "flags": 4}, + {"matrix": [3, 8], "x": 131, "y": 38, "flags": 4}, + {"matrix": [3, 9], "x": 146, "y": 38, "flags": 4}, + {"matrix": [3, 10], "x": 161, "y": 38, "flags": 4}, + {"matrix": [3, 11], "x": 175, "y": 38, "flags": 4}, + {"matrix": [3, 12], "x": 200, "y": 38, "flags": 4}, + {"matrix": [3, 14], "x": 224, "y": 38, "flags": 1}, + + {"matrix": [4, 0], "x": 9, "y": 51, "flags": 1}, + {"matrix": [4, 1], "x": 34, "y": 51, "flags": 4}, + {"matrix": [4, 2], "x": 49, "y": 51, "flags": 4}, + {"matrix": [4, 3], "x": 63, "y": 51, "flags": 4}, + {"matrix": [4, 4], "x": 78, "y": 51, "flags": 4}, + {"matrix": [4, 5], "x": 93, "y": 51, "flags": 4}, + {"matrix": [4, 6], "x": 108, "y": 51, "flags": 4}, + {"matrix": [4, 7], "x": 123, "y": 51, "flags": 4}, + {"matrix": [4, 8], "x": 138, "y": 51, "flags": 4}, + {"matrix": [4, 9], "x": 153, "y": 51, "flags": 4}, + {"matrix": [4, 10], "x": 168, "y": 51, "flags": 4}, + {"matrix": [4, 11], "x": 189, "y": 51, "flags": 4}, + {"matrix": [4, 12], "x": 209, "y": 51, "flags": 4}, + {"matrix": [4, 13], "x": 224, "y": 51, "flags": 1}, + + {"matrix": [5, 0], "x": 2, "y": 64, "flags": 1}, + {"matrix": [5, 1], "x": 21, "y": 64, "flags": 1}, + {"matrix": [5, 2], "x": 39, "y": 64, "flags": 1}, + {"matrix": [5, 5], "x": 95, "y": 64, "flags": 4}, + {"matrix": [5, 9], "x": 149, "y": 64, "flags": 1}, + {"matrix": [5, 10], "x": 164, "y": 64, "flags": 1}, + {"matrix": [5, 11], "x": 179, "y": 64, "flags": 1}, + {"matrix": [5, 12], "x": 194, "y": 64, "flags": 4}, + {"matrix": [5, 13], "x": 209, "y": 64, "flags": 4}, + {"matrix": [5, 14], "x": 224, "y": 64, "flags": 4} + ], "led_flush_limit": 26, "led_process_limit": 20, "max_brightness": 200 diff --git a/keyboards/mt/mt84/mt84.c b/keyboards/mt/mt84/mt84.c index 276c92fc065..1ac61e87c02 100644 --- a/keyboards/mt/mt84/mt84.c +++ b/keyboards/mt/mt84/mt84.c @@ -114,27 +114,4 @@ const is31fl3737_led_t PROGMEM g_is31fl3737_leds[IS31FL3737_LED_COUNT] = { {1, SW4_CS10, SW5_CS10, SW6_CS10}, {1, SW7_CS10, SW8_CS10, SW9_CS10} }; - -led_config_t g_led_config = {{ - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, - { 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 }, - { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44 }, - { 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58 }, - { 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73 }, - {74, 75, 76, 77, 78, 79, 80, 81, 82, 83 } -}, { - { 0, 0 }, { 15, 0 }, { 30, 0 }, { 45, 0 }, { 60, 0 }, { 75, 0 }, { 90, 0 }, { 105, 0 }, { 120, 0 }, { 135, 0 }, { 150, 0 }, { 165, 0 }, { 180, 0 }, { 195, 0 }, { 210, 0 }, { 224, 0 }, - { 0, 13 }, { 15, 13 }, { 30, 13 }, { 45, 13 }, { 60, 13 }, { 75, 13 }, { 90, 13 }, { 105, 13 }, { 120, 13 }, { 135, 13 }, { 150, 13 }, { 165, 13 }, { 180, 13 }, { 205, 13 }, { 224, 13 }, - { 3, 26 }, { 18, 26 }, { 33, 26 }, { 48, 26 }, { 63, 26 }, { 78, 26 }, { 93, 26 }, { 108, 26 }, { 123, 26 }, { 138, 26 }, { 153, 26 }, { 168, 26 }, { 183, 26 }, { 205, 26 },{ 224, 26 }, - { 6, 39 }, { 20, 39 }, { 36, 39 }, { 52, 39 }, { 68, 39 }, { 84, 39 }, { 100, 39 }, { 116, 39 }, { 132, 39 }, { 148, 39 }, { 164, 39 }, { 180, 39 }, { 212, 39 }, { 224, 39 }, - { 9, 52 }, { 27, 52 }, { 43, 52 }, { 59, 52 }, { 75, 52 }, { 91, 52 }, { 107, 52 }, { 123, 52 }, { 139, 52 }, { 155, 52 }, { 171, 52 }, { 187, 52 }, { 212, 52 }, { 224, 52 }, -{ 2, 64 }, { 18, 64 }, { 33, 64 }, { 93, 64 }, { 150, 64 }, { 165, 64 }, { 180, 64 }, { 195, 64 }, { 210, 64 }, { 224, 64 } -}, { - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, - 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, - 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, - 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, - 1, 1, 1, 4, 1, 1, 1, 4, 4, 4, -}}; #endif From 9be6d76c61f5b760e7ceaf03fe80da3f07a29d8a Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 11 Jul 2024 22:50:26 +1000 Subject: [PATCH 057/204] `mt/mt64rgb`: move RGB Matrix config to data driven (#24089) --- keyboards/mt/mt64rgb/config.h | 2 - keyboards/mt/mt64rgb/keyboard.json | 70 +++++++++++++++++++ keyboards/mt/mt64rgb/keymaps/default/keymap.c | 3 - keyboards/mt/mt64rgb/keymaps/via/keymap.c | 3 - keyboards/mt/mt64rgb/mt64rgb.c | 20 ------ 5 files changed, 70 insertions(+), 28 deletions(-) diff --git a/keyboards/mt/mt64rgb/config.h b/keyboards/mt/mt64rgb/config.h index f69c778b8b6..ad034ceec8d 100644 --- a/keyboards/mt/mt64rgb/config.h +++ b/keyboards/mt/mt64rgb/config.h @@ -16,5 +16,3 @@ #pragma once #define IS31FL3733_I2C_ADDRESS_1 IS31FL3733_I2C_ADDRESS_GND_GND - -#define RGB_MATRIX_LED_COUNT 64 diff --git a/keyboards/mt/mt64rgb/keyboard.json b/keyboards/mt/mt64rgb/keyboard.json index 0858e85ecae..451be59f8f5 100644 --- a/keyboards/mt/mt64rgb/keyboard.json +++ b/keyboards/mt/mt64rgb/keyboard.json @@ -60,6 +60,76 @@ "solid_multisplash": true }, "driver": "is31fl3733", + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0, "flags": 1}, + {"matrix": [0, 1], "x": 16, "y": 0, "flags": 4}, + {"matrix": [0, 2], "x": 32, "y": 0, "flags": 4}, + {"matrix": [0, 3], "x": 48, "y": 0, "flags": 4}, + {"matrix": [0, 4], "x": 64, "y": 0, "flags": 4}, + {"matrix": [0, 5], "x": 80, "y": 0, "flags": 4}, + {"matrix": [0, 6], "x": 96, "y": 0, "flags": 4}, + {"matrix": [0, 7], "x": 112, "y": 0, "flags": 4}, + {"matrix": [0, 8], "x": 128, "y": 0, "flags": 4}, + {"matrix": [0, 9], "x": 144, "y": 0, "flags": 4}, + {"matrix": [0, 10], "x": 160, "y": 0, "flags": 4}, + {"matrix": [0, 11], "x": 176, "y": 0, "flags": 4}, + {"matrix": [0, 12], "x": 192, "y": 0, "flags": 4}, + {"matrix": [0, 13], "x": 216, "y": 0, "flags": 1}, + + {"matrix": [1, 0], "x": 4, "y": 16, "flags": 1}, + {"matrix": [1, 1], "x": 24, "y": 16, "flags": 4}, + {"matrix": [1, 2], "x": 40, "y": 16, "flags": 4}, + {"matrix": [1, 3], "x": 56, "y": 16, "flags": 4}, + {"matrix": [1, 4], "x": 72, "y": 16, "flags": 4}, + {"matrix": [1, 5], "x": 88, "y": 16, "flags": 4}, + {"matrix": [1, 6], "x": 104, "y": 16, "flags": 4}, + {"matrix": [1, 7], "x": 120, "y": 16, "flags": 4}, + {"matrix": [1, 8], "x": 136, "y": 16, "flags": 4}, + {"matrix": [1, 9], "x": 152, "y": 16, "flags": 4}, + {"matrix": [1, 10], "x": 168, "y": 16, "flags": 4}, + {"matrix": [1, 11], "x": 184, "y": 16, "flags": 4}, + {"matrix": [1, 12], "x": 200, "y": 16, "flags": 4}, + {"matrix": [1, 13], "x": 220, "y": 16, "flags": 1}, + + {"matrix": [2, 0], "x": 6, "y": 32, "flags": 1}, + {"matrix": [2, 1], "x": 28, "y": 32, "flags": 4}, + {"matrix": [2, 2], "x": 44, "y": 32, "flags": 4}, + {"matrix": [2, 3], "x": 60, "y": 32, "flags": 4}, + {"matrix": [2, 4], "x": 76, "y": 32, "flags": 4}, + {"matrix": [2, 5], "x": 92, "y": 32, "flags": 4}, + {"matrix": [2, 6], "x": 108, "y": 32, "flags": 4}, + {"matrix": [2, 7], "x": 124, "y": 32, "flags": 4}, + {"matrix": [2, 8], "x": 140, "y": 32, "flags": 4}, + {"matrix": [2, 9], "x": 156, "y": 32, "flags": 4}, + {"matrix": [2, 10], "x": 172, "y": 32, "flags": 4}, + {"matrix": [2, 11], "x": 188, "y": 32, "flags": 4}, + {"matrix": [2, 12], "x": 214, "y": 32, "flags": 1}, + + {"matrix": [3, 0], "x": 8, "y": 48, "flags": 1}, + {"matrix": [3, 1], "x": 32, "y": 48, "flags": 4}, + {"matrix": [3, 2], "x": 48, "y": 48, "flags": 4}, + {"matrix": [3, 3], "x": 64, "y": 48, "flags": 4}, + {"matrix": [3, 4], "x": 80, "y": 48, "flags": 4}, + {"matrix": [3, 5], "x": 96, "y": 48, "flags": 4}, + {"matrix": [3, 6], "x": 112, "y": 48, "flags": 4}, + {"matrix": [3, 7], "x": 128, "y": 48, "flags": 4}, + {"matrix": [3, 8], "x": 144, "y": 48, "flags": 4}, + {"matrix": [3, 9], "x": 160, "y": 48, "flags": 4}, + {"matrix": [3, 10], "x": 176, "y": 48, "flags": 4}, + {"matrix": [3, 11], "x": 192, "y": 48, "flags": 4}, + {"matrix": [3, 12], "x": 208, "y": 48, "flags": 4}, + {"matrix": [3, 13], "x": 224, "y": 48, "flags": 1}, + + {"matrix": [4, 0], "x": 2, "y": 64, "flags": 1}, + {"matrix": [4, 1], "x": 22, "y": 64, "flags": 1}, + {"matrix": [4, 2], "x": 42, "y": 64, "flags": 1}, + {"matrix": [4, 5], "x": 102, "y": 64, "flags": 4}, + {"matrix": [4, 9], "x": 160, "y": 64, "flags": 1}, + {"matrix": [4, 10], "x": 176, "y": 64, "flags": 1}, + {"matrix": [4, 11], "x": 192, "y": 64, "flags": 4}, + {"matrix": [4, 12], "x": 208, "y": 64, "flags": 4}, + {"matrix": [4, 13], "x": 224, "y": 64, "flags": 4} + ], "led_flush_limit": 26, "led_process_limit": 20, "max_brightness": 160 diff --git a/keyboards/mt/mt64rgb/keymaps/default/keymap.c b/keyboards/mt/mt64rgb/keymaps/default/keymap.c index 7cff3be34c8..6c0d1a83fd7 100644 --- a/keyboards/mt/mt64rgb/keymaps/default/keymap.c +++ b/keyboards/mt/mt64rgb/keymaps/default/keymap.c @@ -37,9 +37,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; bool rgb_matrix_indicators_user(void) { - if (layer_state_is(1)) { - rgb_matrix_set_color(77,0xFF, 0x80, 0x00); - } if (host_keyboard_led_state().caps_lock) { rgb_matrix_set_color(28, 0xFF, 0xFF, 0xFF); } diff --git a/keyboards/mt/mt64rgb/keymaps/via/keymap.c b/keyboards/mt/mt64rgb/keymaps/via/keymap.c index df4884a3a35..7340b89ebbb 100644 --- a/keyboards/mt/mt64rgb/keymaps/via/keymap.c +++ b/keyboards/mt/mt64rgb/keymaps/via/keymap.c @@ -34,9 +34,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; bool rgb_matrix_indicators_user(void) { - if (layer_state_is(1)) { - rgb_matrix_set_color(77,0xFF, 0x80, 0x00); - } if (host_keyboard_led_state().caps_lock) { rgb_matrix_set_color(28, 0xFF, 0xFF, 0xFF); } diff --git a/keyboards/mt/mt64rgb/mt64rgb.c b/keyboards/mt/mt64rgb/mt64rgb.c index bcf26de2313..d08d87de46d 100644 --- a/keyboards/mt/mt64rgb/mt64rgb.c +++ b/keyboards/mt/mt64rgb/mt64rgb.c @@ -93,24 +93,4 @@ const is31fl3733_led_t PROGMEM g_is31fl3733_leds[IS31FL3733_LED_COUNT] = { {0, SW10_CS10, SW11_CS10, SW12_CS10}, {0, SW10_CS15, SW11_CS15, SW12_CS15} }; - -led_config_t g_led_config = {{ - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 }, - { 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27 }, - { 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40}, - { 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54 }, - { 55, 56, 57, 58, 59, 60, 61, 62, 63} -}, { - { 0, 0 }, { 16, 0 }, { 32, 0 }, { 48, 0 }, { 64, 0 }, { 80, 0 }, { 96, 0 }, { 112, 0 }, { 128, 0 }, { 144, 0 }, { 160, 0 }, { 176, 0 }, { 192, 0 }, { 216, 0 }, - { 4, 16 }, { 18, 16 }, { 34, 16 }, { 50, 16 }, { 66, 16 }, { 82, 16 }, { 98, 16 }, { 114, 16 }, { 130, 16 }, { 146, 16 }, { 162, 16 }, { 178, 16 }, { 194, 16 }, { 220, 16 }, - { 6, 32 }, { 20, 32 }, { 36, 32 }, { 52, 32 }, { 68, 32 }, { 84, 32 }, { 100, 32 }, { 116, 32 }, { 132, 32 }, { 148, 32 }, { 164, 32 }, { 180, 32 }, { 212, 32 }, - { 9, 48 }, { 27, 48 }, { 43, 48 }, { 59, 48 }, { 75, 48 }, { 91, 48 }, { 107, 48 }, { 123, 48 }, { 139, 48 }, { 155, 48 }, { 171, 48 }, { 187, 48 }, { 203, 48 }, { 219, 48 }, - { 2, 64 }, { 16, 64 }, { 32, 64 }, { 64, 64 }, { 114, 64 }, { 130, 64 }, { 146, 64 }, { 204, 64 }, { 224, 64 } -}, { - 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, - 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, - 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, - 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, - 1, 1, 1, 4, 1, 1, 4, 4, 4, -}}; #endif From 0c4fd514f1146224c8407591a5e42a0db456b536 Mon Sep 17 00:00:00 2001 From: 4pplet Date: Thu, 11 Jul 2024 14:51:43 +0200 Subject: [PATCH 058/204] Adding support for IBE60 (#24075) --- keyboards/4pplet/ibe60/keyboard.json | 94 +++++++++++++++++++ .../4pplet/ibe60/keymaps/default/keymap.c | 34 +++++++ keyboards/4pplet/ibe60/keymaps/via/keymap.c | 35 +++++++ keyboards/4pplet/ibe60/keymaps/via/rules.mk | 1 + keyboards/4pplet/ibe60/readme.md | 24 +++++ keyboards/4pplet/ibe60/rules.mk | 2 + 6 files changed, 190 insertions(+) create mode 100644 keyboards/4pplet/ibe60/keyboard.json create mode 100644 keyboards/4pplet/ibe60/keymaps/default/keymap.c create mode 100644 keyboards/4pplet/ibe60/keymaps/via/keymap.c create mode 100644 keyboards/4pplet/ibe60/keymaps/via/rules.mk create mode 100644 keyboards/4pplet/ibe60/readme.md create mode 100644 keyboards/4pplet/ibe60/rules.mk diff --git a/keyboards/4pplet/ibe60/keyboard.json b/keyboards/4pplet/ibe60/keyboard.json new file mode 100644 index 00000000000..dd674c6ab98 --- /dev/null +++ b/keyboards/4pplet/ibe60/keyboard.json @@ -0,0 +1,94 @@ +{ + "manufacturer": "4pplet", + "keyboard_name": "IBE60 Rev A", + "maintainer": "4pplet", + "bootloader": "stm32-dfu", + "diode_direction": "COL2ROW", + "features": { + "bootmagic": true, + "extrakey": true, + "key_lock": true, + "mousekey": true, + "nkro": true + }, + "matrix_pins": { + "cols": ["B2", "A5", "A4", "A3", "F1", "F0", "C15", "C14", "C13", "B9", "B8", "B7", "A15", "B3"], + "rows": ["B14", "A9", "B6", "B5", "B4"] + }, + "processor": "STM32F072", + "usb": { + "device_version": "0.0.1", + "pid": "0x0001", + "vid": "0x4448" + }, + "indicators": { + "caps_lock": "A8" + }, + "community_layouts": ["60_hhkb"], + "layouts": { + "LAYOUT_60_hhkb": { + "layout": [ + {"label": "Esc", "matrix": [0, 0], "x": 0, "y": 0}, + {"label": "!", "matrix": [0, 1], "x": 1, "y": 0}, + {"label": "@", "matrix": [0, 2], "x": 2, "y": 0}, + {"label": "#", "matrix": [0, 3], "x": 3, "y": 0}, + {"label": "$", "matrix": [0, 4], "x": 4, "y": 0}, + {"label": "%", "matrix": [0, 5], "x": 5, "y": 0}, + {"label": "^", "matrix": [0, 6], "x": 6, "y": 0}, + {"label": "&", "matrix": [0, 7], "x": 7, "y": 0}, + {"label": "*", "matrix": [0, 8], "x": 8, "y": 0}, + {"label": "(", "matrix": [0, 9], "x": 9, "y": 0}, + {"label": ")", "matrix": [0, 10], "x": 10, "y": 0}, + {"label": "_", "matrix": [0, 11], "x": 11, "y": 0}, + {"label": "+", "matrix": [0, 12], "x": 12, "y": 0}, + {"label": "|", "matrix": [0, 13], "x": 13, "y": 0}, + {"label": "~", "matrix": [2, 13], "x": 14, "y": 0}, + {"label": "Tab", "matrix": [1, 0], "x": 0, "y": 1, "w": 1.5}, + {"label": "Q", "matrix": [1, 1], "x": 1.5, "y": 1}, + {"label": "W", "matrix": [1, 2], "x": 2.5, "y": 1}, + {"label": "E", "matrix": [1, 3], "x": 3.5, "y": 1}, + {"label": "R", "matrix": [1, 4], "x": 4.5, "y": 1}, + {"label": "T", "matrix": [1, 5], "x": 5.5, "y": 1}, + {"label": "Y", "matrix": [1, 6], "x": 6.5, "y": 1}, + {"label": "U", "matrix": [1, 7], "x": 7.5, "y": 1}, + {"label": "I", "matrix": [1, 8], "x": 8.5, "y": 1}, + {"label": "O", "matrix": [1, 9], "x": 9.5, "y": 1}, + {"label": "P", "matrix": [1, 10], "x": 10.5, "y": 1}, + {"label": "{", "matrix": [1, 11], "x": 11.5, "y": 1}, + {"label": "}", "matrix": [1, 12], "x": 12.5, "y": 1}, + {"label": "|", "matrix": [1, 13], "x": 13.5, "y": 1, "w": 1.5}, + {"label": "Caps Lock", "matrix": [2, 0], "x": 0, "y": 2, "w": 1.75}, + {"label": "A", "matrix": [2, 1], "x": 1.75, "y": 2}, + {"label": "S", "matrix": [2, 2], "x": 2.75, "y": 2}, + {"label": "D", "matrix": [2, 3], "x": 3.75, "y": 2}, + {"label": "F", "matrix": [2, 4], "x": 4.75, "y": 2}, + {"label": "G", "matrix": [2, 5], "x": 5.75, "y": 2}, + {"label": "H", "matrix": [2, 6], "x": 6.75, "y": 2}, + {"label": "J", "matrix": [2, 7], "x": 7.75, "y": 2}, + {"label": "K", "matrix": [2, 8], "x": 8.75, "y": 2}, + {"label": "L", "matrix": [2, 9], "x": 9.75, "y": 2}, + {"label": ":", "matrix": [2, 10], "x": 10.75, "y": 2}, + {"label": "\"", "matrix": [2, 11], "x": 11.75, "y": 2}, + {"label": "Enter", "matrix": [3, 13], "x": 12.75, "y": 2, "w": 2.25}, + {"label": "Shift", "matrix": [3, 0], "x": 0, "y": 3, "w": 2.25}, + {"label": "Z", "matrix": [3, 2], "x": 2.25, "y": 3}, + {"label": "X", "matrix": [3, 3], "x": 3.25, "y": 3}, + {"label": "C", "matrix": [3, 4], "x": 4.25, "y": 3}, + {"label": "V", "matrix": [3, 5], "x": 5.25, "y": 3}, + {"label": "B", "matrix": [3, 6], "x": 6.25, "y": 3}, + {"label": "N", "matrix": [3, 7], "x": 7.25, "y": 3}, + {"label": "M", "matrix": [3, 8], "x": 8.25, "y": 3}, + {"label": "<", "matrix": [3, 9], "x": 9.25, "y": 3}, + {"label": ">", "matrix": [3, 10], "x": 10.25, "y": 3}, + {"label": "?", "matrix": [3, 11], "x": 11.25, "y": 3}, + {"label": "Shift", "matrix": [3, 12], "x": 12.25, "y": 3, "w": 1.75}, + {"label": "Fn", "matrix": [4, 13], "x": 14, "y": 3}, + {"label": "Win", "matrix": [4, 1], "x": 1.5, "y": 4}, + {"label": "Alt", "matrix": [4, 2], "x": 2.5, "y": 4, "w": 1.5}, + {"label": "Space", "matrix": [4, 6], "x": 4, "y": 4, "w": 7}, + {"label": "Alt", "matrix": [4, 9], "x": 11, "y": 4, "w": 1.5}, + {"label": "Win", "matrix": [4, 10], "x": 12.5, "y": 4} + ] + } + } +} diff --git a/keyboards/4pplet/ibe60/keymaps/default/keymap.c b/keyboards/4pplet/ibe60/keymaps/default/keymap.c new file mode 100644 index 00000000000..9ec56d48099 --- /dev/null +++ b/keyboards/4pplet/ibe60/keymaps/default/keymap.c @@ -0,0 +1,34 @@ +/* +Copyright 2020 Stefan Sundin "4pplet" <4pplet@protonmail.com> + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +// main layer +[0] = LAYOUT_60_hhkb( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, + 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_BSPC, + 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, MO(1), + KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI), +// basic function layer +[1] = LAYOUT_60_hhkb( + QK_BOOT, 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_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; \ No newline at end of file diff --git a/keyboards/4pplet/ibe60/keymaps/via/keymap.c b/keyboards/4pplet/ibe60/keymaps/via/keymap.c new file mode 100644 index 00000000000..710b5ce8497 --- /dev/null +++ b/keyboards/4pplet/ibe60/keymaps/via/keymap.c @@ -0,0 +1,35 @@ +/* +Copyright 2020 Stefan Sundin "4pplet" <4pplet@protonmail.com> + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +// main layer +[0] = LAYOUT_60_hhkb( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, + 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_BSPC, + 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, MO(1), + KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI), +// basic function layer +[1] = LAYOUT_60_hhkb( + QK_BOOT, 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_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; + diff --git a/keyboards/4pplet/ibe60/keymaps/via/rules.mk b/keyboards/4pplet/ibe60/keymaps/via/rules.mk new file mode 100644 index 00000000000..1e5b99807cb --- /dev/null +++ b/keyboards/4pplet/ibe60/keymaps/via/rules.mk @@ -0,0 +1 @@ +VIA_ENABLE = yes diff --git a/keyboards/4pplet/ibe60/readme.md b/keyboards/4pplet/ibe60/readme.md new file mode 100644 index 00000000000..24ed159952d --- /dev/null +++ b/keyboards/4pplet/ibe60/readme.md @@ -0,0 +1,24 @@ +# IBE60 + +PCB mounted 60% PCB for the IBE60 in fixed true HHKB layout + +* Keyboard Maintainer: [Stefan Sundin](https://github.com/4pplet) +* Hardware Supported: IBE60 Solder PCB + +Make example for this keyboard (after setting up your build environment): + + make 4pplet/ibe60:default + +Flashing example for this keyboard: + + make 4pplet/ibe60: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**: Hold down the Escape key and plug in the keyboard +* **Physical reset button**: Short the reset-header (labled BL/RESET) on the back of the PCB for about 2 seconds for the keyboard to enter bootloader +* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available diff --git a/keyboards/4pplet/ibe60/rules.mk b/keyboards/4pplet/ibe60/rules.mk new file mode 100644 index 00000000000..04fe1eba2ac --- /dev/null +++ b/keyboards/4pplet/ibe60/rules.mk @@ -0,0 +1,2 @@ +# Wildcard to allow APM32 MCU +DFU_SUFFIX_ARGS = -p FFFF -v FFFF From cc62eb503d8e0b1cb1be869597a5a972ebbca5f6 Mon Sep 17 00:00:00 2001 From: jack Date: Thu, 11 Jul 2024 07:39:45 -0600 Subject: [PATCH 059/204] [Keyboard] Add boardsource/sessenta (#23823) --- keyboards/boardsource/sessanta/keyboard.json | 255 ++++++++++++++++++ .../sessanta/keymaps/default/keymap.json | 21 ++ .../sessanta/keymaps/via/keymap.json | 26 ++ keyboards/boardsource/sessanta/readme.md | 27 ++ 4 files changed, 329 insertions(+) create mode 100644 keyboards/boardsource/sessanta/keyboard.json create mode 100644 keyboards/boardsource/sessanta/keymaps/default/keymap.json create mode 100644 keyboards/boardsource/sessanta/keymaps/via/keymap.json create mode 100644 keyboards/boardsource/sessanta/readme.md diff --git a/keyboards/boardsource/sessanta/keyboard.json b/keyboards/boardsource/sessanta/keyboard.json new file mode 100644 index 00000000000..c129e3acf59 --- /dev/null +++ b/keyboards/boardsource/sessanta/keyboard.json @@ -0,0 +1,255 @@ +{ + "manufacturer": "Boardsource", + "keyboard_name": "Sessanta", + "maintainer": "waffle87", + "development_board": "promicro", + "diode_direction": "COL2ROW", + "features": { + "bootmagic": true, + "extrakey": true, + "mousekey": true, + "nkro": true, + "rgb_matrix": true + }, + "matrix_pins": { + "cols": ["F4", "F5", "F6", "F7", "B1", "B3", "B2", "B6", "D3"], + "rows": ["D1", "D0", "D4", "C6", "D7", "E6", "B4", "B5"] + }, + "rgb_matrix": { + "animations": { + "alphas_mods": true, + "band_sat": true, + "band_val": true, + "breathing": true, + "gradient_left_right": true + }, + "driver": "ws2812", + "layout": [ + {"x": 224, "y": 4, "flags": 2}, + {"x": 156, "y": 0, "flags": 2}, + {"x": 82, "y": 0, "flags": 2}, + {"x": 13, "y": 4, "flags": 2}, + {"x": 24, "y": 50, "flags": 2}, + {"x": 68, "y": 52, "flags": 2}, + {"x": 121, "y": 52, "flags": 2}, + {"x": 220, "y": 52, "flags": 2}, + {"matrix": [0, 0], "x": 0, "y": 0, "flags": 1}, + {"matrix": [0, 1], "x": 15, "y": 0, "flags": 4}, + {"matrix": [0, 2], "x": 30, "y": 0, "flags": 4}, + {"matrix": [0, 3], "x": 45, "y": 0, "flags": 4}, + {"matrix": [0, 4], "x": 60, "y": 0, "flags": 4}, + {"matrix": [0, 5], "x": 75, "y": 0, "flags": 4}, + {"matrix": [0, 6], "x": 90, "y": 0, "flags": 4}, + {"matrix": [0, 7], "x": 105, "y": 0, "flags": 4}, + {"matrix": [0, 8], "x": 119, "y": 0, "flags": 4}, + {"matrix": [1, 0], "x": 134, "y": 0, "flags": 4}, + {"matrix": [1, 1], "x": 149, "y": 0, "flags": 4}, + {"matrix": [1, 2], "x": 164, "y": 0, "flags": 4}, + {"matrix": [1, 3], "x": 179, "y": 0, "flags": 4}, + {"matrix": [1, 4], "x": 202, "y": 0, "flags": 1}, + {"matrix": [1, 5], "x": 4, "y": 16, "flags": 1}, + {"matrix": [1, 6], "x": 22, "y": 16, "flags": 4}, + {"matrix": [1, 7], "x": 37, "y": 16, "flags": 4}, + {"matrix": [1, 8], "x": 52, "y": 16, "flags": 4}, + {"matrix": [2, 0], "x": 67, "y": 16, "flags": 4}, + {"matrix": [2, 1], "x": 82, "y": 16, "flags": 4}, + {"matrix": [2, 2], "x": 97, "y": 16, "flags": 4}, + {"matrix": [2, 3], "x": 112, "y": 16, "flags": 4}, + {"matrix": [2, 4], "x": 127, "y": 16, "flags": 4}, + {"matrix": [2, 5], "x": 142, "y": 16, "flags": 4}, + {"matrix": [2, 6], "x": 157, "y": 16, "flags": 4}, + {"matrix": [2, 7], "x": 172, "y": 16, "flags": 4}, + {"matrix": [2, 8], "x": 187, "y": 16, "flags": 4}, + {"matrix": [3, 0], "x": 205, "y": 16, "flags": 1}, + {"matrix": [3, 1], "x": 6, "y": 32, "flags": 1}, + {"matrix": [3, 2], "x": 26, "y": 32, "flags": 4}, + {"matrix": [3, 3], "x": 41, "y": 32, "flags": 4}, + {"matrix": [3, 4], "x": 56, "y": 32, "flags": 4}, + {"matrix": [3, 5], "x": 71, "y": 32, "flags": 4}, + {"matrix": [3, 6], "x": 86, "y": 32, "flags": 4}, + {"matrix": [3, 7], "x": 101, "y": 32, "flags": 4}, + {"matrix": [3, 8], "x": 116, "y": 32, "flags": 4}, + {"matrix": [4, 0], "x": 131, "y": 32, "flags": 4}, + {"matrix": [4, 1], "x": 146, "y": 32, "flags": 4}, + {"matrix": [4, 2], "x": 161, "y": 32, "flags": 4}, + {"matrix": [4, 3], "x": 175, "y": 32, "flags": 4}, + {"matrix": [4, 4], "x": 200, "y": 32, "flags": 1}, + {"matrix": [4, 5], "x": 224, "y": 32, "flags": 1}, + {"matrix": [4, 6], "x": 9, "y": 48, "flags": 1}, + {"matrix": [4, 7], "x": 34, "y": 48, "flags": 4}, + {"matrix": [4, 8], "x": 49, "y": 48, "flags": 4}, + {"matrix": [5, 0], "x": 63, "y": 48, "flags": 4}, + {"matrix": [5, 1], "x": 78, "y": 48, "flags": 4}, + {"matrix": [5, 2], "x": 93, "y": 48, "flags": 4}, + {"matrix": [5, 3], "x": 108, "y": 48, "flags": 4}, + {"matrix": [5, 4], "x": 123, "y": 48, "flags": 4}, + {"matrix": [5, 5], "x": 138, "y": 48, "flags": 4}, + {"matrix": [5, 6], "x": 153, "y": 48, "flags": 4}, + {"matrix": [5, 7], "x": 168, "y": 48, "flags": 4}, + {"matrix": [5, 8], "x": 196, "y": 48, "flags": 1}, + {"matrix": [6, 0], "x": 224, "y": 48, "flags": 1}, + {"matrix": [6, 1], "x": 2, "y": 64, "flags": 1}, + {"matrix": [6, 2], "x": 21, "y": 64, "flags": 1}, + {"matrix": [6, 3], "x": 39, "y": 64, "flags": 1}, + {"matrix": [6, 4], "x": 95, "y": 64, "flags": 4}, + {"matrix": [6, 5], "x": 151, "y": 64, "flags": 1}, + {"matrix": [6, 6], "x": 170, "y": 64, "flags": 1}, + {"matrix": [6, 7], "x": 189, "y": 64, "flags": 1}, + {"matrix": [6, 8], "x": 207, "y": 64, "flags": 1}, + {"matrix": [7, 0], "x": 224, "y": 64, "flags": 1} + ], + "max_brightness": 150, + "sleep": true + }, + "url": "https://boardsource.xyz", + "usb": { + "device_version": "1.0.0", + "pid": "0x17AC", + "vid": "0x4273" + }, + "ws2812": { + "pin": "D2" + }, + "layouts": { + "LAYOUT_625_bar": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [0, 6], "x": 6, "y": 0}, + {"matrix": [0, 7], "x": 7, "y": 0}, + {"matrix": [0, 8], "x": 8, "y": 0}, + {"matrix": [1, 0], "x": 9, "y": 0}, + {"matrix": [1, 1], "x": 10, "y": 0}, + {"matrix": [1, 2], "x": 11, "y": 0}, + {"matrix": [1, 3], "x": 12, "y": 0}, + {"matrix": [1, 4], "x": 13, "y": 0, "w": 2}, + {"matrix": [1, 5], "x": 0, "y": 1, "w": 1.5}, + {"matrix": [1, 6], "x": 1.5, "y": 1}, + {"matrix": [1, 7], "x": 2.5, "y": 1}, + {"matrix": [1, 8], "x": 3.5, "y": 1}, + {"matrix": [2, 0], "x": 4.5, "y": 1}, + {"matrix": [2, 1], "x": 5.5, "y": 1}, + {"matrix": [2, 2], "x": 6.5, "y": 1}, + {"matrix": [2, 3], "x": 7.5, "y": 1}, + {"matrix": [2, 4], "x": 8.5, "y": 1}, + {"matrix": [2, 5], "x": 9.5, "y": 1}, + {"matrix": [2, 6], "x": 10.5, "y": 1}, + {"matrix": [2, 7], "x": 11.5, "y": 1}, + {"matrix": [2, 8], "x": 12.5, "y": 1}, + {"matrix": [3, 0], "x": 13.5, "y": 1, "w": 1.5}, + {"matrix": [3, 1], "x": 0, "y": 2, "w": 1.75}, + {"matrix": [3, 2], "x": 1.75, "y": 2}, + {"matrix": [3, 3], "x": 2.75, "y": 2}, + {"matrix": [3, 4], "x": 3.75, "y": 2}, + {"matrix": [3, 5], "x": 4.75, "y": 2}, + {"matrix": [3, 6], "x": 5.75, "y": 2}, + {"matrix": [3, 7], "x": 6.75, "y": 2}, + {"matrix": [3, 8], "x": 7.75, "y": 2}, + {"matrix": [4, 0], "x": 8.75, "y": 2}, + {"matrix": [4, 1], "x": 9.75, "y": 2}, + {"matrix": [4, 2], "x": 10.75, "y": 2}, + {"matrix": [4, 3], "x": 11.75, "y": 2}, + {"matrix": [4, 4], "x": 12.75, "y": 2, "w": 2.25}, + {"matrix": [4, 5], "x": 15, "y": 2}, + {"matrix": [4, 6], "x": 0, "y": 3, "w": 2.25}, + {"matrix": [4, 7], "x": 2.25, "y": 3}, + {"matrix": [4, 8], "x": 3.25, "y": 3}, + {"matrix": [5, 0], "x": 4.25, "y": 3}, + {"matrix": [5, 1], "x": 5.25, "y": 3}, + {"matrix": [5, 2], "x": 6.25, "y": 3}, + {"matrix": [5, 3], "x": 7.25, "y": 3}, + {"matrix": [5, 4], "x": 8.25, "y": 3}, + {"matrix": [5, 5], "x": 9.25, "y": 3}, + {"matrix": [5, 6], "x": 10.25, "y": 3}, + {"matrix": [5, 7], "x": 11.25, "y": 3}, + {"matrix": [5, 8], "x": 12.25, "y": 3, "w": 2.75}, + {"matrix": [6, 0], "x": 15, "y": 3}, + {"matrix": [6, 1], "x": 0, "y": 4, "w": 1.25}, + {"matrix": [6, 2], "x": 1.25, "y": 4, "w": 1.25}, + {"matrix": [6, 3], "x": 2.5, "y": 4, "w": 1.25}, + {"matrix": [6, 4], "x": 3.75, "y": 4, "w": 6.25}, + {"matrix": [6, 5], "x": 10, "y": 4, "w": 1.25}, + {"matrix": [6, 6], "x": 11.25, "y": 4, "w": 1.25}, + {"matrix": [6, 7], "x": 12.5, "y": 4, "w": 1.25}, + {"matrix": [6, 8], "x": 13.75, "y": 4, "w": 1.25}, + {"matrix": [7, 0], "x": 15, "y": 4} + ] + }, + "LAYOUT_all": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [0, 6], "x": 6, "y": 0}, + {"matrix": [0, 7], "x": 7, "y": 0}, + {"matrix": [0, 8], "x": 8, "y": 0}, + {"matrix": [1, 0], "x": 9, "y": 0}, + {"matrix": [1, 1], "x": 10, "y": 0}, + {"matrix": [1, 2], "x": 11, "y": 0}, + {"matrix": [1, 3], "x": 12, "y": 0}, + {"matrix": [1, 4], "x": 13, "y": 0, "w": 2}, + {"matrix": [1, 5], "x": 0, "y": 1, "w": 1.5}, + {"matrix": [1, 6], "x": 1.5, "y": 1}, + {"matrix": [1, 7], "x": 2.5, "y": 1}, + {"matrix": [1, 8], "x": 3.5, "y": 1}, + {"matrix": [2, 0], "x": 4.5, "y": 1}, + {"matrix": [2, 1], "x": 5.5, "y": 1}, + {"matrix": [2, 2], "x": 6.5, "y": 1}, + {"matrix": [2, 3], "x": 7.5, "y": 1}, + {"matrix": [2, 4], "x": 8.5, "y": 1}, + {"matrix": [2, 5], "x": 9.5, "y": 1}, + {"matrix": [2, 6], "x": 10.5, "y": 1}, + {"matrix": [2, 7], "x": 11.5, "y": 1}, + {"matrix": [2, 8], "x": 12.5, "y": 1}, + {"matrix": [3, 0], "x": 13.5, "y": 1, "w": 1.5}, + {"matrix": [3, 1], "x": 0, "y": 2, "w": 1.75}, + {"matrix": [3, 2], "x": 1.75, "y": 2}, + {"matrix": [3, 3], "x": 2.75, "y": 2}, + {"matrix": [3, 4], "x": 3.75, "y": 2}, + {"matrix": [3, 5], "x": 4.75, "y": 2}, + {"matrix": [3, 6], "x": 5.75, "y": 2}, + {"matrix": [3, 7], "x": 6.75, "y": 2}, + {"matrix": [3, 8], "x": 7.75, "y": 2}, + {"matrix": [4, 0], "x": 8.75, "y": 2}, + {"matrix": [4, 1], "x": 9.75, "y": 2}, + {"matrix": [4, 2], "x": 10.75, "y": 2}, + {"matrix": [4, 3], "x": 11.75, "y": 2}, + {"matrix": [4, 4], "x": 12.75, "y": 2, "w": 2.25}, + {"matrix": [4, 5], "x": 15, "y": 2}, + {"matrix": [4, 6], "x": 0, "y": 3, "w": 2.25}, + {"matrix": [4, 7], "x": 2.25, "y": 3}, + {"matrix": [4, 8], "x": 3.25, "y": 3}, + {"matrix": [5, 0], "x": 4.25, "y": 3}, + {"matrix": [5, 1], "x": 5.25, "y": 3}, + {"matrix": [5, 2], "x": 6.25, "y": 3}, + {"matrix": [5, 3], "x": 7.25, "y": 3}, + {"matrix": [5, 4], "x": 8.25, "y": 3}, + {"matrix": [5, 5], "x": 9.25, "y": 3}, + {"matrix": [5, 6], "x": 10.25, "y": 3}, + {"matrix": [5, 7], "x": 11.25, "y": 3}, + {"matrix": [5, 8], "x": 12.25, "y": 3, "w": 2.75}, + {"matrix": [6, 0], "x": 15, "y": 3}, + {"matrix": [6, 1], "x": 0, "y": 4, "w": 1.25}, + {"matrix": [6, 2], "x": 1.25, "y": 4, "w": 1.25}, + {"matrix": [6, 3], "x": 2.5, "y": 4, "w": 1.25}, + {"matrix": [7, 1], "x": 3.75, "y": 4, "w": 1.5}, + {"matrix": [7, 2], "x": 5.25, "y": 4}, + {"matrix": [6, 4], "x": 6.25, "y": 4, "w": 1.25}, + {"matrix": [7, 3], "x": 7.5, "y": 4}, + {"matrix": [7, 4], "x": 8.5, "y": 4, "w": 1.5}, + {"matrix": [6, 5], "x": 10, "y": 4, "w": 1.25}, + {"matrix": [6, 6], "x": 11.25, "y": 4, "w": 1.25}, + {"matrix": [6, 7], "x": 12.5, "y": 4, "w": 1.25}, + {"matrix": [6, 8], "x": 13.75, "y": 4, "w": 1.25}, + {"matrix": [7, 0], "x": 15, "y": 4} + ] + } + } +} diff --git a/keyboards/boardsource/sessanta/keymaps/default/keymap.json b/keyboards/boardsource/sessanta/keymaps/default/keymap.json new file mode 100644 index 00000000000..b99333c46d7 --- /dev/null +++ b/keyboards/boardsource/sessanta/keymaps/default/keymap.json @@ -0,0 +1,21 @@ +{ + "keyboard": "boardsource/sessanta", + "keymap": "default", + "layout": "LAYOUT_625_bar", + "layers": [ + [ + "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_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_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_VOLU", + "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_MPLY", + "KC_LCTL", "KC_LGUI", "KC_LALT", "KC_SPC", "MO(1)", "KC_RALT", "KC_RGUI", "KC_RCTL", "KC_VOLD" + ], + [ + "QK_BOOT", "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", + "QK_RBT", "RGB_MOD", "RGB_VAI", "RGB_HUI", "RGB_SAI", "RGB_TOG", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", + "EE_CLR", "RGB_RMOD", "RGB_VAD", "RGB_HUD", "RGB_SAD", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", + "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", + "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______" + ] + ] +} diff --git a/keyboards/boardsource/sessanta/keymaps/via/keymap.json b/keyboards/boardsource/sessanta/keymaps/via/keymap.json new file mode 100644 index 00000000000..68e8e5fb208 --- /dev/null +++ b/keyboards/boardsource/sessanta/keymaps/via/keymap.json @@ -0,0 +1,26 @@ +{ + "keyboard": "boardsource/sessanta", + "keymap": "via", + "layout": "LAYOUT_all", + "config": { + "features": { + "via": true + } + }, + "layers": [ + [ + "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_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_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_VOLU", + "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_MPLY", + "KC_LCTL", "KC_LGUI", "KC_LALT", "KC_SPC", "KC_SPC", "KC_SPC", "KC_SPC", "KC_SPC", "MO(1)", "KC_RALT", "KC_RGUI", "KC_RCTL", "KC_VOLD" + ], + [ + "QK_BOOT", "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", + "QK_RBT", "RGB_MOD", "RGB_VAI", "RGB_HUI", "RGB_SAI", "RGB_TOG", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", + "EE_CLR", "RGB_RMOD", "RGB_VAD", "RGB_HUD", "RGB_SAD", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", + "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", + "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______" + ] + ] +} diff --git a/keyboards/boardsource/sessanta/readme.md b/keyboards/boardsource/sessanta/readme.md new file mode 100644 index 00000000000..35c841271c3 --- /dev/null +++ b/keyboards/boardsource/sessanta/readme.md @@ -0,0 +1,27 @@ +# Sessanta + +![image](https://i.imgur.com/ALvvC53.jpeg) + +A 60% keyboard offered in an MX or Choc PCB with per-key RGB + +* Keyboard Maintainer: [waffle87](https://github.com/waffle87) +* Hardware Supported: Sessanta PCB w/ Pro Micro compatible microcontroller +* Hardware Availability: [boardsource.xyz](https://boardsource.xyz) + +Make example for this keyboard (after setting up your build environment): + + make boardsource/sessanta:default + +Flashing example for this keyboard: + + make boardsource/sessanta: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**: Hold down the key at (0,0) in the matrix and plug in the keyboard +* **Physical reset button**: Briefly press the button on the back of the PCB near microcontroller +* **Keycode in layout**: Press the key mapped to `QK_BOOT` From 2623a258f1cc2a1687ef4529892b8fe6fb9be5f0 Mon Sep 17 00:00:00 2001 From: leyew <102467346+itsme-zeix@users.noreply.github.com> Date: Thu, 11 Jul 2024 21:40:54 +0800 Subject: [PATCH 060/204] [Keyboard] Rename dnworks/9973 to dnworks/tkl87 (#23692) --- data/mappings/keyboard_aliases.hjson | 3 +++ keyboards/dnworks/{9973 => tkl87}/config.h | 0 keyboards/dnworks/{9973 => tkl87}/keyboard.json | 2 +- .../{9973 => tkl87}/keymaps/default/keymap.c | 0 .../dnworks/{9973 => tkl87}/keymaps/via/keymap.c | 0 .../dnworks/{9973 => tkl87}/keymaps/via/rules.mk | 0 keyboards/dnworks/{9973 => tkl87}/readme.md | 16 ++++++++-------- 7 files changed, 12 insertions(+), 9 deletions(-) rename keyboards/dnworks/{9973 => tkl87}/config.h (100%) rename keyboards/dnworks/{9973 => tkl87}/keyboard.json (99%) rename keyboards/dnworks/{9973 => tkl87}/keymaps/default/keymap.c (100%) rename keyboards/dnworks/{9973 => tkl87}/keymaps/via/keymap.c (100%) rename keyboards/dnworks/{9973 => tkl87}/keymaps/via/rules.mk (100%) rename keyboards/dnworks/{9973 => tkl87}/readme.md (54%) diff --git a/data/mappings/keyboard_aliases.hjson b/data/mappings/keyboard_aliases.hjson index 14eec52e313..174704e99ac 100644 --- a/data/mappings/keyboard_aliases.hjson +++ b/data/mappings/keyboard_aliases.hjson @@ -1528,5 +1528,8 @@ }, "kprepublic/jj50": { "target": "kprepublic/jj50/rev1" + }, + "dnworks/9973": { + "target": "dnworks/tkl87" } } diff --git a/keyboards/dnworks/9973/config.h b/keyboards/dnworks/tkl87/config.h similarity index 100% rename from keyboards/dnworks/9973/config.h rename to keyboards/dnworks/tkl87/config.h diff --git a/keyboards/dnworks/9973/keyboard.json b/keyboards/dnworks/tkl87/keyboard.json similarity index 99% rename from keyboards/dnworks/9973/keyboard.json rename to keyboards/dnworks/tkl87/keyboard.json index 61696060262..6b56435ae3f 100644 --- a/keyboards/dnworks/9973/keyboard.json +++ b/keyboards/dnworks/tkl87/keyboard.json @@ -1,5 +1,5 @@ { - "keyboard_name": "DN 997.3", + "keyboard_name": "DN TKL F12", "maintainer": "itsme-zeix", "manufacturer": "dnworks", "processor": "RP2040", diff --git a/keyboards/dnworks/9973/keymaps/default/keymap.c b/keyboards/dnworks/tkl87/keymaps/default/keymap.c similarity index 100% rename from keyboards/dnworks/9973/keymaps/default/keymap.c rename to keyboards/dnworks/tkl87/keymaps/default/keymap.c diff --git a/keyboards/dnworks/9973/keymaps/via/keymap.c b/keyboards/dnworks/tkl87/keymaps/via/keymap.c similarity index 100% rename from keyboards/dnworks/9973/keymaps/via/keymap.c rename to keyboards/dnworks/tkl87/keymaps/via/keymap.c diff --git a/keyboards/dnworks/9973/keymaps/via/rules.mk b/keyboards/dnworks/tkl87/keymaps/via/rules.mk similarity index 100% rename from keyboards/dnworks/9973/keymaps/via/rules.mk rename to keyboards/dnworks/tkl87/keymaps/via/rules.mk diff --git a/keyboards/dnworks/9973/readme.md b/keyboards/dnworks/tkl87/readme.md similarity index 54% rename from keyboards/dnworks/9973/readme.md rename to keyboards/dnworks/tkl87/readme.md index 790f236cb77..121cdccddfa 100644 --- a/keyboards/dnworks/9973/readme.md +++ b/keyboards/dnworks/tkl87/readme.md @@ -1,20 +1,20 @@ -# 997.3 TKL +# dnworks TKL (F12) ![997.3 TKL](https://i.imgur.com/iPPLKg1h.jpeg) -PCB that supports the 997.3 TKL designed by dnworks, including its variants. +PCB that supports the F12 TKLs designed by dnworks. * Keyboard Maintainer: [Zeix](https://github.com/itsme-zeix) -* Hardware Supported: 997.3 Solder PCB rev1 -* Hardware Availability: dnworks.co +* Hardware Supported: 997.3 Solder PCB rev1, 765LT Solder PCB rev1 and Best Friend Solder PCB Rev1. +* Hardware Availability: https://dnworks.co/products Make example for this keyboard (after setting up your build environment): - make dnworks/997pt3:default + make dnworks/tkl87:default Flashing example for this keyboard: - make dnworks/997pt3:default:flash + make dnworks/tkl87: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). @@ -22,6 +22,6 @@ See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_to Enter the bootloader in 3 ways: -* **Bootmagic reset**: Hold down the top left key and plug in the keyboard -* **Physical reset button**: Briefly press the `RESET` button twice or short the `USB_BOOT` and `GND` pads and plug in the keyboard +* **Bootmagic reset**: Hold down escape and plug in the keyboard +* **Physical reset button**: Short the 'USB_BOOT' button and plug in keyboard or press the 'RESET' button twice with the keyboard plugged in. * **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available \ No newline at end of file From 1b8b6801d4f896409a765d302e7e0d50ff089692 Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Thu, 11 Jul 2024 23:43:26 +1000 Subject: [PATCH 061/204] [CI] Add index page generator. (#23737) --- .github/workflows/ci_build_major_branch.yml | 24 +++- .gitignore | 1 + util/ci/index_generator.py | 109 +++++++++++++++ util/ci/requirements.txt | 2 + util/ci/templates/index.html.j2 | 139 ++++++++++++++++++++ 5 files changed, 269 insertions(+), 6 deletions(-) create mode 100755 util/ci/index_generator.py create mode 100644 util/ci/templates/index.html.j2 diff --git a/.github/workflows/ci_build_major_branch.yml b/.github/workflows/ci_build_major_branch.yml index 77755ba71f4..0e772c7d536 100644 --- a/.github/workflows/ci_build_major_branch.yml +++ b/.github/workflows/ci_build_major_branch.yml @@ -77,44 +77,56 @@ jobs: runs-on: ubuntu-latest steps: + - name: Disable safe.directory check + run: | + git config --global --add safe.directory '*' + + - name: Checkout QMK Firmware + uses: actions/checkout@v4 + - name: Download firmwares uses: actions/download-artifact@v4 with: pattern: firmware-* - path: firmwares + path: . merge-multiple: true + - name: Generate index page + run: | + python3 -m pip install -r ./util/ci/requirements.txt + ./util/ci/index_generator.py > index.html + - name: Upload to https://ci.qmk.fm/${{ inputs.branch || github.ref_name }}/${{ github.sha }} uses: jakejarvis/s3-sync-action@master with: - args: --acl public-read --follow-symlinks --delete + args: --acl public-read --follow-symlinks --delete --exclude '*' --include 'index.html' --include '*.hex' --include '*.bin' --include '*.uf2' env: AWS_S3_BUCKET: ${{ vars.CI_QMK_FM_SPACES_BUCKET }} AWS_ACCESS_KEY_ID: ${{ secrets.CI_QMK_FM_SPACES_KEY }} AWS_SECRET_ACCESS_KEY: ${{ secrets.CI_QMK_FM_SPACES_SECRET }} AWS_REGION: ${{ vars.CI_QMK_FM_SPACES_REGION }} AWS_S3_ENDPOINT: ${{ vars.CI_QMK_FM_SPACES_ENDPOINT }} - SOURCE_DIR: firmwares + SOURCE_DIR: . DEST_DIR: ${{ inputs.branch || github.ref_name }}/${{ github.sha }} - name: Upload to https://ci.qmk.fm/${{ inputs.branch || github.ref_name }}/latest uses: jakejarvis/s3-sync-action@master with: - args: --acl public-read --follow-symlinks --delete + args: --acl public-read --follow-symlinks --delete --exclude '*' --include 'index.html' --include '*.hex' --include '*.bin' --include '*.uf2' env: AWS_S3_BUCKET: ${{ vars.CI_QMK_FM_SPACES_BUCKET }} AWS_ACCESS_KEY_ID: ${{ secrets.CI_QMK_FM_SPACES_KEY }} AWS_SECRET_ACCESS_KEY: ${{ secrets.CI_QMK_FM_SPACES_SECRET }} AWS_REGION: ${{ vars.CI_QMK_FM_SPACES_REGION }} AWS_S3_ENDPOINT: ${{ vars.CI_QMK_FM_SPACES_ENDPOINT }} - SOURCE_DIR: firmwares + SOURCE_DIR: . DEST_DIR: ${{ inputs.branch || github.ref_name }}/latest - name: Check if failure marker file exists id: check_failure_marker uses: andstor/file-existence-action@v3 with: - files: firmwares/.failed + files: ./.failed - name: Fail build if needed if: steps.check_failure_marker.outputs.files_exists == 'true' diff --git a/.gitignore b/.gitignore index 35b128606d7..5de38c161cd 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ *.la *.stackdump *.sym +index.html # QMK-specific api_data/v1 diff --git a/util/ci/index_generator.py b/util/ci/index_generator.py new file mode 100755 index 00000000000..b6440bbffb7 --- /dev/null +++ b/util/ci/index_generator.py @@ -0,0 +1,109 @@ +#!/usr/bin/env python3 + +import os +import re +import shlex +import subprocess +from pathlib import Path + +from ansi2html import Ansi2HTMLConverter +from jinja2 import Environment, FileSystemLoader, select_autoescape + +orig_cwd = os.getcwd() +qmk_firmware_dir = Path(os.path.realpath(__file__)).parents[2] +build_dir = qmk_firmware_dir / ".build" + +KEYBOARD_PATTERN = re.compile("CI Metadata: KEYBOARD=(?P.*)\r?\n") +KEYMAP_PATTERN = re.compile("CI Metadata: KEYMAP=(?P.*)\r?\n") + +env = Environment( + loader=FileSystemLoader(Path(os.path.realpath(__file__)).parent / "templates"), + autoescape=select_autoescape(), +) + + +def _run(command, capture_output=True, combined_output=False, text=True, **kwargs): + if isinstance(command, str): + command = shlex.split(command) + if capture_output: + kwargs["stdout"] = subprocess.PIPE + kwargs["stderr"] = subprocess.PIPE + if combined_output: + kwargs["stderr"] = subprocess.STDOUT + if "stdin" in kwargs and kwargs["stdin"] is None: + del kwargs["stdin"] + if text: + kwargs["universal_newlines"] = True + return subprocess.run(command, **kwargs) + + +def _ansi2html(value): + return Ansi2HTMLConverter().convert(value, full=False) + + +def _ansi2html_styles(): + from ansi2html.style import get_styles + + styles = get_styles(scheme="dracula") + return "\n".join([str(s) for s in styles]) + + +def _git_log(count = 4): + os.chdir(qmk_firmware_dir) + ret = _run(f"git log -n {count} --color=always --no-merges --topo-order --stat").stdout.strip() + os.chdir(orig_cwd) + return ret + +def _git_describe(): + os.chdir(qmk_firmware_dir) + ret = _run("git describe --tags --always --dirty").stdout.strip() + os.chdir(orig_cwd) + return ret + +def _git_revision(): + os.chdir(qmk_firmware_dir) + ret = _run("git rev-parse HEAD").stdout.strip() + os.chdir(orig_cwd) + return ret + + +env.filters["ansi2html"] = _ansi2html + +binaries = [] +binaries.extend(qmk_firmware_dir.glob("*.bin")) +binaries.extend(qmk_firmware_dir.glob("*.hex")) +binaries.extend(qmk_firmware_dir.glob("*.uf2")) +binaries = list(sorted(binaries)) + +failures = [] +for mdfile in list(sorted(build_dir.glob("failed.log.*"))): + txt = Path(mdfile).read_text() + + m_kb = KEYBOARD_PATTERN.search(txt) + if not m_kb: + raise Exception("Couldn't determine the keyboard from the failure output") + m_km = KEYMAP_PATTERN.search(txt) + if not m_km: + raise Exception("Couldn't determine the keymap from the failure output") + + txt = KEYBOARD_PATTERN.sub("", KEYMAP_PATTERN.sub("", txt)).strip() + + failures.append( + { + "stdout": txt, + "keyboard": m_kb.group("keyboard"), + "keymap": m_km.group("keymap"), + } + ) + +template = env.get_template("index.html.j2") +print( + template.render( + ansi2html_styles=_ansi2html_styles(), + git_log=_git_log(), + git_describe=_git_describe(), + git_revision=_git_revision(), + binaries=binaries, + failures=failures, + ) +) diff --git a/util/ci/requirements.txt b/util/ci/requirements.txt index 3196568e1a7..47acf85644f 100644 --- a/util/ci/requirements.txt +++ b/util/ci/requirements.txt @@ -1 +1,3 @@ discord-webhook +Jinja2 +ansi2html diff --git a/util/ci/templates/index.html.j2 b/util/ci/templates/index.html.j2 new file mode 100644 index 00000000000..18086987db0 --- /dev/null +++ b/util/ci/templates/index.html.j2 @@ -0,0 +1,139 @@ + + + + + + + + + +
+
+
+ +
+
+
+ CI Build {% if failures | length > 0 %}❌{% else %}✅{% endif %} +
+
+ {{ git_describe }} +
+
+ {{ git_revision }} +
+
+ {{ failures | length }} failure{% if failures | length != 1 %}s{% endif %} +
+
+ + {% if binaries | length > 0 %}Firmwares | {% endif %} + Commit info + {% if failures | length > 0 %} | Failure Logs{% endif %} + +
+
+
+ +
+

Git commit

+
+
{{ git_log | ansi2html }}
+
+
+ {% if failures | length > 0 %} + +
+

Build failure logs

+ +
+ {% for failure in failures %} + +
+

Build failure — {{ failure.keyboard }}:{{ failure.keymap }}

+
+
{{ failure.stdout | ansi2html }}
+
+
+ {% endfor %} + {% endif %} +
+ {% if binaries | length > 0 %} +
+ +
+

Firmware downloads

+
+ {% for binary in binaries %} + + {%- endfor %} +
+
+
+ {% endif %} + + + From 2e671cfd8be1a867cb6717732f1045fc026aeba0 Mon Sep 17 00:00:00 2001 From: QMK Bot Date: Thu, 11 Jul 2024 23:50:39 +1000 Subject: [PATCH 062/204] [CI] Format code according to conventions (#24095) Format code according to conventions --- util/ci/index_generator.py | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/util/ci/index_generator.py b/util/ci/index_generator.py index b6440bbffb7..f2f7f4d4167 100755 --- a/util/ci/index_generator.py +++ b/util/ci/index_generator.py @@ -48,18 +48,20 @@ def _ansi2html_styles(): return "\n".join([str(s) for s in styles]) -def _git_log(count = 4): +def _git_log(count=4): os.chdir(qmk_firmware_dir) ret = _run(f"git log -n {count} --color=always --no-merges --topo-order --stat").stdout.strip() os.chdir(orig_cwd) return ret + def _git_describe(): os.chdir(qmk_firmware_dir) ret = _run("git describe --tags --always --dirty").stdout.strip() os.chdir(orig_cwd) return ret + def _git_revision(): os.chdir(qmk_firmware_dir) ret = _run("git rev-parse HEAD").stdout.strip() @@ -88,22 +90,18 @@ for mdfile in list(sorted(build_dir.glob("failed.log.*"))): txt = KEYBOARD_PATTERN.sub("", KEYMAP_PATTERN.sub("", txt)).strip() - failures.append( - { - "stdout": txt, - "keyboard": m_kb.group("keyboard"), - "keymap": m_km.group("keymap"), - } - ) + failures.append({ + "stdout": txt, + "keyboard": m_kb.group("keyboard"), + "keymap": m_km.group("keymap"), + }) template = env.get_template("index.html.j2") -print( - template.render( - ansi2html_styles=_ansi2html_styles(), - git_log=_git_log(), - git_describe=_git_describe(), - git_revision=_git_revision(), - binaries=binaries, - failures=failures, - ) -) +print(template.render( + ansi2html_styles=_ansi2html_styles(), + git_log=_git_log(), + git_describe=_git_describe(), + git_revision=_git_revision(), + binaries=binaries, + failures=failures, +)) From 063f1444c68a64a02fe2f5c3de2f8fa765f53533 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Thu, 11 Jul 2024 23:48:43 +0100 Subject: [PATCH 063/204] Add json index of files to CI uploads (#24097) --- .github/workflows/ci_build_major_branch.yml | 5 ++-- .gitignore | 1 + util/ci/firmware_list_generator.py | 26 +++++++++++++++++++++ util/ci/templates/index.html.j2 | 3 ++- 4 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 util/ci/firmware_list_generator.py diff --git a/.github/workflows/ci_build_major_branch.yml b/.github/workflows/ci_build_major_branch.yml index 0e772c7d536..ba5d1c246fe 100644 --- a/.github/workflows/ci_build_major_branch.yml +++ b/.github/workflows/ci_build_major_branch.yml @@ -95,11 +95,12 @@ jobs: run: | python3 -m pip install -r ./util/ci/requirements.txt ./util/ci/index_generator.py > index.html + ./util/ci/firmware_list_generator.py > firmware_list.json - name: Upload to https://ci.qmk.fm/${{ inputs.branch || github.ref_name }}/${{ github.sha }} uses: jakejarvis/s3-sync-action@master with: - args: --acl public-read --follow-symlinks --delete --exclude '*' --include 'index.html' --include '*.hex' --include '*.bin' --include '*.uf2' + args: --acl public-read --follow-symlinks --delete --exclude '*' --include 'index.html' --include 'firmware_list.json' --include '*.hex' --include '*.bin' --include '*.uf2' env: AWS_S3_BUCKET: ${{ vars.CI_QMK_FM_SPACES_BUCKET }} AWS_ACCESS_KEY_ID: ${{ secrets.CI_QMK_FM_SPACES_KEY }} @@ -112,7 +113,7 @@ jobs: - name: Upload to https://ci.qmk.fm/${{ inputs.branch || github.ref_name }}/latest uses: jakejarvis/s3-sync-action@master with: - args: --acl public-read --follow-symlinks --delete --exclude '*' --include 'index.html' --include '*.hex' --include '*.bin' --include '*.uf2' + args: --acl public-read --follow-symlinks --delete --exclude '*' --include 'index.html' --include 'firmware_list.json' --include '*.hex' --include '*.bin' --include '*.uf2' env: AWS_S3_BUCKET: ${{ vars.CI_QMK_FM_SPACES_BUCKET }} AWS_ACCESS_KEY_ID: ${{ secrets.CI_QMK_FM_SPACES_KEY }} diff --git a/.gitignore b/.gitignore index 5de38c161cd..c3f2f063cd1 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ *.stackdump *.sym index.html +firmware_list.json # QMK-specific api_data/v1 diff --git a/util/ci/firmware_list_generator.py b/util/ci/firmware_list_generator.py new file mode 100644 index 00000000000..926939f4c3e --- /dev/null +++ b/util/ci/firmware_list_generator.py @@ -0,0 +1,26 @@ +import os +import json +from pathlib import Path +from time import gmtime, strftime + +DATETIME_FORMAT = '%Y-%m-%d %H:%M:%S %Z' + +def current_datetime(): + return strftime(DATETIME_FORMAT, gmtime()) + + +qmk_firmware_dir = Path(os.path.realpath(__file__)).parents[2] + +binaries = [] +binaries.extend(qmk_firmware_dir.glob("*.bin")) +binaries.extend(qmk_firmware_dir.glob("*.hex")) +binaries.extend(qmk_firmware_dir.glob("*.uf2")) +binaries = list(sorted(binaries)) + +data = [] +for binary in binaries: + data.append(binary.name) + +keyboard_all_json = json.dumps({'last_updated': current_datetime(), 'files': data}, separators=(',', ':')) + +print(keyboard_all_json) diff --git a/util/ci/templates/index.html.j2 b/util/ci/templates/index.html.j2 index 18086987db0..1199a0819d3 100644 --- a/util/ci/templates/index.html.j2 +++ b/util/ci/templates/index.html.j2 @@ -3,6 +3,7 @@ +