Commit graph

1537 commits

Author SHA1 Message Date
24949fe134 fix: don't wake RGB on layer change when user toggled off 2026-07-01 22:37:13 +08:00
a36c7f26f8 feat: expose persistent effect lifecycle, wakeup, fade-delay, idle hooks
Core API additions for full parity with darknao fork behaviors:

- ZMK_RGB_EFFECT_PERSISTENT flag: effect persists across RGB on/off
- on_idle(bool awake) callback: effect controls sleep/wake behavior
- is_active() callback: get_state returns on || effect->is_active()
- zmk_rgb_request_refresh_wakeup(bool): conditional wake from sleep
- zmk_rgb_set_tick_delay(int): delayed tick restart for fade-delay
- zmk_rgb_is_on(): exposed state query for modules
- state.layer_enabled restored: persistent effects survive RGB toggle
- auto_state delegates to on_idle for effects that implement it
- select_effect sets layer_enabled for PERSISTENT effects
- transient_off no longer calls on_deselect (only true deselect does)
2026-07-01 15:16:52 +08:00
8f3c4d3929 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.
2026-07-01 14:29:24 +08:00
d94d1597c1 fix: paint layer colors on effect entry and RGB toggle
- select_effect: clear pixels + paint current layer when entering effect #4
- select_effect: restart tick timer when leaving effect #4 for normal effects
- on: paint current layer when toggling RGB on while on effect #4

Fixes: underglow stuck on old colors, frozen display until layer switch,
cycling effects requiring off/on toggle.
2026-06-25 15:32:31 +08:00
89a8f1e664 fix: disable fade animation in layer indicator effect
The effect_layer() tick handler was fading all pixels to black every
frame, then calling transient_off() which killed RGB entirely. Layer
colors are static — set by set_layer() on layer change events. No
per-frame animation needed.
2026-06-25 14:55:25 +08:00
9ab9c4619f fix: extend EFF_START range to include layer indicators (effect 4)
darknao added UNDERGLOW_EFFECT_LAYER_INDICATORS as effect #4 but
did not update the Kconfig range from [0,3] to [0,4].
2026-06-25 10:44:13 +08:00
aa79502d5a fix: guard ext_power usage behind CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER
The battery low-power code referenced ext_power unconditionally, causing
build failure when CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER=n.
2026-06-24 20:03:22 +08:00
a904f76092 fix: guard split_peripheral_layer_changed behind CONFIG_ZMK_SPLIT
Without this guard, non-split builds (e.g. settings_reset) fail with
undefined reference to zmk_event_zmk_split_peripheral_layer_changed.
2026-06-24 20:02:28 +08:00
darknao
28a1c4697e underglow-layer: keep RGB asleep on battery update 2026-06-24 18:57:47 +08:00
darknao
01f8f363f8 underglow-layer: add fade-delay property 2026-06-24 18:57:47 +08:00
darknao
62dc6d8ec5 underglow-layer: add battery indicators 2026-06-24 18:57:47 +08:00
darknao
0f43eeb033 fix: underglow-layer not showing on both side when powered on 2026-06-24 18:57:47 +08:00
darknao
f178f86a54 underglow-layer: use behaviors to control RGBs 2026-06-24 18:57:42 +08:00
ReFil
aa151f7473 feat(split): Compile additional events on peripheral
In preparation for the re-do of #2036 events that are useful for displays/indicators on the peripheral should be compiled on both sides so they can be raised on both sides
2026-06-24 18:55:49 +08:00
darknao
8999793d2f underglow-layer: cut off ext power if all leds are off 2026-06-24 18:55:49 +08:00
darknao
f20c011fc6 underglow-layer: enable with EXPERIMENTAL_RGB_LAYER Kconfig 2026-06-24 18:55:49 +08:00
darknao
a1d67a4e92 fix: ZMK_RGB_UNDERGLOW_AUTO_OFF_IDLE not required for underglow-layer 2026-06-24 18:55:49 +08:00
Nick Winans
bd5e07f842 feat(split): Increase split interval during idle 2026-06-24 18:55:49 +08:00
darknao
886cd1025d fix: RGB_TOG also toggle underglow-layer 2026-06-24 18:55:49 +08:00
darknao
9308ba806a underglow-layer: Don't save state on idle/resume & register activity on layer change 2026-06-24 18:55:49 +08:00
darknao
da994be0ba underglow-layer: enable only if config exists in devicetree 2026-06-24 18:55:49 +08:00
darknao
0ca086a845 underglow-layer: track layer changes with event & battery life optimization
I tried using event instead of the 25ms underglow_tick to update the underglow on
layer change only. That didn't improve the battery life much....
The second change is cutting off the led strip power if the underglow is
not defined for a layer. Power is restored if a layer with rgb is
activated, and cut off as soon as the layer is disabled.
This, on the other hand, improves the battery life a lot, especially if you
don't use rgb on your base layer.
If you are using rgb on your base layer, setting
CONFIG_ZMK_RGB_UNDERGLOW_AUTO_OFF_IDLE is highly recommended.
2026-06-24 18:55:49 +08:00
darknao
6f9a411793 underglow-layer: use devicetree & clean up code 2026-06-24 18:55:23 +08:00
darknao
01d0749411 valdur's mod 2026-06-24 18:53:46 +08:00
Donald Gordon
e1fc10651c ext_power: add Kconfig for initial ext_power state
Adds a Kconfig setting for the default EXT_POWER status at initialization time. Previously it was always initialized to on if no saved value was present.
2026-06-24 18:53:46 +08:00
Donald Gordon
954253c6f5 RGB underglow status support
Adds Glove80's status indicator using RGB underglow support. Requires ZMK
PR#999 and PR#1243.

