Commit graph

1333 commits

Author SHA1 Message Date
crides
4e3d73eb0c add: LED widgets 2024-07-28 22:48:39 -07:00
Peter Johanson
8c6bda260a fix: Proper behavior metadata for key repeat/toggle 2024-07-05 15:38:04 -06:00
Peter Johanson
3694ff85a0 fix: Fix up layer metadata, move to layer IDs.
* Studio will use stable layer IDs to refer to layers, so that
  layer reordering doesn't affect behavior bindings, so update to match.
* Fix a few layer metadata entries that missed being refactored.
2024-07-05 13:13:42 -06:00
Peter Johanson
e01f13f9f0 fix: Fix external power settings load issue.
* Because settings load is delayed now, enable external
  power on init, and let it be disabled on settings load
  later, to ensure power is on early for
  other peripheral initialization.

Fixes: #2361
2024-07-04 17:20:40 -06:00
Peter Johanson
82eed0f5dd feat(boards): Add flash/settings to XIAO RP2040.
* Add storage partition.
* Default necessacy Kconfig symbols for flash/settings.
2024-07-03 16:57:22 -06:00
Peter Johanson
5fcf092901 refactor(shields): Set ZMK Uno physical layouts.
* Add physical layout definitions for uno and split uno shields.
2024-07-03 16:52:05 -06:00
Peter Johanson
74f7fe921b fix(splits): Increase split notify stack size. 2024-07-03 16:52:05 -06:00
Peter Johanson
0438cb0ee5 feat(kscan): More complete PM support to drivers.
* Update our GPIO kscan drivers to more completely support PM device,
  by doing proper hardare init/deinit in the PM action hook.
2024-07-03 16:52:05 -06:00
Peter Johanson
c5cca5b34f feat: Add keyboard physical layout system.
* Add bindings to allow creating multiple physical layouts that specify
  their key's physical attributes, and the matching matrix transform
  and dependant kscan to use.
* Synthesize a basic physical layout if none specified, for backwards
  compatibility.
* Update matrix transform API to explicitly pass in the selected transform
  to the API instead of using a fixed chosen transform.
* Move kscan subscription and handling into the physical layout code, so
  that selecting a different physical layout at runtime can also use the
  correct kscan instance.
* Add `physical_layouts.dtsi` file to include so you can use the
  pre-configured `&key_physical_attrs` for adding you layout keys.
2024-07-03 16:52:05 -06:00
Peter Johanson
80173f8ea3 fix: Improve startup time with proper settings loading.
* Avoid doing duplicate calls to setings_load_subtree, which iterates
  NVS fully each time under the hood, and instead use on settings_load
  later in the lifecycle.
2024-07-03 16:24:17 -06:00
Peter Johanson
f18974e8c4 fix: Adjust hid indicator listeners for event refactor
* Avoid static listener to prevent subscription
  issue.
2024-07-01 12:32:04 -06:00
ReFil
f2ea1da036
fix(boards): Suppress devicetree warning
nRF5x boards throw a spurious warning for duplicate unit-address when the devicetree gets processed

Upstream issue:  https://github.com/zephyrproject-rtos/zephyr/issues/29713

Warning suppressed as per: https://docs.zephyrproject.org/latest/build/dts/intro-input-output.html
2024-06-30 12:59:46 -04:00
Peter Johanson
96e55c8be6 fix: BLE refactor mouse keys fix. 2024-06-28 17:48:45 -06:00
Peter Johanson
483a4930e9 feat(behaviors): Add local ID system for behaviors
* Add a new feature for tracking a given behavior by a new concept
  of a "behavior local ID" which is a stable 16-bit identifier for
  a given behavior, that is resilient to new behaviors being added
  and requires no additional work on the part of the behavior
  authors.
* Add implementations for either settings lookup table, or CRC16
  hashing of behavior device names for generating behavior local
  IDs.
2024-06-28 15:10:32 -06:00
Peter Johanson
f7c34c70ba refactor(ble): Extract API to get active profile connection.
* Add `struct bt_conn *zmk_ble_active_profile_conn(void)` function for
  fetching a connection for the current profile.
2024-06-28 14:43:17 -06:00
Peter Johanson
b576d52d58 feat(core): Support adding subs to other listeners.
* Used for ZMK Studio event remappers to be sure the one
  RPC event listener subscribes to their mapped events.
