Compare commits

..

1 Commits

Author SHA1 Message Date
Duncan Sutherland
b47bce1dc9
Merge de00188ea2 into 310c4847d5 2024-11-15 15:08:44 -05:00
32 changed files with 17 additions and 407 deletions

View File

@ -456,10 +456,6 @@ ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes)
COMMON_VPATH += $(QUANTUM_DIR)/rgb_matrix/animations
COMMON_VPATH += $(QUANTUM_DIR)/rgb_matrix/animations/runners
POST_CONFIG_H += $(QUANTUM_DIR)/rgb_matrix/post_config.h
# TODO: Remove this
SRC += $(QUANTUM_DIR)/process_keycode/process_underglow.c
SRC += $(QUANTUM_DIR)/process_keycode/process_rgb_matrix.c
SRC += $(QUANTUM_DIR)/color.c
SRC += $(QUANTUM_DIR)/rgb_matrix/rgb_matrix.c

View File

@ -4,7 +4,7 @@ This page attempts to introduce developers to the QMK Compiler. It does not go i
# Overview
The QMK Compile API consists of a few moving parts:
The QMK Compile API consists of a few movings parts:
![Architecture Diagram](https://raw.githubusercontent.com/qmk/qmk_api/master/docs/architecture.svg)

View File

@ -11,7 +11,7 @@ These allow you to combine a modifier with a keycode. When pressed, the keydown
|`RCTL(kc)`| |Hold Right Control and press `kc` |
|`RSFT(kc)`| |Hold Right Shift and press `kc` |
|`RALT(kc)`|`ROPT(kc)`, `ALGR(kc)` |Hold Right Alt and press `kc` |
|`RGUI(kc)`|`RCMD(kc)`, `RWIN(kc)` |Hold Right GUI and press `kc` |
|`RGUI(kc)`|`RCMD(kc)`, `LWIN(kc)` |Hold Right GUI and press `kc` |
|`LSG(kc)` |`SGUI(kc)`, `SCMD(kc)`, `SWIN(kc)`|Hold Left Shift and GUI and press `kc` |
|`LAG(kc)` | |Hold Left Alt and Left GUI and press `kc` |
|`RSG(kc)` | |Hold Right Shift and Right GUI and press `kc` |

View File

@ -59,10 +59,6 @@ Changing the **Value** sets the overall brightness.<br>
## Keycodes
::: warning
These keycodes also simultaneously control [RGB Matrix](rgb_matrix), if enabled. This behaviour is in the process of being deprecated, so during this time it is recommended to additionally include the dedicated RGB Matrix keycodes to your keymap, and add `#define RGB_MATRIX_DISABLE_SHARED_KEYCODES` to `config.h`.
:::
|Key |Aliases |Description |
|------------------------------|----------|---------------------------------------------------------------------|
|`QK_UNDERGLOW_TOGGLE` |`UG_TOGG` |Toggle RGB lighting on or off |

View File

@ -60,14 +60,6 @@
"resync": true
}
},
"encoder": {
"rotary": [
{"pin_a": "B12", "pin_b": "B11", "resolution": 2},
{"pin_a": "B12", "pin_b": "B11", "resolution": 2},
{"pin_a": "B12", "pin_b": "B11", "resolution": 2},
{"pin_a": "B12", "pin_b": "B11", "resolution": 2}
]
},
"layouts": {
"LAYOUT_default": {
"layout": [

View File

@ -44,10 +44,3 @@ 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
)
};
#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), ENCODER_CCW_CW(UG_HUED, UG_HUEU), ENCODER_CCW_CW(UG_SATD, UG_SATU) },
[1] = { ENCODER_CCW_CW(UG_VALD, UG_VALU), ENCODER_CCW_CW(UG_SPDD, UG_SPDU), ENCODER_CCW_CW(UG_PREV, UG_NEXT), ENCODER_CCW_CW(KC_RIGHT, KC_LEFT) },
};
#endif

