Commit graph

1344 commits

Author SHA1 Message Date
Peter Johanson
d5061c5d3b fix: Make CRC behavior local ID select CRC. 2024-08-15 11:45:18 -06:00
Peter Johanson
6ae6bf78b4 fix(boards): BDN9 rev2 tweaks.
* Reduce RAM usage, no need for heap any more in ZMK.
* Don't attempt to enable FPU that's not present.
2024-08-15 11:45:18 -06:00
Peter Johanson
fb67e4603a feat: Add studio core coverage targets.
* Cover stm32, RP2040, and nRF52 builds.
2024-08-15 11:45:18 -06:00
Peter Johanson
bafe648425 feat: Add &studio_unlock behavior.
* New behavior allows unlocking the keyboard to allow ZMK Studio to
  make changes.

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2024-08-15 11:45:18 -06:00
Peter Johanson
b1bcc3e418 feat(studio): Add studio-rpc-usb-uart snippet.
* Add an easy snippet for enabling USB UART added
   to the `zephyr_udc0` standard node.
2024-08-15 11:45:18 -06:00
Peter Johanson
feda96eb40 feat(studio): Initial RPC infrastructure and subsystems.
* UART and BLE/GATT transports for a protobuf encoded RPC
  request/response protocol.
* Custom framing protocol is used to frame a give message.
* Requests/responses are divided into major "subsystems" which
  handle requests and create response messages.
* Notification support, including mapping local events to RPC
  notifications by a given subsystem.
* Meta responses for "no response" and "unlock needed".
* Initial basic lock state support in a new core section, and allow specifying
  if a given RPC callback requires unlocked state or not.
* Add behavior subsystem with full metadata support and examples of
  using callback to serialize a repeated field without extra stack space needed.

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2024-08-15 11:45:18 -06:00
LostQuasar
b42d06ecf7
chore: Update pancake shield url 2024-08-14 14:38:38 -04:00
down
895f557ae5 fix: no error return in sticky key get_parameter_metadata 2024-08-14 12:34:18 -06:00
Pete Johanson
6d50ba5553 chore: Docs review tweaks.
Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2024-08-12 16:57:54 -07:00
Peter Johanson
3fec690def feat: Add config settings for sticky keys/hold-tap
* Add new Kconfig symbols to config max held sticky-keys/hold-taps
  and for max captured events during hold-tap resolution.
2024-08-12 16:57:54 -07:00
Peter Johanson
cd25c12ce9 fix: Proper device PM support for composite kscan.
* Clean up composite kscan to allow multiple instances properly.
* Implement PM hook and properly suspend/resume the child devices.

Fixes: #2388
2024-08-03 13:45:51 -07:00
Peter Johanson
78ed721c36 fix(pm): Properly configure a wakeup as input.
* Other drivers properly disconnect/de-config pins now, so we need
  to be sure the wakeup trigger connects the wake pin as input.
2024-08-02 16:37:11 -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