refactor: modular RGB effect registration API
Replace hardcoded effect enum/switch-case with STRUCT_SECTION_ITERABLE registration. Effects register via ZMK_RGB_EFFECT_DEFINE macro. Core API (rgb_effect.h): - zmk_rgb_effect_ctx passed to render callbacks - zmk_rgb_request_refresh() for static effects - ZMK_RGB_EFFECT_STATIC flag skips animation timer - on_select/on_deselect lifecycle hooks - zmk_rgb_hsb_to_rgb/scale helpers now public Built-in effects (solid/breathe/spectrum/swirl) use same API. Per-key layer RGB, behaviors, DTS bindings extracted to external zmk-rgb-effects module.
This commit is contained in:
parent
d94d1597c1
commit
8f3c4d3929
16 changed files with 209 additions and 656 deletions
|
|
@ -1,12 +0,0 @@
|
|||
# Copyright (c) 2024, The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
description: Set underglow color based on battery level
|
||||
|
||||
compatible: "zmk,behavior-underglow-battery"
|
||||
|
||||
include: two_param.yaml
|
||||
|
||||
properties:
|
||||
threshold:
|
||||
type: int
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
# Copyright (c) 2024, The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
description: Set underglow to specified color
|
||||
|
||||
compatible: "zmk,behavior-underglow-color"
|
||||
|
||||
include: one_param.yaml
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# Copyright (c) 2024, The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
description: Set underglow for num lock indicator
|
||||
|
||||
compatible: "zmk,behavior-underglow-indicators"
|
||||
|
||||
include: two_param.yaml
|
||||
|
||||
properties:
|
||||
indicator:
|
||||
type: int
|
||||
default: 0
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
description: |
|
||||
Allows defining a rgbmap composed of multiple layers
|
||||
|
||||
compatible: "zmk,underglow-layer"
|
||||
|
||||
properties:
|
||||
pixel-lookup:
|
||||
type: array
|
||||
required: true
|
||||
|
||||
child-binding:
|
||||
description: "A layer to be used in a rgbmap"
|
||||
|
||||
properties:
|
||||
bindings:
|
||||
type: phandle-array
|
||||
required: true
|
||||
layer-id:
|
||||
type: int
|
||||
required: true
|
||||
fade-delay:
|
||||
type: int
|
||||
required: false
|
||||
default: -1
|
||||
Loading…
Add table
Add a link
Reference in a new issue