Commit Graph

995 Commits

Author SHA1 Message Date
Peter Johanson 35e73d40f5 fix(boards): Enable direct polling for BDN9.
* BDN9 Rev2 requires direct polling,
  interrupts don't work as expected.
2022-03-24 03:51:08 +00: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
okke ad5a12a7bc fix(behaviors): Fix bug in nested sticky keys
If multiple sticky keys with quick release were nested, only the first one
was properly released. This fix makes sure all of them are released properly.

Fixes https://github.com/zmkfirmware/zmk/issues/1149
2022-03-15 23:04:45 -04:00
Krzysztof Gutkowski 459972fddd fix(boards): Adjust matrix for BT60v1 to fix the broken right Shift key
according to the diagram from the board creators, it should be RC(3,12)
instead of RC(3,13)
2022-03-14 13:01:54 -05:00
Aaron Nunley d6a2290d5e Added support for 2% Milk (Updated with metadata)
Update app/boards/shields/two_percent_milk/two_percent_milk.overlay

Co-Authored-By: Nick Winans <nick@winans.codes>
2022-03-14 01:26:24 -05:00
Carlos Filoteo 2b4d5dd7d9
feat(shields): Add elephant42 Shield Support (#1009)
* Initial Elephant42 implementation

* Add underglow feature

* Fix keymap

* Copy corne defconfig for OLED and LED

* Fix matrix positions

* Add nice_nano_v2.overlay

* Usability improvements to keymap

* Update LED length

* Delete nice_nano v1 overlay

* Remove unused conf files

* Add copyright/license headers

* PR feedback

* Try fixing formatting again

* Minor format

* More missed tabs

* Format
2022-03-14 00:51:55 -05:00
Nick Winans a1a8c30f7f Remove deprecated key codes from bat43 keymap 2022-03-14 00:43:03 -05:00
dnaq 745338dc10 feat(shield): Add Bat43 shield
See https://kbd.dailycraft.jp/bat43/ for details.
2022-03-14 00:43:03 -05:00
Kurt f1b5dc4081
fix(shields): Proper arrow comments in reference keymap
swapped the up and down arrows to reflect the bindings
2022-03-05 13:01:41 -05:00
Peter Johanson 1d5b48cb52 fix(shields): Add missing kyria_rev2.keymap
Needed for setup.sh script, which assumes the shield ID name, not
the shield dir name for downloading.
2022-02-20 16:24:55 +00:00
Peter Johanson 7b1b979461 fix(shields): Proper siblings for Kyria Rev2. 2022-02-20 16:11:50 +00:00
Peter Johanson b54128331e feat(shields): Add Kyria Rev2 shield.
* New matrix pin selections.
* New encoder pins.
2022-02-19 23:48:06 -05:00
okke cfd0d3d81a Behaviors: Add 'ignore-modifiers' option to sticky keys
To combine multiple sticky modifiers, the sticky keys must ignore
other (sticky) modifier keypresses.

This behavior is important for "callum-style mods", where all modifiers
are sticky mods.

Fixes #829
2022-02-07 14:45:07 -05:00
Peter Johanson e2a90974e3 fix(lighting): Proper split backlight support.
Ensure the backlight behavior is run globally.
2022-02-06 21:04:42 -05:00
Alessandro Bortolin 13a4515300 feat(backlight): add command to cycle brightness 2022-02-05 23:40:18 -05:00
Alessandro Bortolin 2c0fe3934d feat(backlight): add tests 2022-02-05 23:40:18 -05:00
Alessandro Bortolin ce843825e8 refactor(backlight): code cleanup 2022-02-05 23:40:18 -05:00
ReFil 5614a8bb80 feat(backlight): initial split support 2022-02-05 23:40:18 -05:00
Alessandro Bortolin 85b2d30bd5 feat(lighting): add backlight behavior 2022-02-05 23:40:18 -05:00
Lucas Uyezu 4a1254bc27 Add support for Knob Goblin shield 2022-02-03 12:02:45 -06:00
Nick Winans edbbbc7540
feat(ci): Use metadata for builds
* Build per board
* Nightly builds of all boards
* Detect board changes and build those changed
* Core set of boards/shields built otherwise.
2022-02-03 00:15:50 -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
Peter Johanson b8700eaaa1 fix(split): Fix an off-by-one error in split svc.
* Properly check end of behavior device string for null terminator.
2022-01-31 23:03:34 -05:00
Peter Johanson dbefe92ea0 fix(split): Slightly improved logging on peripherals. 2022-01-31 23:03:34 -05:00
Peter Johanson fa110488b0 fix(split): Add define for local source.
* Add `ZMK_POSITION_STATE_CHANGE_SOURCE_LOCAL` and use
  it consinstently to fix bug w/ local `&reset`, `&bootloader`, etc.
2022-01-31 23:03:34 -05:00
Peter Johanson 4d55e60adb refactor(behaviors): Always add reset behaviors.
* Don'd omit unreferenced reset behaviors, so they are always
  available in split peripherals.
2022-01-31 23:03:34 -05:00
Peter Johanson 9297c5f2b4 refactor(splits): Use index for event source.
* Track peripherals by indexes slot, with all appropiate peripheral
  state stored in the slot.
* Event sources tracked by peripheral slot index.
2022-01-31 23:03:34 -05:00
Peter Johanson e8540f17fc fix: Ensure power and underglow behaviors built.
* Remove `/omit-if-no-ref/` from the behavior nodes.
2022-01-31 23:03:34 -05:00
Peter Johanson ce3471d4fe fix(split): Add queue for running remote behaviors 2022-01-31 23:03:34 -05:00
Peter Johanson d486304f79 fix(underglow): Handle cycling effects on splits.
* Convert relative effect cycling to absolute effect selection.
2022-01-31 23:03:34 -05:00
Pete Johanson 0febaa142a refactor(split): Clean up split GATT discovery.
* Use Zephyr auto CCC discovery instead of doing it ourselves.
* Split service versus characteristic discovery into dedicated
  steps in the flow.
* Fix for not searching properly when connecting to a peripheral
  a second time.
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
Temur Beissov c74ae45e17
Lotus58 (#1090)
* lotus58 shield added

* lotus58 default keymap

* lotus58 keymap legend update

* Lotus58 keymap fix

* lotus58 keymap update

* lotus58 kb name fixed

* lotus58 keymap update
PR fix
2022-01-31 13:02:19 -06:00
Peter Johanson 52b1fd5dd3 fix(behaviors): Capture mods for `&key_repeat`
* When tracking the last keycode, also capture the currently held
  explicit modifiers to use when replaying the key later.
2022-01-30 22:47: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 ed48d1ae89 fix(ble): Restore BLE SC passkey entry for pairing.
* Handle capturing numeric inputs while pairing and sending
  final passkey once six digits entered.
2022-01-30 22:41:41 -05:00
Sam Mohr 4c317e0feb
Add support for the Clog (#1092)
* Add support for the Clog

* format DTSI definition

* add a default keymap

* update copyright year, reduce conf to minimum
2022-01-30 14:55:22 -06:00
iangus 4039a50ec3
Add Contra shield (#633)
* Add Contra Shield (#1)

* Add bluetooth control layer to contra keymap (#2)

* fix contra keymap issues

* add bluetooth control layer

* clean up contra files

* add contra.conf file

* add missing bracket for default_layer

* update copyright year to 2021

* add contra metadata file

* refactor pro micro overlay for new syntax
2022-01-30 13:48:35 -06:00
David Fiander 970e63bec6
fix(boards): Properly use dfu-util to flash DZ60 2022-01-12 21:36:08 -05:00
zhiayang d29236141e
fix(boards): Proper active high and init delay for Mikoto ext-power 2022-01-11 16:07:30 -05:00
okke f692d64d05 test: print test output immediately and decrease indenting 2022-01-04 23:59:25 -05:00
okke d59797ba13 test: Change length of fail and pend messages
This makes scanning the output from "west test" easier, as the different states get different output lengths.
2022-01-04 23:59:25 -05:00
okke f767abe136 chore: make west scripts more pythonic and apply Black 2022-01-04 23:59:25 -05:00
Midge 't Hoen e0620f1a2d Bump init delay to 50ms for nico-nano 2022-01-03 14:39:42 -06:00
Lucas Yunkyu Lee 2666bd622c fix(keymaps): add row-offset property to matrix-transform 2021-12-20 06:14:35 -05:00
Alexander Krikun 7b023affbd
Add support for the Jiran (#1048)
* initial files to get stuff working

* Keymap by Ladniy

* Format update to new standards

* keymap update

* header

* Fixed transform, removed left and right .conf files

* Apply suggestions from code review

Formatting

Co-authored-by: Nick Winans <nick@winans.codes>

Co-authored-by: Nick Winans <nick@winans.codes>
2021-12-14 11:32:59 -06:00
Peter Johanson af98a3fd6e fix(shields): Don't enable SSD1306 automatically.
* Fix Murphpad conditional to ensure SSD1306 driver isn't
  enabled whenever `ZMK_DISPLAY` is enabled.
2021-12-13 17:06:46 -05:00
Kyle McCreery 569a2ee2cc
[New Shield] Murphpad (#806)
* initial commit

* initial commit

* Encode, OLED, and RGB Nice Nano support added as well as refining default keymap.

* tweaking keymap

* Prepared murphpad for PR. Includes adding support for second encoder, OLED, and underglow RGB

* Enabled OLED by default.

* removed naked60 config files

* Per PR feedback from ZMK maintainers, added hardware metadata file and renamed Pro Micro pins.

* removed tabs from keymap and replaced with normal spaces

* Update app/boards/shields/murphpad/murphpad.keymap

Co-authored-by: Nick Winans <nick@winans.codes>

* Update app/boards/shields/murphpad/murphpad.zmk.yml

Co-authored-by: Nick Winans <nick@winans.codes>

* Update app/boards/shields/murphpad/murphpad.zmk.yml

Co-authored-by: Nick Winans <nick@winans.codes>

Co-authored-by: honorless <86894501+lesshonor@users.noreply.github.com>
Co-authored-by: Nick Winans <nick@winans.codes>
2021-12-13 14:41:35 -06:00
Felix Sargent df1ae494c7
Add boardsource5x12 (#1027)
* Initial commit of boardsource5x12

* Added copyright/license header

* Update app/boards/shields/boardsource5x12/Kconfig.defconfig

Co-authored-by: Pete Johanson <peter@peterjohanson.com>

* Update app/boards/shields/boardsource5x12/boardsource5x12.overlay

Co-authored-by: Pete Johanson <peter@peterjohanson.com>

* Update app/boards/shields/boardsource5x12/Kconfig.shield

Co-authored-by: Pete Johanson <peter@peterjohanson.com>

* Update app/boards/shields/boardsource5x12/boardsource5x12.keymap

Co-authored-by: Pete Johanson <peter@peterjohanson.com>

* Swapping keymap for what used in Naked60 as it's another 60 key board, so it keeps it consistent.

* Update app/boards/shields/boardsource5x12/boardsource5x12.keymap

Co-authored-by: Nick Winans <nick@winans.codes>

* renamed layers in boardsource5-12

Co-authored-by: Pete Johanson <peter@peterjohanson.com>
Co-authored-by: Nick Winans <nick@winans.codes>
2021-12-13 14:24:21 -06:00
Ryan Butler eca051efa0
Add support for keeb.io fourier split keyboard (#1056)
* Add support for keeb.io fourier

* Update app/boards/shields/fourier/fourier_right.overlay

Co-authored-by: Nick Winans <nick@winans.codes>

* Update app/boards/shields/fourier/fourier_left.overlay

Co-authored-by: Nick Winans <nick@winans.codes>

* Convert spaces to tabs in .dtsi

Co-authored-by: Nick Winans <nick@winans.codes>
2021-12-13 13:41:52 -06:00
Sam Mohr b23934cf94
feat(shields): Add Osprette 2021-12-10 13:20:52 -05:00
Kyle McCreery a8c7cf4f19
feat(boards): Add S40NC board definition (#1021)
* initial commit

* initial commit

* Encode, OLED, and RGB Nice Nano support added as well as refining default keymap.

* tweaking keymap

* Prepared murphpad for PR. Includes adding support for second encoder, OLED, and underglow RGB

* Enabled OLED by default.

* Initial commit with settings updated to match schematic.

* Removing test directories.

* removed naked60 config files

* Fixed dogbone definitions to be full working for murphpad.

* Preparing S40NC for PR

* Removed the murphpad test files that were not supposed to be a part of this PR.

* Changing licensing to be from The ZMK Contributors.

* Changed the licensing in the keymap file to be from The ZMK Contributors

* Update s40nc.keymap
2021-12-02 17:21:35 -06:00
toddmok 9148ffd05d
feat(shields) Add Redox Shield Support (#1002)
* Add redox shield support

* typo

* Pull request fixes

* requested changes

add underglow, add copyright, remove display

* remove because of no display

* comment fix

* bt clear
2021-12-02 12:51:27 -06:00
Peter Johanson 6ef1e7034f fix(hid): Implicit mods on non-key page events
* Properly send the KEY usage page report for modifier changes
  when there are state changes to other usages pages that
  include implicit modifiers.
2021-12-02 07:18:25 -05:00
ReFil b877410379 fix(boards): BT60 Formatting tweaks 2021-11-30 15:33:12 -06:00
ReFil 99c5a8ee6f feat(boards): Add BT60 Boards 2021-11-30 15:33:12 -06:00
Josh Johnson 66f90dae3a
feat(shield) Add Chalice support (#1022)
* add chalice

* add split bs transform

* Update app/boards/shields/chalice/chalice.zmk.yml

Co-authored-by: Nick Winans <nick@winans.codes>

Co-authored-by: Nick Winans <nick@winans.codes>
2021-11-29 11:39:46 -06:00
Cem Aksoylar b9a35c6ae7 fix(keymaps): Locate shared conf and overlay for split boards. 2021-11-29 07:56:29 -05:00
Nick Winans 0b44321613 fix(shields): Fix typo on Quefrency .zmk.yml 2021-11-29 00:52:57 -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 30ed237533 test(conditional-layers): Add tests for edge cases 2021-11-15 05:49:23 -05:00
Jonathan Rascher 6cd1734851 test(conditional-layers): Add interleaved up/downs 2021-11-15 05:49:23 -05:00
Jonathan Rascher a908396013 test(conditional-layers): Add multi-config tests 2021-11-15 05:49:23 -05:00
Jonathan Rascher df110beac4 test(conditional-layers): Add basic unit tests 2021-11-15 05:49:23 -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 f8018b22d0 fix(hid): Basic consumer code fixes for signed logical max.
* Logical max values are signed, so for the report descriptor, use a two
  byte logical max descriptor item to impart proper 0xFF max logical
  value.
2021-11-09 10:38:49 -05:00
Viet (Drake) Tran c412fad40d
fix(shields): Fix some keycodes in reviung41 keymap
Notice some keycodes are not matched with the expected keys.
2021-11-09 10:26:21 -05:00
jding 4e62319982 feat: hold/tap flavor tap-unless-interrupted
Implements new hold/tap flavor, tap-unless-interrupted
Adds tests
Adds docs
2021-11-09 01:07:05 -05:00
Hai-Ninh Dang f2e0642291
feat(boards): Add Mikoto board
* Supports selecting from several possible charge currents

Co-authored-by: Pete Johanson <peter@peterjohanson.com>
2021-11-09 00:57:24 -05:00
Peter Johanson 0b0b49d626 fix(split): Properly rediscover peripherals.
* Handle disconnects of peripherals, and properly clean up
  and resume discovering for when the peripheral re-appears.
2021-11-04 22:31:56 -04:00
jmding8 73fd4b9230
fix(behavior): Properly break in decision switch statement.
Co-authored-by: jding <jding@roblox.com>
2021-11-01 13:51:12 -04:00
jmding8 19ee7849f8
feat(behaviors) Required keys for tap-hold behaviors
* Add optional `hold-trigger-key-positions` hold-tap configuration
* Leverage configuration for decision making around when to trigger
  hold decision in hold-taps.
* Add docs for new configuration.
* Tests for the new config/decision logic.
2021-11-01 12:37:20 -04:00
Joel Spadin f946dc6893 feat(kscan): Improve matrix debouncing
Switched the GPIO matrix driver to debouncing using a simple integrator
algorithm. Whenever a key is pressed, we now scan at a rate controlled
by debounce-scan-period-ms (default 1 ms) until all keys are released,
then return to either waiting for an interrupt or polling more slowly.

The timers for key press and release can now be controlled separately,
so debounce-period is deprecated in favor of debounce-press-ms and
debounce-release-ms. Global Kconfig options
ZMK_KSCAN_DEBOUNCE_PRESS_MS and ZMK_KSCAN_DEBOUNCE_RELEASE_MS are also
added to make these easier to set.

Added documentation for debouncing options.
2021-10-26 23:52:13 -04:00
Jonathan Rascher e3eb77dfc6 refactor(combos): Use ZMK_KEYMAP_EXTRACT_BINDING
Now that PR #506 is merged, we can address this TODO.
2021-10-20 23:36:31 -04:00
Peter Johanson e6c815f1b0 fix: Properly find boards in user config repos. 2021-10-19 13:29:36 +00:00
Peter Johanson 0dc7d46eb1 fix: Only search for board one not found yet. 2021-10-18 20:08:35 -04:00
Peter Johanson 742f4c2826 fix(keymaps): Properly locate split board keymaps.
* Find the unified keymap filename for onboard controller split
  keyboards.
2021-10-18 20:08:35 -04:00
eyenseo 6f29453041 [squash] implement feedback 2021-10-13 09:51:02 -07:00
eyenseo 51298f1d22 Add ergodash 2021-10-13 09:51:02 -07:00
Richard Kjerstadius a774ce8555 fix(display): Increase char buffer size to fit all symbols
Recent refactoring of the font handling seems to have broken the display
of the last symbol of the output status widget. From my analysis the
last symbol is truncated because the buffer simply is too small.
Increasing the buffer size to 9 fits all three possible symbols.
2021-10-12 12:00:21 -04:00
git@jrhrsmit.nl f221ff1dc7 add ranges and descriptions from #669 2021-10-11 09:46:17 -07:00
Nick Winans f23f427cae fix(underglow): Run clang-format 2021-10-10 17:43:57 -07:00
Simon Malinge c5b8dd85fd feat(underglow): Add support for configurable min/max brightness
Co-authored-by: jrhrsmit <jasper.770@gmail.com>
2021-10-10 17:43:57 -07:00
Peter Johanson bc179b1030 feat(hid): Kconfig for basic/full consumer usages.
* Add ZMK_HID_CONSUMER_REPORT_USAGES choice to allow choosing
  between full consumer usage range, with poor OS compat,
  or basic consumer usage range, with broader compat.
2021-10-04 23:01:39 -04:00
Pete Johanson 91ba034896 feat(hid): Configurable NKRO HID report support.
* Add Kconfig settings for NKRO or HKRO (boot compatible), HID
  report types for keyboard page.
* Updated report storage and set/unset for each config.
2021-10-04 23:01:39 -04:00
Aleblazer 063b496c26
feat(boards): Add Zodiark shield 2021-10-03 23:47:23 -04:00
Brandon Xie 3b8244e466
feat(shields): Add Naked60BMP shield 2021-10-03 23:23:54 -04:00
Nick Winans 687e91ab18 feat(boards): Remove usage of pro_micro_a/d nodes 2021-09-25 23:09:21 -04:00
Nick Winans 4a03214e06 feat(boards): Add D18-21 to Pro Micro pin mappings 2021-09-25 23:09:21 -04:00
Peter Johanson 014e5ba93c refactor(boards): Remove leftover right split name 2021-09-26 01:21:49 +00:00
Nick Winans 478cf94374 refactor(boards): Remove "left" from split keyboard names 2021-09-25 21:17:24 -04:00
Nick Winans 36ced48e53 refactor(boards): Remove split right keyboard names 2021-09-25 21:17:24 -04:00
Peter Johanson 3e6a3758ed refactor(display): Saner font selection/defaults.
* Only select fonts for the default built in status screen
* Leverage theme default fonts, instead of hardcoding theme
  details in each component.
2021-09-25 19:43:20 -04:00
Peter Johanson 2128b2b55f refactor(display): Output/layer/battery thread safety.
* Submit widget updates to display queue.
* Use mutex to control access to shared state for widgets.
2021-09-25 17:17:04 -04:00
Peter Johanson 063d98e3df feat(display): Optional dedicated work queue.
* Add new Kconfig settingsx to allow selecting system or dedicated
  work queue for performing UI updates.
* Allow UI updates to not block other system tasks when display is
  updating, especially important for e-ink displays.
2021-09-25 17:17:04 -04:00
Xudong Zheng 212a05feb3 fix(hog): use OR instead of AND for bitmap 2021-09-23 20:47:40 -04:00
Dom H db4bbbf9eb fix(shield): Update URL in A. Dux metadata 2021-09-23 14:57:40 -04:00
Dom H 80b01c7265 refactor(shield): "Architeuthis Dux" to "A. Dux"
The shorter name is more user-friendly.
2021-09-23 14:57:40 -04:00
Dom H 0c15c2291e feat(shield): Add Architeuthis Dux shield 2021-09-23 14:57:40 -04:00
Peter Johanson a7908a94de fix(hog): encrypt perm for HID report map/ref.
* Workaround for ensuring macOS pairing happens early enough,
  for their stack, we require encryption for the hids report map and
  report ref characteristics as well, to trigger pairing ealier in the
  connection process for macOS.
2021-09-18 15:43:26 -04:00
Pete Johanson c9a671d8d5 fix(kscan): Allow composite driver to handle missing children.
For split keyboards using an IO expander over TRRS/i2c, if the
right half isn't connected, we should be able to gracefully
fallback to the left side still working.
2021-09-14 20:48:28 -04:00
Peter Johanson e42590a049 feat(board): Add Ferris 0.2 boards
* Onboard stm32f072 with mcp23018 IO expander.
* No underglow support yet.
* Miryoku inspired default layout.
2021-09-14 20:48:28 -04:00
Pete Johanson 647110e5e5 feat(drivers): Add mcp23017 driver based on upstream mcp23s17 one.
* Upstream Zephyr has in progress driver, so doing this locally here,
  until we can move over to that driver.
2021-09-14 20:48:28 -04:00
Peter Johanson c7e513634d feat(metadata): Add YAML check/format npm scripts. 2021-09-11 00:50:36 -04:00
Peter Johanson 39eb80562d feat(metadata): Add MakerDiary nRF52840 M.2 interconnect
* Add interconnect details.
* Add m60 and nrf52840_m2 metadata files.
2021-09-11 00:50:36 -04:00
Peter Johanson 0c3f1309c6 refactor(boards): Add metadata for boards.
* Standalone and pro-micro format board metadata added.
2021-09-11 00:50:36 -04:00
Peter Johanson 2907704f9f refactor(shields): Add pro-micro shield metadata. 2021-09-11 00:50:36 -04:00
Peter Johanson b52835ffbf feat: Add a few sample hardware metadata files. 2021-09-11 00:50:36 -04:00
Peter Johanson 1d69bdda60 feat: Add hardware metadata schema.
* Initial hardware metadata JSON schema.
* GH Action to validate all schemas for boards/shields.
2021-09-11 00:50:36 -04:00
Dom H 4a5454b0f9 fix(shields): Add note about Cradio pin arrangement 2021-09-08 15:12:58 -04:00
Joel Spadin 82cb762698 refactor(kscan): Demacroify GPIO matrix driver
Refactored the GPIO matrix kscan driver so that only the data and config
structures are defined in the foreach macro. Functionality is unchanged
except for the addition of DT properties to adjust polling speed.

This should make it easier to add other enhancements later, like
improved and customizable debounce behavior.
2021-09-08 14:34:28 -04:00
Peter Johanson e491c282e7 fix(display): Add proper LVGL label dep. 2021-08-27 23:06:28 -04:00
Darryldh a124eb9f9e feat(display): IL0323 driver for EPD displays.
* Basic driver, using the GD7965 driver as a basis, since the ICs
  are very similar.
2021-08-24 22:15:42 -04:00
Martin Aumüller 08078210da fix: Planck rev 6.1
My Planck rev 6.1 would not register any keys without "col2row".
I also had to apply a matrix_transform in order to move them to the
correct position. Peeking into #228 helped for finding this.
I also add transforms for the 2u spacebar layouts.
2021-08-24 21:21:18 -04:00
Peter Johanson 08687b1709 fix(display): Update output status on endpoint selection change. 2021-08-03 00:19:05 -04:00
Peter Johanson d05d7ec2d2 feat(endpoints): Add endpoint select changed event. 2021-08-03 00:19:05 -04:00
Peter Johanson 9d34cf561e fix(usb): USB state changes in system thhread.
* Use a `k_work` to send usb status events from the system
  workqueue thread, not the USB work thread.
2021-08-03 00:19:05 -04:00
Nick Winans cf5c56c4f1 feat(boards): Use the nRF VDDH driver for the nice!nano v2 2021-08-02 21:56:53 -04:00
Nick Winans 1cafbd8069 fix(power): Manually trigger pm_low_power_devices() before sleep 2021-08-02 21:48:42 -04:00
Nick Winans 2b9deb824b feat(power): Update device power management Kconfig 2021-08-02 21:48:42 -04:00
Devon Allie f31ffd8acb
fix(shields): Clean up default corne keymap. 2021-08-02 19:12:11 -04:00
Joel Spadin a6de43e665 feat: Add nrf VDDH battery driver
Added a driver which uses the nRF52's ADC channel on the VDDH pin to
read the battery voltage when using high voltage mode.
2021-07-24 23:39:13 -05:00
Peter Johanson 65ff995033 fix(display): Avoid fault w/ LVGL API usage.
* Increment the tick from within the ISR itself.
* Don't call task handler until in the display callback.

PR: https://github.com/zmkfirmware/zmk/pull/736
2021-07-17 17:04:25 -04:00
Peter Johanson b2d64fe598 refactor(boards): Switch proton_c to newer pinmux approach.
See: https://github.com/zephyrproject-rtos/zephyr/issues/28999
PR: https://github.com/zmkfirmware/zmk/pull/736
2021-07-17 17:04:25 -04:00
Pete Johanson d7475f792f fix(boards): Enable pinmux for bdn9_rev2 by default.
See: https://github.com/zephyrproject-rtos/zephyr/issues/28999
PR: https://github.com/zmkfirmware/zmk/pull/736
2021-07-17 17:04:25 -04:00
Pete Johanson 6c23bb5c11 fix(tests): Revert default to previous formatter.
* new cbprintf formatter causes issues for our use of string formatting.

See: https://github.com/zephyrproject-rtos/zephyr/pull/29876
PR: https://github.com/zmkfirmware/zmk/pull/736
2021-07-17 17:04:25 -04:00
Pete Johanson 2a69f31eb0 refactor(core): Move away from deprecated DT API.
* Move to `DEVICE_DT_INST_DEFINE` everywhere.

See: https://docs.zephyrproject.org/2.5.0/releases/release-notes-2.5.html#deprecated-in-this-release
PR: https://github.com/zmkfirmware/zmk/pull/736
2021-07-17 17:04:25 -04:00
innovaker ad981c3bbd refactor(core): update power API to Zephyr v2.5.0
See: https://github.com/zephyrproject-rtos/zephyr/pull/29410
PR: https://github.com/zmkfirmware/zmk/pull/736
2021-07-17 17:04:25 -04:00
innovaker 71a85a0c8e feat: bump `zephyr` to `v2.5.0+zmk-fixes`
PR: https://github.com/zmkfirmware/zmk/pull/736
2021-07-17 17:04:25 -04:00
Nick Winans edb3ff1bb1 feat(boards): Add nice!nano v2 2021-07-15 18:52:28 -04:00
Okke Formsma efa497c69b fix(behaviors): Fix timing of delayed hold-tap trigger
A hold-tap timer event would be triggered too soon if the hold-tap
was delayed for longer than its tapping-term. This may cause
accidental hold behavior when the correct behavior would be tap.

By queuing the timer event instead of executing it immediately,
other delayed events get a chance to be processed properly.
2021-06-13 10:44:18 -04:00
David Barr 0f28130493
fix(shields): Cradio v2 keymap/shield improvements
* fix cradio dtsi add new keymap and readme

Co-authored-by: Dom H <dom@hxy.io>
2021-06-10 16:50:13 -04:00
Alexander Krikun e8b42221cf
fix(shields): added right alt and layer quick tap to Jian 2021-06-08 21:09:22 -04:00
Jay Greco f3bb90f9e1
fix(kscan): Fix nibble demux scan errors on encoder row
+ Add a 1us sleep to let the column selection settle in order to avoid spurious keypresses when row capacitance is high (like on the encoder row)
2021-06-08 20:59:35 -04:00
Dom H 4c1a71551b feat(keys): Add LSHIFT and RSHIFT aliases
Using LSHIFT or RSHIFT instead of LSHFT or RSHFT was a common error.
2021-06-08 20:57:40 -04:00
Jonathan Rascher 4e69a32103 fix(combos): Check each combo key, not just last
The current combo completion check only makes sure the last key in the
combo is set. This works when the combo is typed correctly initially, or
when reraising events in a combo of length two. However, it fails for
longer combos since the last event in pressed_keys might be set, but the
first (or subsequent) event in pressed_keys can be NULL thanks to
release_pressed_keys.

Also added a regression test.
2021-06-08 20:35:58 -04:00
Jonathan Rascher eecc12c980 test(combo): Add unit test for complete long combo 2021-06-08 20:35:58 -04:00
Jonathan Rascher bba1599824 refactor(combos): Rename existing long combo test
This test doesn't test a long combo that completes, but rather one
that's incomplete (so the combo doesn't trigger). Renaming to avoid
confusion when we add more long combo tests.
2021-06-08 20:35:58 -04:00
Joel Spadin 0a9efbf85d fix(ble): Ignore out of range profiles
Don't allow selecting a BLE profile that is out of range to avoid
reading/writing past the end of the profiles array.
2021-06-08 20:33:43 -04:00
Nick Winans efcc49f23d
fix(boards): Set nice!60 nRF subfamily for openocd (#816) 2021-06-04 00:33:44 -04:00
Anthony Amanse 719b6aa0ae
fix(boards): Add delay on initializing external power for BlueMicro840
This commits adds a delay of 20ms on initializing the external
power control driver. Previously, OLED's i2c driver is failing to
initialize the display. This commit fixes that issue.

Signed-off-by: Anthony Amanse <ghieamanse@gmail.com>
2021-05-31 00:44:30 -04:00
Anthony Amanse cdbfb35662
fix(boards): Fix Blue LED pin definition in BlueMicro840
This commit fixes the pin definition for BlueMicro840. Based on the
schematics, the blue led is at pin 1.10.

Signed-off-by: Anthony Amanse <ghieamanse@gmail.com>
2021-05-31 00:20:46 -04:00
Nick Winans 3f838f0aaf feat(boards): Add nice!60 board 2021-05-30 11:47:20 -04:00
Okke Formsma a32cd668d6
fix(tests): Use debug builds and high resolution timer
By setting CONFIG_DEBUG, the native_posix builds will not be optimized
which makes debugging them much nicer.

By setting CONFIG_SYS_CLOCK_TICKS_PER_SEC to 1000, debug prints have a
higher resolution and not always show up as multiples of 10ms.
2021-05-27 08:20:45 -04:00
Okke Formsma de4979bf58 fix(behaviors): Fix sticky keys quick-release for normal keypresses
Quick release for sticky keys failed for non-layer keys. The sticky key
was released just before the key that was supposed to be modified was
handled.

The issue was caused by an error in the sticky key logic, which released
the sticky key before handling the key up event.

Fixes #696.
2021-05-09 07:52:41 -04:00
Peter Johanson 977746dbde feat(tests): Override test parallelism w/ `J=8` environment. 2021-05-05 00:56:05 -04:00
Lucas Messenger d8119cd663
fix(boards): Proper BlueMicro840_V1 &pro_micro_a map for A10 (#733) 2021-03-24 13:21:40 -04:00
Pete Johanson 28d454655b fix(boards): Move board endif to proper location.
* Nibble and tidbit conditional was closed early, enabling
  some settings incorrectly for other unrelated builds.
2021-03-18 21:26:41 -04:00
Pete Johanson 27c89e69c1 fix(kscan): Proper direct wire warning message. 2021-03-15 00:39:29 -04:00
Okke Formsma 0df7110058 fix(combos): Fix stuck keys when pressing long combos.
To properly retrigger hold-taps when a combo is not activated, some
position down events are reraised instead of released. The corresponding
position up events were never reraised, causing a potential stuck key.
2021-03-11 16:23:45 -05:00
Okke Formsma 8ebe0cd0c8 refactor(core): make the event manager a bit easier to read 2021-03-10 20:12:23 -05:00
Okke Formsma c01243d1c6 fix(logging): remove unnecessary newline 2021-03-10 18:08:22 -05:00
JP Bonn c643f1cd96 added battery.h, last_state_of_charge to uint8_t 2021-03-10 18:07:18 -05:00
JP Bonn b8a8ecd59d fixed order of setting state_of_charge 2021-03-10 18:07:18 -05:00
JP Bonn df4ec51f96 only send zmk_battery_state_changed on change 2021-03-10 18:07:18 -05:00
Pete Johanson 0f9fff7554 Fix the label for the GPIO kscan driver. 2021-02-27 14:32:42 -05:00
Okke Formsma 32008825fe fix(behaviors): Add missing hold-tap trigger
A hold-tap trigger was missing in the scenario where a hold-tap behavior
was queued for a while and it's timer should've run out.
2021-02-27 09:20:20 -05:00
Okke Formsma 0c1940bb79 feature(hold-tap): no-hold-flash for retro taps
This is an improvement on retro-tap, solving the 'flashing hold' issue
users people experience.

When the tapping-term expires, the hold key is normally pressed. When
retro-tap is enabled, this is undesirable; only an interrupted hold-tap
should trigger the hold behavior.

This change disables the hold behavior for the 'STATUS_HOLD_TIMER'
state when retro-tap is enabled, and makes sure the
'STATUS_HOLD_INTERRUPT' state will be triggered when appropriate.
2021-02-24 07:24:27 -05:00
Okke Formsma 89ed816c67 feature(hold-tap): Retro tapping 2021-02-24 07:24:27 -05:00
Okke Formsma 62ae157c0b refactor(hold-tap): improve switch statements 2021-02-24 07:24:27 -05:00
Okke Formsma 9c4c266b17 refactor(hold-tap): pretty print decision_moment 2021-02-24 07:24:27 -05:00
Okke Formsma 0ebf440de8 refactor(hold-tap): create press_binding and release_binding functions 2021-02-24 07:24:27 -05:00
Okke Formsma abc60fc7cb refactor(hold-tap): split hold state into interrupt and timer 2021-02-24 07:24:27 -05:00
Okke Formsma 200c6cabea refactor(hold-tap): use enum for hold-tap status 2021-02-24 07:24:27 -05:00
Okke Formsma 6b7026cdd1 refactor(hold-tap): simplify flavor enum 2021-02-24 07:24:27 -05:00
Nick Winans 57661362ea refactor(ext-power): Add init-delay-ms option
Co-authored-by: Pete Johanson <peter@peterjohanson.com>
2021-02-16 14:51:32 -05:00
Nick Winans b43fb8502e fix(ext-power): Initialize as soon as settings are available 2021-02-16 14:51:32 -05:00
Pete Johanson ff7891c097 fix(display): Check for display in idle handler.
* Closes #679
2021-02-16 14:21:46 -05:00
Okke Formsma af9d6e9b05 style(hold-tap)!: Write hold-tap params with dashes
tapping_term_ms -> tapping-term-ms
quick_tap_ms -> quick-tap-ms

The old style works, although it's deprecated.
2021-02-10 07:55:12 -05:00
Pete Johanson 2af794eed3 feat(underglow): Convert HSB changes to absolute.
* Public type for HSB led color.
* New API for calculating "next" HSB based on current
  state.
* Update behavior to convert the increment/decrement
  commands to absolute command as well.
2021-02-09 01:27:50 -05:00
Pete Johanson e6f168d6df refactor(behaviors): Convert state dependent params.
* Allow each behavior to map a relative binding, e.g. "toggle",
  to an absolute one, e.g. "on", before being invoked.
2021-02-09 01:27:50 -05:00
Pete Johanson bb2c478af9 refactor(rgb): Expose explicit on/off command/API. 2021-02-09 01:27:50 -05:00
Nick Winans fc5d7bcb78 fix(boards): Remove explicit enable of sensor 2021-02-08 10:50:44 -05:00
Nick Winans 5eace0bbc4 fix(core): Enable sensor by default 2021-02-08 10:50:44 -05:00
KemoNine 0499e7e8ac
Refactor nibble / update to match build docs (#620)
* feat(nibble): add underglow support for nice_nano builds

* feat(nibble): add encoder to top, left most column to match standard assembly documentation

* refactor(nibble): add layer labels

* feat(nibble): add support for optional display ; off by default

* feat(nibble): add README

* fix(nibble): adjust oled rotation for easier reading

* fix(nibble): add additional note about enabling oled

* refactor(nibble): convert keymap to use tabs instead of spaces

* refactor(nibble): enable oled in dts/overlay by default

* refactor(nibble): cleanup alignment and formatting in nibble keymap

* refactor(nibble): re-align top most row of keymap to be sensible

* refactor(nibble): cleanup kscan map alignment

* refactor(nibble): indent first row of map/transform to properly align with physical columns

* fix(nibble): remove dangling code block from readme

Co-authored-by: KemoNine <mcrosson@kemonine.info>
2021-02-04 10:28:02 -06:00
jrhrsmit e40ca1eb7c
fix(power): Add support for capacitors on ADC for BVD
Add a little delay so any capacitors connected to the ADC for the BVD can charge up when using power_gpios

Co-authored-by: Jasper Smit <jrhrsmit@gmail.com>
2021-02-04 07:56:27 -05:00
Pete Johanson b84d29c384 refactor(core): Use /omit-if-no-ref/ for behaviors.
* Use lesser-known DT features to skip behaviors not referenced
  in the user keymap
* Update the behaviors to skip code if no nodes found.
* Remove some empty config/data structs where unused in
  behaviors.
2021-02-04 00:52:25 -05:00
mantas b4d63fb52c feat(shields) Add encoder support to CRBN
Pin A maps to A2 (F5), pin B to A3 (F4).
Added keymappings to encoder on default and lower layers.
2021-02-03 23:49:59 -05:00
mantas c94943da1c style(crbn): Unify indentation from spaces to tabs 2021-02-03 23:49:59 -05:00
KemoNine cd503ed17b
Feat combo layers (#661)
feat(combos): add layer filtering

Co-authored-by: KemoNine <mcrosson@kemonine.info>
2021-02-03 23:33:09 -05:00
Okke Formsma 9a7908b632 behaviors(hold-tap): Implement quick_tap_ms (TAPPING_FORCE_HOLD)
Tap-and-hold a hold-tap to hold the tap behavior so it can repeat.
After a tap, if the same key is pressed within `quick_tap_ms`, the
tap behavior is always picked.

This is useful for things like `&ht LSHFT BACKSPACE` where holding
the backspace is required.

Implements #288.
2021-02-02 15:28:16 -05:00
Pete Johanson 6c7ab0ce53 refactor(kscan): Fix polling of GPIO matrices.
* Add easier macros for conditional polling/interrupt code.
* Properly continue polling on intervals, without extra
  enable/disable code for pins that is superfluous when not trying to
  deal with interupts firing.
* Fix to allow multiple GPIO drivers when doing splits w/ IO expanders
2021-02-02 14:04:10 -05:00
Pete Johanson 2f352788c1 refactor(kscan): Remove explicit default n from kscan configs.
* Actually allow defaulting yes in other places.
2021-02-02 14:04:10 -05:00
Nick Winans 33cd2caced fix(boards): Shorten keyboard names that are too long 2021-02-02 00:59:17 -05:00
Nick Winans 82173f354e fix(core): Assert BLE device name is correct length 2021-02-02 00:59:17 -05:00
Okke Formsma 4e20bf5de1 refactor(behaviors): simplify hold-taps by not using _TRANSFORM_ENTRY 2021-02-02 00:43:26 -05:00
Okke Formsma 84d19fe79b refactor(behaviors): factor out multiple uses of _TRANSFORM_ENTRY 2021-02-02 00:43:26 -05:00
Jeff Rizzo 4f040fecdf Add a missing log_strdup() 2021-01-30 00:31:07 -05:00
Okke Formsma c925cf02dd feature(sticky_keys): add quick-release
when quick-release is enabled, the sticky key is released immediately after another key is pressed
2021-01-28 17:10:04 -05:00
Pete Johanson 7c24ab069c fix(behaviors): Updated grsec snapshots for new log format. 2021-01-25 16:11:01 -05:00
Okke Formsma 7b7701ae90 feature(modifiers): add explicit modifiers
this makes LS(LEFT_CONTROL) work as if shift and control were both
pressed explicitly. Previously, the left shift would have been released
as soon as another key was pressed. The implicit behavior is useful in
case of LS(NUMBER_1) when rolling over to other keys.

Also see #361.
2021-01-24 23:30:41 -05:00
Okke Formsma 0c30b49063 refactor(modifiers): define is_mods function 2021-01-24 23:30:41 -05:00
Okke Formsma df4a5c8613 refactor(hid_listener): pass event struct instead of parameters 2021-01-24 23:30:41 -05:00
Ally Parker a4aaa73f06 feat: Add WPM calculator and display widget 2021-01-23 18:38:31 -05:00
Jeff Rizzo c0cab57c2d run-test.sh: use the POSIX '-L 1' for xargs
This allows tests to be run on platforms where '-l'
isn't implemented, like MacOS.
2021-01-23 18:32:18 -05:00
Okke Formsma 5eeb310b2f feat(grave-escape): implement grave-escape
closes #85
2021-01-22 19:27:18 -05:00
Jay Greco 58ad5d4e86 Fix offset in NIBBLE transformation and keymap
The NIBBLE transformation was missing RC(0,0), which was causing some strange behavior in the kscan driver.
2021-01-22 16:03:14 -05:00
Pete Johanson 3368a81057 refactor(core): Combine `is_` and `cast_` event functions.
* Use a single `as_foo` generated function to conditionally
  return a certain event type from a generic `zmk_event_t*`
  pointer.
2021-01-20 07:06:11 -05:00
Pete Johanson 3fe2acc2d1 refactor(core): Extra event payloads to own types, refactor API.
* Make it easier to use *just* event payloads by defining the data,
  and then having event manager macros generate "wrapper structs"
* Improve is_*/cast_* APIs to hide details of full event struct.
* Create `zmk_event_t` typedef to pass to event handlers.
* Bring event names inline w/ consistent `zmk_` prefix.
2021-01-20 07:06:11 -05:00