Commit Graph

2421 Commits

Author SHA1 Message Date
Cem Aksoylar
55bf7cae7e feat(docs): Note how parameters are forwarded for behaviors 2023-12-06 22:46:03 -08:00
Cem Aksoylar
56d863cba6 feat(docs): Document sensor-rotate in behaviors config 2023-12-06 22:46:03 -08:00
Cem Aksoylar
2bab81a304 fix(docs): Note -var definition files for macros 2023-12-06 22:46:03 -08:00
Cem Aksoylar
76a209c728 fix(docs): Fix sticky key #binding-cells 2023-12-06 22:46:03 -08:00
Cem Aksoylar
f3ad08b619 fix(docs): Add missing page pointers in behaviors config 2023-12-06 22:46:03 -08:00
Peter Johanson
88338a9b3c feat(shields): Add ZMK Uno split setup
* Make it easier to test split code with ZMK Uno
  hardware by adding a split left/right setup as well.
2023-12-06 15:00:29 -08:00
Peter Johanson
291bbc2257 refactor(docs): New shield guide to suggest modules
* Update the new shield guide to position Zephyr module location
  as the default when creating new shields, with a note about
  using ZMK repository itself as a last resort.
* Document building with additional Zephyr modules.

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2023-12-06 09:36:37 -08:00
Peter Johanson
3656ec63d0 feat(build): Build unified config/mod repos.
* Detect in our build script if our config repo is *also* a Zephyr
  module and if so pass to ZMK build in ZMK_EXTRA_MODULES
  define.
* Copy config directory contents to new independent temp workspace
  to avoid Kconfig conflicts between the build repo's zephyr module
  directory and the checkout zephyr pulled in by `west update`.
2023-12-06 09:36:37 -08:00
Peter Johanson
efd403a567 refactor: Hook into CMake loading in a better spot.
* Shift to using an extra Zephyr module to do keymap location
  work after all board roots are resolved. This avoids duplicate work
  and allows us to load custom boards from Zephyr modules as well as
  user config setups.
2023-12-06 09:36:37 -08:00
Peter Johanson
0ab6a0ad11 feat(bt): Add new experimental Kconfig setting.
* In order to have an easy way to test and phase in BT changes, add a
  new `ZMK_BLE_EXPERIMENTAL_FEATURES` Kconfig setting.
2023-12-06 09:22:50 -08:00
Joel Spadin
17a6f0b128 refactor: Remove new uses of label property
Removed new uses of the "label" property which were introduced after
the previous commits on this branch were written.
2023-12-04 20:06:54 -06:00
Joel Spadin
0fd8e25807 docs: Document behavior name length limit
Added a section to the new behavior guide to document that the names of
behaviors invoked on the peripheral side of a split must be at most 8
characters long.
2023-12-04 20:06:54 -06:00
Joel Spadin
23ecf08119 refactor(behaviors)!: Remove labels from behaviors
Removed the label property from built-in behaviors, custom behaviors
defined in a few keymaps, and macros generated with ZMK_MACRO().

Now that node names are used to identify behaviors, and names only need
to be unique within the set of behaviors, the names of all behaviors
have been shortened to be similar to their original labels.

This means that any keymaps which reference behavior nodes by name
instead of by label will need to be updated. Keymaps typically use the
labels though, so most keymaps should be unaffected by this change.
2023-12-04 20:06:54 -06:00
Joel Spadin
36eda571b7 refactor(behaviors): Create a list to lookup behaviors
Added BEHAVIOR_DT_DEFINE() and BEHAVIOR_DT_INST_DEFINE(), which work
exactly like the DEVICE_*_DEFINE() macros, except they also register the
device as a behavior by adding a pointer to it to a memory section.

Added zmk_behavior_get_binding(), which works like device_get_binding()
except that it only searches the devices that have been registered as
behaviors. This ensures that behaviors cannot have name collisions with
other devices defined by the SoC, which will be important when we remove
the label property from behaviors so they are given their node names.

As an added benefit, this is faster since it searches a smaller list.
Some basic benchmark code I wrote indicates it takes 30-70% as long,
depending on where the behavior is in the list and whether the name
string is an exact pointer match.

