Commit graph

105 commits

Author SHA1 Message Date
Mega Mind
5d1c083959 Added toggle and removed a param 2020-10-12 23:42:01 +08:00
Mega Mind
b5e1c8a7ad New behavior for ext power control 2020-10-12 23:42:01 +08:00
Joel Spadin
7798c974f6 fix: don't leak bt_conn refs
bt_conn_lookup_addr_le() gives us a new reference that must be released
with bt_conn_unref()
2020-10-11 17:04:34 -05:00
Okke Formsma
d38740cebf
Add timestamps to position and behavior events (#147)
* Add timestamps to position events and behaviors.

- Take original event timestamps into consideration so nested tap-holds have proper timing.
- Add position and timestamp to keycode state changed event so the one-shot behavior can properly identify other keypresses and timings.
- Add timestamp to position events received from peripheral

* reduce number of arguments to behaviors
2020-10-10 17:32:53 -04: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
12b9a37005
Merge pull request #211 from petejohanson/core/keymap-port-event-exploration
Use PORT events for kscan matrix interrupts, add option for deep sleep.
2020-10-06 17:32:35 -04: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
7d222e1553
Merge pull request #237 from ChaosinaCan/direct-gpio-fix
Fix direct GPIO when using interrupts
2020-10-04 23:04:16 -04:00
Pete Johanson
bbf5a5905a refactor(usb): Report USB status w/o HID output. 2020-10-04 21:56:09 -04:00
Joel Spadin
fc5915b200 improvement(kscan): use ARRAY_SIZE macro 2020-10-04 14:07:14 -05:00
Pete Johanson
307a8d09db feat(usb): Function to access latest USB status.
* To be leveraged by upcoming power
  management work.
2020-10-01 17:18:01 -04:00
Pete Johanson
191a2d755a chore: clang-format the codebase.
* Use the LLVM style
* Override indent width (8) and column limit (100)
* Fixes #142.
2020-09-14 00:10:34 -04:00
Pete Johanson
4658999e31 fix(bluetooth): Reject pairing to taken profiles. 2020-09-13 22:33:31 -04:00
Pete Johanson
6c8b0b53f0 refactor(bluetooth): More concise names. 2020-09-13 22:33:31 -04: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
e88d0833c5 fix(bluetooth): Log when clearing on start. 2020-09-13 22:33:05 -04:00
Pete Johanson
b103eb4b05 fix(bluetooth): Delete any previously stored name. 2020-09-13 22:33:05 -04:00
Pete Johanson
13842a8a1e fix(bluetooth): Kconfig to clear bonds on start 2020-09-13 22:33:05 -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
Pete Johanson
68e72f9275 fix: Switch to single AUTHORS file.* Closes #164 2020-09-10 10:24:23 -04:00
Okke Formsma
c9a82d71d0 fixes for feedback round 2 2020-09-02 16:41:39 +02:00
Okke Formsma
c5ca664411 some fixes based on feedback 2020-09-02 15:26:06 +02:00
Okke Formsma
c33931c72c Initial implementation of hold-tap 2020-09-01 19:41:08 +02:00
Cody McGinnis
639a338c2d fix(core): track layer state with keypress 2020-09-01 09:49:21 -04:00
Cody McGinnis
033bb7bfc4 fix(behavior): add logging to toggle layer for tests 2020-08-28 16:21:31 -04:00
Cody McGinnis
5b21f15a0a fix(test): off by one error with kscan processing 2020-08-28 16:21:31 -04:00
Cody McGinnis
f02fa01e9a fix(test): change the layout 2020-08-28 16:21:31 -04:00
Cody McGinnis
cbea2d5bed fix(behavior): none should not be transparent 2020-08-27 23:12:56 -04:00
Okke Formsma
ebc3542aa6 fix bug in modtap bahavior which cleared the wrong keycode events 2020-08-23 14:46:52 +02:00
Pete Johanson
805ea77005 feat(behaviors): Add &bootloader behavior.
* Allow reset behavior to have a type property.
* Add `bootloader` node that triggers DFU UF2
  bootloader mode using the AdaFruit nrf52
  bootloader.
2020-08-21 11:23:45 -04:00
Pete Johanson
6ca8e673ac fix(bluetooth): Typo for closed conditional. 2020-08-20 00:01:59 -04:00
Pete Johanson
a65b746a86 fix(bluetooth): Add unpair combo if DT node exists 2020-08-19 23:34:34 -04:00
Pete Johanson
0d3cfa8596
Merge pull request #99 from petejohanson/core/bluetooth-unpair-magic-combo
Add magic combo for unpairing BT devices on start.
2020-08-18 19:21:43 -04:00
Pete Johanson
66c4b7ebb0 fix(usb): Restore write semaphore, release it on write failures. 2020-08-18 17:13:32 -04:00
Pete Johanson
05235ca96d fix(bluetooth): Stop peripheral half advertising once connected. 2020-08-18 16:18:16 -04:00
Pete Johanson
c054feb3c9
Merge pull request #100 from petejohanson/behaviors/add-none
Add `&none` behavior.
2020-08-18 14:31:20 -04:00
Pete Johanson
63e02d60dc feat(behaviors): Add &none behavior 2020-08-18 14:28:11 -04:00
Cody McGinnis
50643b2c56 fix(keymap): add brackets around if statement body 2020-08-18 14:21:39 -04:00
Cody McGinnis
7facb6eee8 fix(keymap): move the toggle layer logic to keymap.c 2020-08-18 14:02:25 -04:00
Cody McGinnis
a82f990d4c feat(keymap): allow users to toggle layers 2020-08-18 14:02:24 -04:00
Pete Johanson
4402e4fbc7 feeature(bt): Add "unpair combo" on startup.
* Especially for splits, we need the ability to
  unpair all paired devices as  sledgehammer
  if we need to "reset things", and doing so via
  keymaps isn't suitable.
* Allows shields to define a collection of key
  positions that if all held 2 seconds after
  startup, will unpair all existing pairs for the
  device.
2020-08-18 13:17:10 -04:00
Pete Johanson
d7dee20e8d Add missing license header. 2020-08-18 09:56:25 -04:00
Pete Johanson
e5ba03f088 Revert "Merge pull request #93 from careyk007/main"
This reverts commit 8cd8933c87, reversing
changes made to 3f1dfbaad1.
2020-08-17 23:23:30 -04:00
Pete Johanson
24836cdde8
Merge pull request #94 from Nicell/split/default-conn-fix
Create proper fix for split default connection bug
2020-08-16 23:00:19 -04:00
Nick
087574f607 Create proper fix for split default conn bug 2020-08-16 15:36:43 -05:00
Kellen Carey
5b4e5a30c4 remove unnecessary include 2020-08-16 12:51:06 -07:00
Kellen Carey
25c8a26998 wait before sending HID report 2020-08-16 12:49:08 -07:00
Pete Johanson
7e8a07e693 Remove use of printk. 2020-08-14 16:45:05 -04:00
Pete Johanson
3127192720 Invoke called behavior after layer change.
* If you press a key with a layer active, then
  deactivate the layer (e.g. releasing a `&mo`,
  then release the key, we currently may send
  the wrong key release event.
* Fixes #67.
2020-08-09 12:30:47 -04:00