View File

@ -1,2 +0,0 @@
ENCODER_ENABLE = yes
ENCODER_MAP_ENABLE = yes

View File

@ -1,40 +0,0 @@
// Copyright 2024 Nick Brassel (@tzarc)
// SPDX-License-Identifier: GPL-2.0-or-later
#include QMK_KEYBOARD_H
#if defined(ENCODER_ENABLE) || defined(ENCODER_MAP_ENABLE)
# if !defined(ENCODER_SETTLE_PIN_STATE_DELAY_US)
# define ENCODER_SETTLE_PIN_STATE_DELAY_US 2
# endif
static pin_t matrix_row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
void encoder_driver_task(void) {
// Set all relevant rows to output, which is different to the matrix expectations
for (uint8_t i = 0; i < 4; i++) {
gpio_set_pin_output(matrix_row_pins[i]);
}
// Read each encoder
for (uint8_t i = 0; i < 4; i++) {
// Set the row pin low for the corresponding encoder...
for (uint8_t j = 0; j < 4; j++) {
gpio_write_pin(matrix_row_pins[j], (i == j) ? 0 : 1);
}
// ...and let them settle.
wait_us(ENCODER_SETTLE_PIN_STATE_DELAY_US);
// Run the normal encoder handling
extern void encoder_quadrature_handle_read(uint8_t index, uint8_t pin_a_state, uint8_t pin_b_state);
extern uint8_t encoder_quadrature_read_pin(uint8_t index, bool pad_b);
encoder_quadrature_handle_read(i, encoder_quadrature_read_pin(i, false), encoder_quadrature_read_pin(i, true));
}
// Set all rows back to input-high as per matrix expectations
for (uint8_t i = 0; i < 4; i++) {
gpio_set_pin_input_high(matrix_row_pins[i]);
}
}
#endif // defined(ENCODER_ENABLE) || defined(ENCODER_MAP_ENABLE)

View File

@ -20,5 +20,3 @@
#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND
#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_VCC
#define RGB_MATRIX_DISABLE_SHARED_KEYCODES

View File

@ -20,5 +20,3 @@
#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND
#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_VCC
#define RGB_MATRIX_DISABLE_SHARED_KEYCODES

View File

@ -16,5 +16,3 @@
#pragma once
#define IS31FL3733_I2C_ADDRESS_1 IS31FL3733_I2C_ADDRESS_GND_GND
#define RGB_MATRIX_DISABLE_SHARED_KEYCODES

View File

@ -17,5 +17,3 @@
#pragma once
#define IS31FL3741_I2C_ADDRESS_1 IS31FL3741_I2C_ADDRESS_GND
#define RGB_MATRIX_DISABLE_SHARED_KEYCODES

View File

@ -1,14 +0,0 @@
// Copyright 2023 yuchi
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET
#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 500U
#define SERIAL_USART_FULL_DUPLEX
#define SERIAL_USART_TX_PIN GP0
#define SERIAL_USART_RX_PIN GP1
#define I2C_DRIVER I2CD1
#define I2C1_SDA_PIN GP14
#define I2C1_SCL_PIN GP15

View File

@ -1,7 +0,0 @@
// Copyright 2024 QMK
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#define HAL_USE_I2C TRUE
#include_next <halconf.h>

View File