From now on, behaviors should use BEHAVIOR_*_DEFINe() instead of
DEVICE_*_DEFINE(), and any code that looks up a behavior by name should
use zmk_behavior_get_binding() instead of device_get_binding().
2023-12-04 20:06:54 -06:00
Joel Spadin
5ecd3521f5 docs: Remove label property from documentation 2023-12-04 20:06:54 -06:00
Joel Spadin
d4e8dee444 refactor(keymaps): Rename layer label to "display-name"
Changed the property used to define a layer name for displays from
"label" (which affects other things in Zephyr and is deprecated) to
"display-name". (It cannot be named simply "name", because that has
special meaning in newer versions of the devicetree compiler.)

"label" is still supported as a fallback, so no changes need to be made
to existing keymaps.
2023-12-04 20:06:54 -06:00
Joel Spadin
ba5637fdef refactor: Remove unimportant labels
Removed "label" properties which no longer have any function.

Labels are still used as layer names and as identifiers for sending
behaviors between sides of a split keyboard, so those have been left
alone for now.
2023-12-04 20:06:54 -06:00
Joel Spadin
3ae9e74056 refactor(drivers): Make label property optional 2023-12-04 20:06:54 -06:00
Joel Spadin
05925c72d7 refactor(ext_power): Remove label property
Changed the label property on zmk,ext-power-generic to be optional and
removed it from existing uses. Renamed the nodes for all non-development
boards to "EXT_POWER" to preserve user settings.

