Commit Graph

81 Commits

Author SHA1 Message Date
Okke Formsma a61eac9139
fix(behaviors): make tap dances work on a combo
* Tap dance event handler goes after combos
* Add test
2022-11-01 15:13:19 -05:00
Peter Johanson 532c4b9267 refactor(build): Fixes for config/overlay loading.
* Move to ZephyrBuildConfig package based on Zephyr best practices.
* Support multiple shields properly, e.g. -DSHIELD="foo bar", which
  allows using existing upstream shields like `ssd1306_128x64` along
  with another ZMK shield.
* Properly *add* the "ZMK config" .conf file to the conf file list,
  so that existing board .conf files in `app/boards/<board>.conf` are
  properly honored still. Needed for overrides to usptream boards when
  combined with a local `<shield>.conf` file.
2022-06-04 00:44:13 -04:00
Caleb Goates 0d5bb100ba feat(behavior): Add key toggle 2022-06-03 00:04:41 -04:00
Peter Johanson 4f503246a3 refactor(split): cmake split clean up.
* Cleaner cmake setup for split build.
2022-05-29 19:18:09 -04:00
Peter Johanson 6539b3ae25 refactor(split): Clean up Kconfig organization.
* Seperated configs for split role (central/peripheral)
  and transport (BLE only for now).
* Split the configs to align on structure.
2022-05-29 19:18:09 -04:00
Peter Johanson 16ab6df18d feat(display): Add new peripheral status/display
* Add new API/status to track state of the
  peripheral connection to the central.
* Add new peripheral status widget for displaying
  the current status of the connection to
  the central.
2022-05-17 13:09:21 -04:00
Peter Johanson 0a40f922b5 refactor(split): Seperate peripheral BLE handling.
* Move foundational BLE code for split
  peripherals to a dedicated file to avoid
  tons of conditionals and awkward code.
2022-05-17 13:09:21 -04:00
Peter Johanson 40cd8da743 fix(usb): Split HID from core USB, logging fix.
* Split core USB init from USB HID init.
* Tweak logging to avoid "log loop" causing
  spurious buffer messages on startup.
2022-04-13 13:07:59 -04:00
Peter Johanson 79ab60dfe5 refactor: Move to new PM API/Kconfig settings. 2022-04-03 00:10:29 -04:00
Peter Johanson 6287819fcc refactor: Move to USB_DEVICE_STACK symbol.
See: https://docs.zephyrproject.org/latest/releases/release-notes-2.7.html#changes-in-this-release
2022-04-03 00:10:29 -04:00
Peter Johanson 3a6a249ad0 feat(behaviors): Add macro support.
* Fine grainted press/release/tap actions.
* TIming between actions can be controlled.
* Processed async, to avoid blocking.
2022-03-23 23:42:54 -04:00
Kurtis Lew 32ebe2cfb5
feat(behaviors): Add Tap-Dance behavior 2022-03-16 01:08:42 -04:00
Alessandro Bortolin 85b2d30bd5 feat(lighting): add backlight behavior 2022-02-05 23:40:18 -05:00
Peter Johanson 7430750428 refactor(splits): Minor cleanups to periph invocation
* Add strlcpy from public domain version.
* Leverage strlcpy to detect truncation of behavior dev strs, and log.
* Use `offsetof` for cleaner detection on peripheral side.
2022-01-31 23:03:34 -05:00
Pete Johanson 47f873b038 feature(split): behavior locality support.
* GATT characteristic allowing passng data + behavior
  label to invoke the behavior on the peripheral side.
* Behaviors have a locality setting to specify where they run.
* Build reset/power/RGB on peripheral.
2022-01-31 23:03:34 -05:00
Peter Johanson 70bb7c9334 feat(behaviors): `&key_repeat` behavior + tests.
* Add new `&key_repeat` behavior that captures and re-sends
  the most recently triggered keycode.