2024-06-28 14:36:25 -06:00
Peter Johanson
49f7275beb fix: Add metadata to missed behaviors. 2024-06-25 12:11:32 -06:00
Timoyoungster
10d03ca46c fix: adding option to separate implicit mod release from key release
This adds a new config value `ZMK_HID_SEPARATE_MOD_RELEASE_REPORT`
where, if enabled, the report for a key release is sent separately to
the accompanying modifier release signals, which are then sent in a
second report.

This fixes an issue where certain applications are unable to work with
implicitly modified keys (e.g. colon) due to them registering the
modifier release prior to the actual key release.

Have tested this on my personal keyboard and `wev` now shows the signals
in the correct order.

=> **Previously:** ```LSHIFT (pressed) -> colon (pressed) -> LSHIFT
(released) -> **semi**colon (released)```

=> **Now:** ```LSHIFT (pressed) -> colon (pressed) -> colon (released)
-> LSHIFT (released)```

(This time without accidental files)
2024-06-24 14:26:14 -06:00
Peter Johanson
3e2c428fca chore: Add rp2040/USB logging core coverage.
* Include an rp2040 core build target, and include USB logging snippet
  for completeness.
2024-06-24 11:11:51 -06:00
Peter Johanson
03099b04b6 feat(behaviors): Add behavior metadata information.
* For upcoming ZMK studio work, make a set of rich metadata available
  to provide a friendly name for a behavior, and allow super flexible
  descriptions of the parameters the behaviors take.
* Add ability to validate a zmk_behavior_binding against
  the behavior metadata available.
2024-06-24 11:08:00 -06:00
Peter Johanson
7cdf1e42ea fix: Actually add the zmk-usb-logging snippet.
* D'oh.
2024-06-24 10:54:07 -06:00
Peter Johanson
7be955ff72 fix(usb): Ensure USB init is last
* To avoid USB init issues due to other initialization disrupting
  USB setup, move USB setup to a lower priority.
2024-06-21 13:29:12 -06:00
Peter Johanson
a080b5287f refactor: Remove static CDC ACM logging nodes.
* To avoid spurious CDC ACM instances when usint CDC ACM for something
  other than logging, move to the approach used by Zephyr of using a
  snippet to redirect console output to a CDC ACM node added by the
  snippet. Remove all the existing static CDC ACM nodes.
* Add new `zmk-usb-logging` snippet that mirrors the upstream
  `cdc-acm-logging` snippet, but still does our extra USB logging
  configuration.
* Updated logging docs accordingly.

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2024-06-20 12:06:13 -06:00
German Gutierrez
2ee76be6fe
fix(soft_off): central waits 100ms in split if hold_time enabled 2024-05-13 17:43:35 -04:00
Joel Spadin
f0b20c1c93 feat(boards): Add nRF52 high voltage DC/DC config
Added a Kconfig option to enable SOC_DCDC_NRF52X_HV for nice_nano_v2
and mikoto. According to Nordic's documentation, the DC/DC regulator is
more efficient than the LDO regulator, so this is enabled by default.

The following boards do not support this mode and were not changed:

- nice_nano
- nice60
- nrfmicro_11, nrfmicro_13
- nrf52840_m2
- bluemicro840

I could not find schematics to confirm whether the following boards
support this mode:

- bt60_v1, bt60_v2
- bt65_v1
- bt75_v1
- corneish_zen_v1, corneish_zen_v2
- pillbug
- puchi_ble_v1
- s40nc
2024-05-13 14:14:50 -07:00
Horu
7d1f84e3eb
chore: fix typos in various places 2024-05-13 16:47:33 -04:00
ReFil
2423136788 fix(boards): Fix pulls on ZMK uno toggle switch
The devicetree pulls always add on to the extra pulls configured by toggle mode, so these should not have pulls defined in the devicetree. Saved ~200uA avg on another board with a 3t toggle switch
2024-05-03 06:55:43 -07:00
Peter Johanson
af908826cd fix: Initialize sideband kscan in APPLICATION.
* In order to be sure the rest of the system is fully ready before
  intializing, because init may result in immediate events being
  triggered when used with toggle direct kscan inner devices.