rgb_underglow.c now finds the correct device by finding the first
instance of zmk,ext-power-generic instead of looking for a node named
"EXT_POWER".
2023-12-04 20:06:54 -06:00
Joel Spadin
179bdbc41a refactor(behaviors): Make label property optional
Changed all code (except for layer names) which used the label property
to use DEVICE_DT_NAME() instead, which uses the label if set or falls
back to the full node name. This matches how Zephyr determines the node
names used with device_get_binding() and allows us to start removing the
deprecated label property from things.
2023-12-04 20:06:54 -06:00
ReFil
dbe5dfb1d8
feat(split): Add is_bonded function to peripherals
There is already a function to see if the peripheral is connected, a matching one for if it's bonded is a useful addition for displays/indicators. `is_bonded` gets reset to false in the advertising function in preparation for runtime peripheral bond clearing
2023-12-04 18:31:35 -05:00
ReFil
9bacaffe62
feat(hid): Add KConfig option for higher NKRO usages
By default the maximum NKRO usage is set to maximise compatibility, but some keys dont work, this adds the ability to use those extended keys, at the cost of compatibiltity

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
Co-authored-by: Pete Johanson <peter@peterjohanson.com>
2023-12-04 18:24:05 -05:00
Cem Aksoylar
8ee3467adf fix(docs): Update outdated information in the hardware page 2023-12-04 15:22:49 -08:00
Cem Aksoylar
042e5209b3 fix(docs): Fix table for BT_DISC 2023-12-04 09:24:53 -08:00
ReFil
ecefd6d24b
fix(docs): Update backlight docs (#1894)
Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
Co-authored-by: Less/Rikki <86894501+lesshonor@users.noreply.github.com>
2023-12-04 09:21:49 -08:00
Peter Johanson
55aed8e89d feat(tests): Add ability to auto-accept test diff. 2023-12-02 17:11:45 -08:00
Peter Johanson
c63d0791d5 chore: Ensure BSIM env. variables set in devcontainer. 2023-12-02 17:11:45 -08:00
Peter Johanson
693530c2f1 feat(bluetooth): Initial nRF52 BSIM based test support.
Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2023-12-02 17:11:45 -08:00
Peter Johanson
da15564d0e feat(bluetooth): Build on ARCH_POSIX. 2023-12-02 17:11:45 -08:00
Peter Johanson
3fad4dba07 fix(bt): Passkey entry pairing fixes.
* Don't propogate any key press events while in the
  middle of passkey entry, avoid funky state on hosts.
* Handle passkey on release, not press, to ensure key *releases*
  are not accidentally sent, especially the Enter release
  at the very end of passkey entry, which can trigger
  cancel in the dialog if the keyboard is connected
  via USB to the same host.
2023-12-01 16:48:46 -08:00
Peter Johanson
329d6474ee feat(ble): Make it possible to use BT_GATT_AUTO_SEC_REQ
* Only upgrade security of new connections if BT_GATT_AUTO_SEC_REQ
  is not enabled.
2023-12-01 16:47:49 -08:00
Peter Johanson
744f70c80c feat(bt): Add support for unauth overwrite
* Properly handle the user enabling the
  `CONFIG_BT_SMP_ALLOW_UNAUTH_OVERWRITE`
  Zephyr flag and handle re-pairing to an existing taken
  profile from the same address.
2023-12-01 23:39:31 +00:00
ReFil
69f7bfb409
feat(boards): Kinesis Advantage 360 pro
Add the Kinesis Advantage 360 Pro board definition.
2023-11-27 19:09:58 -05:00
Peter Johanson
817ce8764f refactor: Move to zmk_hid_indicators_t type. 2023-11-27 16:03:18 -08:00
Alessandro Bortolin
d9bb0d7d0e feat: LED indicators on peripheral side 2023-11-27 16:03:18 -08:00
Alessandro Bortolin
4e55c5f6e9 feat: handle LED indicators report 2023-11-27 16:03:18 -08:00
ReFil
6276e973d5 feat(ble): Only update BAS when active
Subscribes to the activity changing event, will stop the battery work timer when in idle or deep sleep, restart when board goes active
2023-11-27 09:58:20 -08:00
ReFil
84b93350b8
feat(docs): Document adding USB logging to a standalone board (#2039)
Currently this is only documented in the zephyr 3.0 upgrade blog. This explicitly documents it as well as when it doesn't need to be applied (i.e. when a mcu board is already in use).
2023-11-27 09:12:33 -08:00
Cem Aksoylar
a3f30ee799 feat(build): Add support for artifact-name in build.yaml, correctly 2023-11-23 21:09:14 -08:00
Idan Gazit
f77e38f2b9
chore: Update devcontainer.json
The format has changed slightly.
2023-11-23 21:02:22 -08:00
Chris Andreae
0a4b1a6533
feat(ble): add behavior to disconnect from BLE profile
Adds new functionality and a behavior to disconnect an active BLE connection.
The motivation for this is that for some devices like phones, the presence of an
active BLE connection results in the onscreen keyboard being selected.
2023-11-20 15:00:10 -05:00
Alexander Krikun
d7d9eed317 feat(mouse): Initial mouse keys support.
* Add HID report/descriptor for a new report with mouse buttons,
  and x/y/wheel deltas.
* New mouse key press behavior for press/release of mouse keys.
* Add constants for HID main item values (e.g. data/array/absolute)
* Define and use constants for our HID report IDs.
2023-11-15 11:16:59 -08:00
ReFil
8776911da5
feat(ble): Allow disabling BLE BAS reporting
The battery reporting has been known to cause macOS computers to wakeup repeatedly. In some cases (e.g. display or custom lighting implementation) one might want to collect battery SOC without broadcasting over BLE

* Update docs/docs/config/battery.md

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2023-11-15 13:03:30 -05:00
Peter Johanson
3027b2a6e8 chore(usb): Don't enable ZMK_USB_ROOT by default.
* Some initial reports of crashes with this code enabled, so disabling
  by default for now pending further investigation.
2023-11-13 23:56:10 -08:00
Peter Johanson
f6716f869a fix(usb): Build with ZMK_USB_BOOT disabled.
* Invert the logic so `get_keyboard_report` is sane when `ZMK_USB_BOOT`
  is disabled.
2023-11-13 23:56:10 -08:00
Chris Andreae
2a1904e184
feat(boards): Add Glove80 to boards
* Add board definition for MoErgo Glove80
2023-11-14 02:08:58 -05:00
Pete Johanson
afe65ead9c Revert "feat(build): Add support for artifact-name in build.yaml"
This reverts commit c1bf35ce1d.
2023-11-13 13:51:08 -08:00
Peter Johanson
964c54139d fix(usb): Tweak how ZMK_USB gets enabled.
* Previous version of multiple overrides of the default value of ZMK_USB
  were problematic. Move to using board _defconfig files for the
  defaults for those, along with proper `depends on` for ZMK_USB that
  accounts for split and split roles.
2023-11-13 12:56:23 -08:00
Cem Aksoylar
7b4b5d4ff2 fix(docs): Fix debouncing driver support note 2023-11-13 12:37:09 -08:00
Cem Aksoylar
a5c3edd51b refactor(docs): Remove local build section in customization 2023-11-13 12:34:44 -08:00