@ -1,104 +0,0 @@
{
"keyboard_name": "Lily58 Lite Rev3",
"manufacturer": "Liliums",
"maintainer": "yuchi",
"url": "",
"processor": "RP2040",
"bootloader": "rp2040",
"diode_direction": "COL2ROW",
"usb": {
"vid": "0x1209",
"pid": "0x5801",
"device_version": "1.0.0"
},
"split": {
"enabled": true,
"serial": {
"driver": "vendor"
}
},
"matrix_pins": {
"cols": ["GP8", "GP7", "GP6", "GP5", "GP4", "GP3"],
"rows": ["GP13", "GP12", "GP11", "GP10", "GP9"]
},
"features": {
"oled": true,
"bootmagic": true,
"extrakey": true,
"mousekey": true,
"nkro": true
},
"layouts": {
"LAYOUT": {
"layout": [
{"matrix": [0, 0], "x": 0, "y": 0.5},
{"matrix": [0, 1], "x": 1, "y": 0.375},
{"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": [5, 5], "x": 10.5, "y": 0.25},
{"matrix": [5, 4], "x": 11.5, "y": 0.125},
{"matrix": [5, 3], "x": 12.5, "y": 0},
{"matrix": [5, 2], "x": 13.5, "y": 0.125},
{"matrix": [5, 1], "x": 14.5, "y": 0.375},
{"matrix": [5, 0], "x": 15.5, "y": 0.5},
{"matrix": [1, 0], "x": 0, "y": 1.5},
{"matrix": [1, 1], "x": 1, "y": 1.375},
{"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": [6, 5], "x": 10.5, "y": 1.25},
{"matrix": [6, 4], "x": 11.5, "y": 1.125},
{"matrix": [6, 3], "x": 12.5, "y": 1},
{"matrix": [6, 2], "x": 13.5, "y": 1.125},
{"matrix": [6, 1], "x": 14.5, "y": 1.375},
{"matrix": [6, 0], "x": 15.5, "y": 1.5},
{"matrix": [2, 0], "x": 0, "y": 2.5},
{"matrix": [2, 1], "x": 1, "y": 2.375},
{"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": [7, 5], "x": 10.5, "y": 2.25},
{"matrix": [7, 4], "x": 11.5, "y": 2.125},
{"matrix": [7, 3], "x": 12.5, "y": 2},
{"matrix": [7, 2], "x": 13.5, "y": 2.125},
{"matrix": [7, 1], "x": 14.5, "y": 2.375},
{"matrix": [7, 0], "x": 15.5, "y": 2.5},
{"matrix": [3, 0], "x": 0, "y": 3.5},
{"matrix": [3, 1], "x": 1, "y": 3.375},
{"matrix": [3, 2], "x": 2, "y": 3.125},
{"matrix": [3, 3], "x": 3, "y": 3},
{"matrix": [3, 4], "x": 4, "y": 3.125},
{"matrix": [3, 5], "x": 5, "y": 3.25},
{"matrix": [4, 5], "x": 6, "y": 2.75},
{"matrix": [9, 5], "x": 9.5, "y": 2.75},
{"matrix": [8, 5], "x": 10.5, "y": 3.25},
{"matrix": [8, 4], "x": 11.5, "y": 3.125},
{"matrix": [8, 3], "x": 12.5, "y": 3},
{"matrix": [8, 2], "x": 13.5, "y": 3.125},
{"matrix": [8, 1], "x": 14.5, "y": 3.375},
{"matrix": [8, 0], "x": 15.5, "y": 3.5},
{"matrix": [4, 1], "x": 2.5, "y": 4.125},
{"matrix": [4, 2], "x": 3.5, "y": 4.15},
{"matrix": [4, 3], "x": 4.5, "y": 4.25},
{"matrix": [4, 4], "x": 6, "y": 4.25, "h": 1.5},
{"matrix": [9, 4], "x": 9.5, "y": 4.25, "h": 1.5},
{"matrix": [9, 3], "x": 11, "y": 4.25},
{"matrix": [9, 2], "x": 12, "y": 4.15},
{"matrix": [9, 1], "x": 13, "y": 4.15}
]
}
}
}

View File

@ -1,11 +0,0 @@
// Copyright 2024 QMK
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include_next <mcuconf.h>
#undef RP_I2C_USE_I2C0
#define RP_I2C_USE_I2C0 FALSE
#undef RP_I2C_USE_I2C1
#define RP_I2C_USE_I2C1 TRUE

View File