2024-05-01 11:35:54 -07:00
German Gutierrez
d1ad34761a
fix: shortening keymap_soft_off behavior node
* Shorten the soft off node in order for it to work across splits.
2024-04-29 12:22:40 -04:00
Jarryd Tilbrook
0d3a4b7bbb
fix(underglow): Correctly set underglow state
This fixes a bug introduced in #2244
2024-04-25 07:26:26 -07:00
Pablo Martínez
4d566853af
fix(rgb): auto-off logic 2024-04-25 04:55:42 -04:00
Sadek Baroudi
f4a070aacf fix(boards): nrf boards missing SPI in pinctrl and dtsi, requiring users to manually define in their shield definitions if they wanted to use SPI 2024-04-25 00:54:44 -07:00
Peter Johanson
16e92cf665 fix(behaviors): Add multiple soft-off instances properly.
* Properly pass the node id for the unique
  soft-off behavior instance when defining it.
2024-04-17 23:53:12 -07:00
Keeley Hoek
e22bc7620c fix(hid): Correct off-by-one buffer overflow with NKRO 2024-04-09 23:20:20 -07:00
Xudong Zheng
849eca7228 refactor(underglow): fix uninitialized variable warning 2024-04-09 15:57:34 -07:00
Tobias Arndt
fe509c466f fix(kscan): Enable charlieplex interrupts for single compatible device
Fixes #2201
2024-03-30 19:13:39 -07:00
Peter Johanson
fff1cbecdc fix: Add wakeup-source; to kscan nodes for ZMK_SLEEP.
* ZMK_SLEEP also enables PM_DEVICE, so be sure to mark kscan
  nodes as wakeup sources so they can wake keyboards from sleep.
2024-03-29 12:31:43 -07:00
Peter Johanson
29c0cdb3ab fix(shields): Fix for direct use with ZMK Uno split. 2024-03-27 20:59:26 -07:00
Peter Johanson
7e7110d85f fix(pm): Fixes for dedicated on/off on peripherals.
* Add new flag to differentiate soft off on peripherals that
  is invoked by split GATT svc and dedicated additional ones
  tied to GPIO pin.
2024-03-27 20:59:26 -07:00
Peter Johanson
41d81801ed fix(pm): Use Zephyr created device slots.
* Avoid overwriting random memory by using
  iterable section created by Zephyr PM.
2024-03-27 20:59:26 -07:00
Peter Johanson
d0e0ecb4e3 refactor: Use kscan directly to wake when we can.
* When adding a dedicated GPIO pin for soft off/on, use the direct
  kscan as the waker, instead of adding an additional node.
2024-03-27 20:59:26 -07:00
Peter Johanson
2df6dcd973 feat(behaviors): More logging in soft off. 2024-03-27 20:59:26 -07:00
Peter Johanson
bb94a7aafe fix: Fixes for building soft off without deep sleep. 2024-03-27 20:59:26 -07:00
Peter Johanson
8d54e287f0 fix: Adjustments for Zephyr 3.5. 2024-03-27 20:59:26 -07:00
Peter Johanson
bd21f41412 refactor: Fixes for review feedback. 2024-03-27 20:59:26 -07:00
Peter Johanson
5d960a758f fix: Cleanups of sideband and direct kscan from review.
* Add dedicated init priority for the sideband kscan.
* Refactor sideband code for clarity.
* Tweaks to direct kscan for clarity.
* Make sideband behavior row optional for brevity.
* Allow overriding ZMK Uno sideband behaviors.
2024-03-27 20:59:26 -07:00
Peter Johanson
4198fac90f fix(pm): Fix deep sleep with sideband behaviors.
* Properly implement the PM hook needed for sideband behavior
  kscan device to have wakeup source enabled on it.
2024-03-27 20:59:26 -07:00
Peter Johanson
09111f1cf3 fix: Sleep after clearing endpoints to wait for send.
* Add a small sleep to allow other threads to send data for the
  endpoint clearing before sleep.
2024-03-27 20:59:26 -07:00
Peter Johanson
c3144055e8 refactor(boards): Move ZMK Uno 1P3T slider to sideband
* Invoke output selection from the slider on the ZMK Uno via
  sideband behavior setup, to simplify keymap.
2024-03-27 20:59:26 -07:00
Peter Johanson
a0ad1d4c94 refactor: Add kscan sideband behavior driver
* Instead of gpio key behavior trigger, add new kscan driver that
  decorates/wraps a given kscan driver and will invoke basic system
  behavior assigned to a given row + column, without the need for keymap
  mapping in the matrix transform, bypassing keymaps entirely.
2024-03-27 20:59:26 -07:00