Update q0 for keychron (#18522)

This commit is contained in:
lalalademaxiya1 2022-09-30 00:50:47 +08:00 committed by GitHub
parent 14e1886405
commit bfcbcfe3c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 15 deletions

View File

@ -34,18 +34,18 @@
#define DRIVER_COUNT 1 #define DRIVER_COUNT 1
#define DRIVER_ADDR_1 0b1110100 #define DRIVER_ADDR_1 0b1110100
#define CONSTANT_CURRENT_STEP \ #define CKLED2001_CURRENT_TUNE \
{ 0xFF, 0xFF, 0x70, 0xFF, 0xFF, 0x70, 0xFF, 0xFF, 0x70, 0xFF, 0xFF, 0x70 } { 0xFF, 0xFF, 0x70, 0xFF, 0xFF, 0x70, 0xFF, 0xFF, 0x70, 0xFF, 0xFF, 0x70 }
#define RGB_MATRIX_CENTER \
{ 56, 16 }
/* NKRO */ /* NKRO */
#define FORCE_NKRO #define FORCE_NKRO
/* turn off effects when suspended */ /* turn off effects when suspended */
#define RGB_DISABLE_WHEN_USB_SUSPENDED #define RGB_DISABLE_WHEN_USB_SUSPENDED
/* We have 2KB EEPROM size on STM32L432 */
#define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 2047
/* EEPROM Driver Configuration */ /* EEPROM Driver Configuration */
#define WEAR_LEVELING_LOGICAL_SIZE 2048 #define WEAR_LEVELING_LOGICAL_SIZE 2048
#define WEAR_LEVELING_BACKING_SIZE (WEAR_LEVELING_LOGICAL_SIZE * 2) #define WEAR_LEVELING_BACKING_SIZE (WEAR_LEVELING_LOGICAL_SIZE * 2)
@ -98,4 +98,4 @@
#define ENABLE_RGB_MATRIX_MULTISPLASH #define ENABLE_RGB_MATRIX_MULTISPLASH
#define ENABLE_RGB_MATRIX_SOLID_SPLASH #define ENABLE_RGB_MATRIX_SOLID_SPLASH
#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH #define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
// #define RGB_MATRIX_KEYPRESSES // #define RGB_MATRIX_KEYPRESSES

View File

@ -16,7 +16,7 @@
#include "q0.h" #include "q0.h"
#if defined(RGB_MATRIX_ENABLE) && defined(CAPS_LOCK_LED_INDEX) #if defined(RGB_MATRIX_ENABLE) && defined(NUM_LOCK_LED_INDEX)
bool process_record_kb(uint16_t keycode, keyrecord_t *record) { bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
if (!process_record_user(keycode, record)) { if (!process_record_user(keycode, record)) {
@ -45,11 +45,11 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
__attribute__((weak)) void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { __attribute__((weak)) void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
// RGB_MATRIX_INDICATOR_SET_COLOR(index, red, green, blue); // RGB_MATRIX_INDICATOR_SET_COLOR(index, red, green, blue);
if (host_keyboard_led_state().caps_lock) { if (host_keyboard_led_state().num_lock) {
RGB_MATRIX_INDICATOR_SET_COLOR(CAPS_LOCK_LED_INDEX, 255, 255, 255); RGB_MATRIX_INDICATOR_SET_COLOR(NUM_LOCK_LED_INDEX, 255, 255, 255);
} else { } else {
if (!rgb_matrix_get_flags()) { if (!rgb_matrix_get_flags()) {
RGB_MATRIX_INDICATOR_SET_COLOR(CAPS_LOCK_LED_INDEX, 0, 0, 0); RGB_MATRIX_INDICATOR_SET_COLOR(NUM_LOCK_LED_INDEX, 0, 0, 0);
} }
} }
} }

View File

@ -18,6 +18,8 @@
#ifdef RGB_MATRIX_ENABLE #ifdef RGB_MATRIX_ENABLE
// clang-format off
const ckled2001_led PROGMEM g_ckled2001_leds[DRIVER_LED_TOTAL] = { const ckled2001_led PROGMEM g_ckled2001_leds[DRIVER_LED_TOTAL] = {
/* Refer to CKLED manual for these locations /* Refer to CKLED manual for these locations
* driver * driver
@ -67,12 +69,12 @@ led_config_t g_led_config = {
}, },
{ {
// LED Index to Physical Position // LED Index to Physical Position
{0,0}, {74,0}, {150,0}, {224,0}, {0,0}, {37,0}, {75,0}, {112,0},
{0,13}, {74,13}, {150,13}, {224,13}, {0,6}, {37,6}, {75,6}, {112,6},
{0,26}, {74,26}, {150,26}, {0,13}, {37,13}, {75,13},
{0,38}, {74,38}, {150,38}, {224,32}, {0,19}, {37,19}, {75,19}, {112,16},
{0,51}, {74,51}, {150,51}, {0,25}, {37,25}, {75,25},
{36,64}, {150,64}, {224,58}, {18,32}, {75,32}, {112,29},
}, },
{ {
// LED Index to Flag // LED Index to Flag