@ -1,28 +0,0 @@
# Lily58 Lite Rev3
![lily58_lite](https://i.imgur.com/RCx5Xym.jpeg)
![lily58_lite_rev3_pcb](https://i.imgur.com/rIjVjCE.png)
* Keyboard Maintainer: [yuchi](https://github.com/kata0510)
* Hardware Supported: RP2040-Zero
* Hardware Availability: [PCB Link](https://github.com/kata0510/Lily58/tree/master/Lite_Rev3)
* Other Information(ja) [Link](https://docs.liliums.net/lily58-lite-rev3/about/)
Make example for this keyboard (after setting up your build environment):
make lily58/lite_rev3:default
Flashing example for this keyboard:
make lily58/lite_rev3: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 (usually the top left key or Escape) and plug in the keyboard
* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead
* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available

View File

@ -2,5 +2,3 @@
#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND
#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_SDA
#define RGB_MATRIX_DISABLE_SHARED_KEYCODES

View File

@ -2,5 +2,3 @@
#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND
#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_SDA
#define RGB_MATRIX_DISABLE_SHARED_KEYCODES

View File

@ -18,5 +18,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#define IS31FL3741_I2C_ADDRESS_1 IS31FL3741_I2C_ADDRESS_GND
#define RGB_MATRIX_DISABLE_SHARED_KEYCODES

View File

@ -18,5 +18,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#define IS31FL3741_I2C_ADDRESS_1 IS31FL3741_I2C_ADDRESS_GND
#define RGB_MATRIX_DISABLE_SHARED_KEYCODES

View File

@ -30,5 +30,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define I2C1_DUTY_CYCLE FAST_DUTY_CYCLE_2
#define IS31FL3741_I2C_ADDRESS_1 IS31FL3741_I2C_ADDRESS_GND
#define RGB_MATRIX_DISABLE_SHARED_KEYCODES

View File

@ -18,5 +18,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#define RGBLIGHT_DI_PIN E6
#define RGB_MATRIX_DISABLE_SHARED_KEYCODES

View File

@ -9,5 +9,3 @@
#define WORK_LOUDER_LED_PIN_1 B6
#define WORK_LOUDER_LED_PIN_2 B7
#define WORK_LOUDER_LED_PIN_3 B5
#define RGB_MATRIX_DISABLE_SHARED_KEYCODES

View File

@ -18,5 +18,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#define RGBLIGHT_DI_PIN C7
#define RGB_MATRIX_DISABLE_SHARED_KEYCODES

View File

@ -5,5 +5,3 @@
#define RGBLIGHT_DI_PIN D2
#define RGBLIGHT_DEFAULT_MODE RGBLIGHT_MODE_STATIC_GRADIENT + 9
#define RGB_MATRIX_DISABLE_SHARED_KEYCODES

View File

@ -20,5 +20,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define RGBLIGHT_DI_PIN D2
#define RGBLIGHT_DEFAULT_MODE RGBLIGHT_MODE_STATIC_GRADIENT + 9
#define RGB_MATRIX_DISABLE_SHARED_KEYCODES

View File

@ -60,7 +60,9 @@ def painter_convert_graphics(cli):
return
# Work out the text substitutions for rendering the output data
subs = generate_subs(cli, out_bytes, image_metadata=metadata, command_name="painter_convert_graphics")
args_str = " ".join((f"--{arg} {getattr(cli.args, arg.replace('-', '_'))}" for arg in ["input", "output", "format", "no-rle", "no-deltas"]))
command = f"qmk painter-convert-graphics {args_str}"
subs = generate_subs(cli, out_bytes, image_metadata=metadata, command=command)
# Render and write the header file
header_text = render_header(subs)

View File

@ -61,8 +61,10 @@ def painter_convert_font_image(cli):
return
# Work out the text substitutions for rendering the output data
args_str = " ".join((f"--{arg} {getattr(cli.args, arg.replace('-', '_'))}" for arg in ["input", "output", "no-ascii", "unicode-glyphs", "format", "no-rle"]))
command = f"qmk painter-convert-font-image {args_str}"
metadata = {"glyphs": _generate_font_glyphs_list(not cli.args.no_ascii, cli.args.unicode_glyphs)}
subs = generate_subs(cli, out_bytes, font_metadata=metadata, command_name="painter_convert_font_image")
subs = generate_subs(cli, out_bytes, font_metadata=metadata, command=command)
# Render and write the header file
header_text = render_header(subs)

View File

@ -3,7 +3,6 @@
import datetime
import math
import re
from pathlib import Path
from string import Template
from PIL import Image, ImageOps
@ -138,31 +137,10 @@ def _render_image_metadata(metadata):
return "\n".join(lines)
def command_args_str(cli, command_name):
"""Given a command name, introspect milc to get the arguments passed in."""
args = {}
max_length = 0
for arg_name, was_passed in cli.args_passed[command_name].items():
max_length = max(max_length, len(arg_name))
val = getattr(cli.args, arg_name.replace("-", "_"))
# do not leak full paths, keep just file name
if isinstance(val, Path):
val = val.name
args[arg_name] = val
return "\n".join(f"// {arg_name.ljust(max_length)} | {val}" for arg_name, val in args.items())
def generate_subs(cli, out_bytes, *, font_metadata=None, image_metadata=None, command_name):
def generate_subs(cli, out_bytes, *, font_metadata=None, image_metadata=None, command):
if font_metadata is not None and image_metadata is not None:
raise ValueError("Cant generate subs for font and image at the same time")
args = command_args_str(cli, command_name)
subs = {
"year": datetime.date.today().strftime("%Y"),
"input_file": cli.args.input.name,
@ -170,8 +148,7 @@ def generate_subs(cli, out_bytes, *, font_metadata=None, image_metadata=None, co
"byte_count": len(out_bytes),
"bytes_lines": render_bytes(out_bytes),
"format": cli.args.format,
"generator_command": command_name.replace("_", "-"),
"command_args": args,
"generator_command": command,
}
if font_metadata is not None:
@ -190,7 +167,7 @@ def generate_subs(cli, out_bytes, *, font_metadata=None, image_metadata=None, co
subs.update({
"generated_type": "image",
"var_prefix": "gfx",
"generator_command": command_name,
"generator_command": command,
"metadata": _render_image_metadata(image_metadata),
})
@ -206,8 +183,7 @@ license_template = """\
// Copyright ${year} QMK -- generated source code only, ${generated_type} retains original copyright
// SPDX-License-Identifier: GPL-2.0-or-later
// This file was auto-generated by `${generator_command}` with arguments:
${command_args}
// This file was auto-generated by `${generator_command}`
"""

View File

@ -2,200 +2,87 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#include "process_underglow.h"
#if defined(RGBLIGHT_ENABLE)
# include "rgblight.h"
#endif
#include "rgblight.h"
#include "action_util.h"
#include "keycodes.h"
#include "modifiers.h"
// TODO: Remove this
#if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_SHARED_KEYCODES)
# include "rgb_matrix.h"
#endif
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:
#if defined(RGBLIGHT_ENABLE)
rgblight_toggle();
#endif
#if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_SHARED_KEYCODES)
rgb_matrix_toggle();
#endif
return false;
case QK_UNDERGLOW_MODE_NEXT:
#if defined(RGBLIGHT_ENABLE)
if (shifted) {
rgblight_step_reverse();
} else {
rgblight_step();
}
#endif
#if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_SHARED_KEYCODES)
if (shifted) {
rgb_matrix_step_reverse();
} else {
rgb_matrix_step();
}
#endif
return false;
case QK_UNDERGLOW_MODE_PREVIOUS:
#if defined(RGBLIGHT_ENABLE)
if (shifted) {
rgblight_step();
} else {
rgblight_step_reverse();
}
#endif
#if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_SHARED_KEYCODES)
if (shifted) {
rgb_matrix_step();
} else {
rgb_matrix_step_reverse();
}
#endif
return false;
case QK_UNDERGLOW_HUE_UP:
#if defined(RGBLIGHT_ENABLE)
if (shifted) {
rgblight_decrease_hue();
} else {
rgblight_increase_hue();
}
#endif
#if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_SHARED_KEYCODES)
if (shifted) {
rgb_matrix_decrease_hue();
} else {
rgb_matrix_increase_hue();
}
#endif
return false;
case QK_UNDERGLOW_HUE_DOWN:
#if defined(RGBLIGHT_ENABLE)
if (shifted) {
rgblight_increase_hue();
} else {
rgblight_decrease_hue();
}
#endif
#if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_SHARED_KEYCODES)
if (shifted) {
rgb_matrix_increase_hue();
} else {
rgb_matrix_decrease_hue();
}
#endif
return false;
case QK_UNDERGLOW_SATURATION_UP:
#if defined(RGBLIGHT_ENABLE)
if (shifted) {
rgblight_decrease_sat();
} else {
rgblight_increase_sat();
}
#endif
#if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_SHARED_KEYCODES)
if (shifted) {
rgb_matrix_decrease_sat();
} else {
rgb_matrix_increase_sat();
}
#endif
return false;
case QK_UNDERGLOW_SATURATION_DOWN:
#if defined(RGBLIGHT_ENABLE)
if (shifted) {
rgblight_increase_sat();
} else {
rgblight_decrease_sat();
}
#endif
#if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_SHARED_KEYCODES)
if (shifted) {
rgb_matrix_increase_sat();
} else {
rgb_matrix_decrease_sat();
}
#endif
return false;
case QK_UNDERGLOW_VALUE_UP:
#if defined(RGBLIGHT_ENABLE)
if (shifted) {
rgblight_decrease_val();
} else {
rgblight_increase_val();
}
#endif
#if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_SHARED_KEYCODES)
if (shifted) {
rgb_matrix_decrease_val();
} else {
rgb_matrix_increase_val();
}
#endif
return false;
case QK_UNDERGLOW_VALUE_DOWN:
#if defined(RGBLIGHT_ENABLE)
if (shifted) {
rgblight_increase_val();
rgblight_increase_hue();
} else {
rgblight_decrease_val();
rgblight_decrease_hue();
}
#endif
#if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_SHARED_KEYCODES)
if (shifted) {
rgb_matrix_increase_val();
} else {
rgb_matrix_decrease_val();
}
#endif
return false;
case QK_UNDERGLOW_SPEED_UP:
#if defined(RGBLIGHT_ENABLE)
if (shifted) {
rgblight_decrease_speed();
} else {
rgblight_increase_speed();
}
#endif
#if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_SHARED_KEYCODES)
if (shifted) {
rgb_matrix_decrease_speed();
} else {
rgb_matrix_increase_speed();
}
#endif
return false;
case QK_UNDERGLOW_SPEED_DOWN:
#if defined(RGBLIGHT_ENABLE)
if (shifted) {
rgblight_increase_speed();
} else {
rgblight_decrease_speed();
}
#endif
#if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_SHARED_KEYCODES)
if (shifted) {
rgb_matrix_increase_speed();
} else {
rgb_matrix_decrease_speed();
}
#endif
return false;
}
}

View File

@ -60,7 +60,7 @@
# include "process_rgb_matrix.h"
#endif
#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
#if defined(RGBLIGHT_ENABLE)
# include "process_underglow.h"
#endif
@ -382,7 +382,7 @@ bool process_record_quantum(keyrecord_t *record) {
#ifdef GRAVE_ESC_ENABLE
process_grave_esc(keycode, record) &&
#endif
#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
#if defined(RGBLIGHT_ENABLE)
process_underglow(keycode, record) &&
#endif
#if defined(RGB_MATRIX_ENABLE)