The underglow status is able to show layer state, battery levels,
caps/num/scroll-lock, BLE and USB state. The underglow positions selected for
each of these indicators is configured using the new devicetree node
zmk,underglow-indicators, which takes an array of integer LED positions for each
feature.
2026-06-24 18:53:46 +08:00
Chris Andreae
319f03fd01 rgb_underglow: refresh more frequently for smoother RGB underglow 2026-06-24 18:53:46 +08:00
Pete Johanson
edf5c0814f
chore(main): release 0.3.0 (#2858) 2025-08-01 18:44:20 -04:00
Nicolas Munnich
c86f0d6ff4
chore: Add some basic encoder tests (#2845)
Adds some encoder tests for rotating, and basic layers.
Mock Kscans don't seem to interact nicely, slightly on the hacky side.
However, better to have hacky tests than no tests.
2025-07-31 18:29:59 -04:00
Genteure
af967667b0
fix(core): Correctly sync BAS battery level (#2977)
Fix BAS battery level showing 100% if controller boots up with 0% battery charge.

Closes zmkfirmware/zmk#2972
2025-07-31 17:51:21 -04:00
Pete Johanson
2ae5185419
fix(split): Compile and run properly in wired polling mode. (#3012)
Fixes for regressions from split refactors that broke polling mode
specifically.

Co-authored-by: honorless <86894501+lesshonor@users.noreply.github.com>
Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2025-07-31 17:09:25 -04:00
Pete Johanson
1530ae36c2
fix(split): Enable wired split by default if DTS is set (#3010)
Remove the previous condition on ZMK_SPLIT_WIRED that only enabled it if
!ZMK_BLE. We'll defer to the `depends on` to ensure the DTS exists to
use wired split to make that decision on enabling the feature.
2025-07-30 13:43:46 -04:00
Cem Aksoylar
1bac680c4f
fix(behaviors): Correct macro release state for parametrized macros (#2942)
test(behaviors): Add parametrized macro test that fails

fix(behaviors): Correct macro release state for parametrized
2025-07-29 18:39:26 -04:00
snoyer
d09087f4dc
feat(display): nice!view individual profile status (#2265)
Allow the nice!view widget to display the status of each profile by:

- not adding a circle around the number if the profile is not bound
- drawing a dashed circle around the number if a profile is bound but not connected
2025-07-26 18:46:51 +02:00
Joel Spadin
8059e671b2
fix(boards): Disable high voltage DC-DC by default (#2995)
Given a typical setup of a battery at ~4 V and a nice!nano v2 running at
3.3 V, I measured a small increase in power usage (using a Nordic PPK2)
when SOC_DCDC_NRF52X_HV was enabled. This changes the nice_nano_v2 and
mikoto boards so this option is disabled by default.

Fixes #2990
2025-07-21 17:14:29 +02:00
Tobias Adolph
342d838913
fix(ble,hid): Fix smooth scrolling over BLE (#2998)
- Use correct MIN16 value in hid report. -32768 in 2's compliment is 8000(hex)
- Initialize resolution multiplier array
- Properly implement `read_hids_mouse_feature_report`

Fixes: #2957

Co-authored-by: Tobias Adolph <43353209+adolto@users.noreply.github.comgit>
2025-07-20 09:13:18 -06:00
Dimitri Krassovski
7292df02d4
feat(shields): Add a physical layout for a_dux (#3000) 2025-07-19 21:44:05 -07:00
snoyer
fe91cc6625
refactor(ble): add functions to check if profile is open/connected by address (#2993)
Helper functions for BLE profile statuses.
2025-07-19 07:51:53 -06:00
Joel Spadin
cef7af4408
fix: Fix build with Studio and USB but not UART (#2996)
Changed CONFIG_ZMK_STUDIO_TRANSPORT_UART to automatically enable itself
whenever a zmk,studio-rpc-uart chosen node is specified. The previous
behavior of enabling if CONFIG_ZMK_USB was enabled broke builds when
CONFIG_ZMK_STUDIO was enabled but the chosen node wasn't specified.
2025-07-11 22:07:38 -06:00
snoyer
9e905d6593
feat(ble): Add function to get profile address by index (#2992) 2025-07-09 20:25:11 -06:00
Pete Johanson
6b44d33db2
feat(split): Runtime selection of split transport (#2886)
feat(split): Runtime selection of split transport

Allow building multiple split transports, and select an active
one based on the transport availability. Wired split availability
depends on additional `detect-gpios` which must be a GPIO pin
that goes active when a wired connection is present.

feat(split): Suspend/resume wired UART devices.

To better support runtime split support, suspend/resume the UART
as necessary to save power when not using the UART.

docs(split): Document adjusting nRF52 UART interrupt priorities

For wired split on nRF52, you may need to adjust the priority for UART
interrupts lower, to ensure the interrupts used for timing sensitive
BT operations can run when needed, so document this in our pinctrl docs.

refactor(split): Restore use of aync UART on nRF52.

With fixes for Zephyr UART driver, re-enable using async API on nRF52.

fix(split): Minor wired split fixes.

Various minor fixes for wired split to avoid spurious TX in half duplex,
etc.

fix: Unconditionally define HID payloads to avoid error.

Don't conditionally define HID indicator payload, to avoid compilation
errors.

docs(split): Expand on details of split transports.

Expand the split keyboard documentation with a more fleshed out section
on the available split trasnports, and what is and isn't supported by
each, including the runtime selection functionality.

---------

Co-authored-by: Nicolas Munnich <98408764+nmunnich@users.noreply.github.com>
2025-06-16 03:45:25 -04:00
badjeff
462d48b78e
feat(pointing): Allow peripheral input processing to stop propagation (#2844)
Allow peripheral input processors to prevent event propagation to centrals.

---------

Co-authored-by: Pete Johanson <peter@peterjohanson.com>
2025-06-16 02:23:25 -04:00
George Norton
239baa4875
feat(metadata): Add metadata to the mouse_key_press behavior (#2950)
Adds metadata to the mouse key press behavior so that mouse buttons can be
configured through studio
2025-06-02 14:32:18 -04:00
Cem Aksoylar
9da5d3ba82
fix(display): Make stock battery widget depend on the right symbol (#2953) 2025-06-02 07:25:08 -06:00
cormoran
461f5c832f
fix(pointing): Avoids mutex leak for default layer toggle event (#2934)
Remove unnecessary special check for toggle of layer 0,
to avoid mutex leak.
2025-05-09 20:01:17 -04:00
FearlessSpiff
ad6a181d7e
feat(shield): Add underglow for reviung5 (#2191) 2025-05-05 20:46:21 +02:00
Aasim-A
4235c8b491
chore: Add typescript support to eslint, fix errors (#2923) 2025-04-22 20:51:41 -07:00
Pete Johanson
e3030bfcc8
fix(combos): Properly clean up all old candidates. (#2928) 2025-04-22 01:17:12 -04:00
Pete Johanson
00ff486931
fix(combos): Restore prompts for two deprecated Kconfigs (#2926)
Restore prompts for deprecated combo Kconfig symbols, to avoid errors
for existing builds that set them explicitly.
2025-04-21 02:47:39 -04:00
Pete Johanson
c4ee8ab86b
refactor(combos): Reduce RAM usage, simplify config (#2849)
* Reference combos by index, not 32-bit pointers, and store bitfields
instead of arrays in several places, to bring down our flash/RAM usage.
* Use bit field to track candidate combos, to avoid needing an explicit
`ZMK_COMBO_MAX_COMBOS_PER_KEY` setting.
* Determine the max keys per combo automatically from the devicetree,
so we remove the ZMK_COMBO_MAX_KEYS_PER_COMBO Kconfig symbol.
2025-04-20 05:01:22 -04:00