Closes: #853
2022-01-30 22:47:34 -05:00
Peter Johanson 54dabffd0d feat(behaviors): Add caps word (`&caps_word`).
* Add new `&caps_word` behavior that acts like caps lock, but
  releases automatically when any "break" keycode is pressed.
2021-11-28 22:41:35 -05:00
Jonathan Rascher e9140b2da9 feat(conditional-layers): Implement feature
This is a generalization of the existing concept of tri-layer support
that's already well known. Essentially, a conditional-layer
configuration activates a particular layer (the then-layer) when one or
more other layers (the if-layers) are activated.

This is commonly used on ortho keyboards to activate a third "adjust"
layer while the primary two layers ("lower" and "raise") are active.
2021-11-15 05:49:23 -05:00
Peter Johanson d05d7ec2d2 feat(endpoints): Add endpoint select changed event. 2021-08-03 00:19:05 -04:00
Ally Parker a4aaa73f06 feat: Add WPM calculator and display widget 2021-01-23 18:38:31 -05:00
Okke Formsma 5eeb310b2f feat(grave-escape): implement grave-escape
closes #85
2021-01-22 19:27:18 -05:00
Okke Formsma feb0d5b90c feat(combos): initial implementation
closes #45
2021-01-13 21:07:41 -05:00
KemoNine d207c3c30f
(feature) Add &to keycode/behavior (#489)
feat(behaviors): Add `&to` behavior to switch to a layer.
2020-12-29 11:57:49 -05:00
Pete Johanson 4db5b169bf refactor(splits): Ability to override split role.
* Move central/peripheral setting to Kconfig.defconfig
  files to allow left/right .conf files to override
  central/peripheral role for splits.
2020-12-28 10:16:24 -05:00
Nick Winans 69d48c5715 refactor(settings): Only load used subtrees 2020-12-14 22:46:49 -05:00
Pete Johanson f7c16dfe69 refactor(power): Extract activity/idle detection.
* Refactor power to extract more general purpose
  activity detection/events.
* Use activity state to implement PM callback.
2020-12-14 15:31:10 -05:00
KemoNine 2427a4ab33
feature(keymaps): Keymap layer state event, highest layer API
* Fire an event w/ layer number, state, and timestamp
  when a layer is activated/deactivated.
* Add `zmk_keymap_highest_layer_active()` query.

Co-authored-by: KemoNine <mcrosson@kemonine.info>
2020-12-09 09:35:57 -05:00
Pete Johanson e6a27b15c1 fix(kscan): Fix building kscan for tests. 2020-12-08 22:20:12 -05:00
innovaker 82625c6bb5 build(cmake): remove unnecessary SYSCALL_INCLUDE_DIRS for drivers
PR: #406
2020-12-04 16:53:52 -05:00
Pete Johanson b3f3362b50 feat(display): Initial widget/status screen work.
* Battery and output status widgets
* Built in status screen combining them.
* Ability to define a custom status screen factory
  function.
2020-12-02 16:04:56 -05:00
Pete Johanson d5ea426975 refactor(battery): Fire event on battery event. 2020-12-02 16:04:56 -05:00
Okke Formsma 76a6d7b4c5 feat(sticky keys): initial implementation 2020-11-28 00:58:24 -05:00
Pete Johanson 7d16186b7a fix(ble): Remove unpair combo code.
* Favor the settings reset images for this.
2020-11-10 14:53:03 -05:00
Nick 953de71646 feat(battery): Add BAS GATT reporting 2020-11-01 23:00:54 -05:00
Joel Spadin 2fe1fbb526 feat(endpoints): rename behavior to outputs
"Outputs" is probably easier for most people to understand than "endpoints".
2020-10-28 18:15:05 -05:00
Joel Spadin 600bba25f0 feat(endpoints): add preferred endpoint setting
Added a new setting to remember the user's preferred endpoint. When both USB and
BLE are connected, the preferred endpoint will be used.

Added a new behavior to control this setting. It supports commands:

    &end END_USB - Prefer USB output
    &end END_BLE - Prefer BLE output
    &end END_TOG - Toggle between USB and BLE
2020-10-28 18:15:05 -05:00
Joel Spadin 1d369ffa73 feat: only send HID reports to one endpoint
Added some utility functions and an event for tracking the state of the
USB connection.

Updated endpoints.c to select a single endpoint to send HID reports to
based on the status of the USB and BLE connections. Partially fixes #206.

Future commits will add a user setting to control which endpoint is used if
both USB and BLE are ready.
2020-10-28 18:15:05 -05:00
Pete Johanson ef37f17796
Merge pull request #109 from Nicell/underglow/state-persistence
Add RGB underglow state Kconfig and settings
2020-10-18 22:29:55 -04:00
Mega Mind b5e1c8a7ad New behavior for ext power control 2020-10-12 23:42:01 +08:00
Mega Mind 4d81b10ba7 Added driver to control the external power output
This PR adds support to control the external power output from controllers like nice!nano, nRFMicro etc

I have implemented based on my understanding of Pete suggestion on this feature.

Testing done:

    Tested by enabling and disabling the ext_power from application and verified
    Verified the application does not crash with boards that does not have ext_power support
    Note:
    I did not test this in nice!nano since I don't have the boards. Will get help from others once the behavior PR is up

Next Steps:

    Create a behavior PR to control enable/disable ext_power
2020-10-10 08:11:46 +08:00
Pete Johanson a7496ab064 feat(power): Initial deep sleep work.
* New ZMK_SLEEP Kconfig symbol to enable the functionality.
* Switch to PORT events that allows wake from deep sleep.
* Initial basic power management policy, with idle ms,
  and ignoring deep sleep if we detect a USB connection.
2020-10-06 17:24:36 -04:00
Pete Johanson bbf5a5905a refactor(usb): Report USB status w/o HID output. 2020-10-04 21:56:09 -04:00
Nick 18d21b0362 Merge remote-tracking branch 'upstream/main' into underglow/state-persistence 2020-09-15 14:41:59 -05:00
Pete Johanson 39f980a06d feat(bluetooth): Add back profiles, split fixes.
* Add back in profiles, not using Zephyr
  BT identity infrastructure.
* Restore additional `&bt` commands for profile
  operations.
* Fix for split pairing and subscriptions, since
  Zephyr persists subscriptions across connects.
* Remove keymap from peripheral builds, reduces
  firmware size, and avoids unneeded attempts
  to send HID data.
2020-09-13 22:33:29 -04:00
Pete Johanson fc0812bd2e fix(bluetooth): Remove identity, minimal `bt`.
* Simplify the `bt` behavior to one current command
  `BT_CLEAR_BONDS_CMD`.
* Simplify BLE code for split and non-split keyboards.
* Remove keymap processing from split peripheral side.
2020-09-13 22:33:05 -04:00
Pete Johanson cf970efb98 feat(bluetooth): Proper bond management, identity support for non-splits
* Add `bt` behavior that can be used to perform certain actions,
  such as next/prev identity, reset identity, etc.
  NOTE: Multiple identities is only supported for non-split shields,
  due to missing Zephyr identity functionality for dual
  central/peripheral devices.
* Proper bond reset tied to action, that honors peripheral bonds,
  so folks can reset and pair to other hosts, without breaking
  bonds between splt halves.
2020-09-13 22:33:05 -04:00
Okke Formsma c33931c72c Initial implementation of hold-tap 2020-09-01 19:41:08 +02:00
Okke Formsma 21fcab208e stop on fatal errors 2020-08-31 22:24:36 +02:00
Nick 979a5bffff fix(rgb): check if settings enabled 2020-08-23 15:56:18 -05:00
Nick c5c21022a2 Move settings load 2020-08-23 10:33:19 -05:00