Commit Graph

1313 Commits

Author SHA1 Message Date
honorless
3a38979684 refactor: replace tapping_term_ms with tapping-term-ms
* The underscore form of this property is deprecated.
2024-03-18 10:15:50 -07:00
Hans Kruse
c6e0551fb0
fix(hid): Fix typo in HID usage alias 2024-03-18 13:06:09 -04:00
ReFil
388ad71385
feat(build): Explicit missing keymap node error
* Explicit error if zmk,keymap not set
* Document keymap error

---------

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2024-03-18 12:54:47 -04:00
Joel Spadin
a77288f527 fix: Update settings reset for Zephyr 3.5 2024-03-18 09:48:19 -07:00
Joel Spadin
1dfcfc7d3f feat(shields): Make settings_reset shield reset all settings
Added a new CONFIG_ZMK_SETTINGS_RESET_ON_START option which enables init
code to call zmk_settings_erase(), and changed the settings_reset shield
to use it instead of CONFIG_ZMK_BLE_CLEAR_BONDS_ON_START, so it now
resets all settings instead of just clearing BLE bonds.

CONFIG_ZMK_BLE_CLEAR_BONDS_ON_START is left in place for now in case
someone still needs it. It may be replaced in the future once we find a
better way to repair a broken split connection.
2024-03-18 09:48:19 -07:00
Joel Spadin
610a806c84 feat: Add function to erase all settings
Added a zmk_settings_erase() function to clear all saved settings. This
does not go through Zephyr's settings subsystem, but instead directly
clears the data from the setting storage backend, so a reboot is needed
for it to take effect.
2024-03-18 09:48:19 -07:00
Peter Johanson
2adaa00d10 fix(build): Properly board revision keymaps.
* Handle board keymap location for boards with Zephyr
  board revisions included.
* Includes bare non-revision file and a revision specific keymap
  in case newer revision changes the layout/key positions.
2024-03-08 10:58:10 -08:00
Theo Lemay
c9c620d19f fix: inline initialise 2024-02-20 00:25:53 -08:00
Theo Lemay
8b20874c99 chore: remove label in test 2024-02-20 00:25:53 -08:00
Theo Lemay
c007d60357 feat(behaviors): hold while undecided 2024-02-20 00:25:53 -08:00
Xudong Zheng
104c73d303 refactor: address transport switch enumeration warning
When building without USB or Bluetooth, the compiler emits a warning due to
ZMK_TRANSPORT_USB or ZMK_TRANSPORT_BLE not being handled.
2024-02-19 21:41:52 -08:00
Seth Milliken
b44ec381f6 feat(boards): add encoder support to planck 2024-02-19 17:01:10 -08:00
honorless
ccf0380179 refactor: remove redundant Kconfig defaults
bool symbols implicitly default to n.
2024-02-19 16:39:31 -08:00
ton-im
c082f8d802
fix(boards): Add ext power init delay for nrfMicro
* Address issues with OLED init occurring before display is powered.
2024-02-19 19:32:12 -05:00
zhiayang
a9ae6796a0
fix(display): Proper initial display of battery status
* fix initial display of battery status on displays, and also fix a null deref
2024-02-19 19:15:19 -05:00
Peter Johanson
fda6a5f185 fix(boards): Tweaks for Ferris rev0.2 for Zephyr.
* Enable missing clock and set up USB pinctrl.
2024-02-17 21:57:21 -08:00
ctranstrum
0f49fa9ae4
fix(behavior): Proper init priority for ext_power. 2024-02-14 20:29:19 -05:00
honorless
40adb3858d refactor(boards): remove superfluous conf settings 2024-02-10 16:15:09 -08:00
honorless
cdcf4ebfb6 feat(boards): allow use of blackpill_f401cc 2024-02-10 16:15:09 -08:00
Peter Johanson
50a303b8bb fix(pm): Restore sleep suspension of devices.
* After the move to `sys_poweroff`, restore the behavior of
  suspending devices before entering sleep state.
2024-02-09 14:32:46 -08:00
Peter Johanson
1d83f279cd fix(pm): Tweaks for deep sleep/PM.
* Restore enabling of PM_DEVICE, make ZMK_SLEEP work with
  the ZMK Uno shield on nrf52840dk_nrf52840 board.
2024-02-09 14:32:46 -08:00
Peter Johanson
4bcecd98f8 fix(display): Tweaks to memory Kconfig settings.
* Don't default heap mempool by default now that there's a dedicated
  LVGL mempool
* Set proper defaults for CiZ display hardware/custom screen.
* Double the dedicated display thread stack size for CiZ.
2024-02-09 14:32:46 -08:00
Peter Johanson
2d6c9f797c refactor(display): Move to proper SPI ready API. 2024-02-09 14:32:46 -08:00
Peter Johanson
cd6f8a680c fix(ble): Update security test for changes in 3.5. 2024-02-09 14:32:46 -08:00
Peter Johanson
b2a0a357e1 fix(display): Set a default mem size for built-in
* Set a reasonable default LVGL mem pool size for our built-in
  status screen.
2024-02-09 14:32:46 -08:00
Peter Johanson
d9c0ded402 fix(shields): Fix use of deprecated Zephyr header. 2024-02-09 14:32:46 -08:00
Peter Johanson
aeb5bed3d6 fix(kscan): Adjust charlieplex init level/priority. 2024-02-09 14:32:46 -08:00
Peter Johanson
a6c0399493 fix(bluetooth): Remove LLCP impl override. 2024-02-09 14:32:46 -08:00
Peter Johanson
324ada1d20 fix(boards): Remove unused pin settings.
* Remove unused pin settings that used deprecated
  devicetree properties.
2024-02-09 14:32:46 -08:00
Peter Johanson
8e9b4fa57c fix(boards): Make &bootloader work on nrf52 for now.
* Use `NRF_STORE_REBOOT_TYPE_GPREGRET` to get bootloader behavior
  to work for now until retained bootmode is implemented.
2024-02-09 14:32:46 -08:00
Peter Johanson
3968d9febd feat(boards): Make west flash work with new UF2 runner. 2024-02-09 14:32:46 -08:00
Peter Johanson
b3f1d769f0 fix(bt): Fixes for BLE test BSIM bits. 2024-02-09 14:32:46 -08:00
Peter Johanson
4fcbe3268a fix(bt): Updated snapshots for BLE tests.
* Core Zephyr changes tweaked the output from the
  BT stack for our unit tests.
2024-02-09 14:32:46 -08:00
Peter Johanson
413820fc7f fix(shields): LVGL fixes for nice!view screen
* Bump the LVGL mem pool size needed for custom screen.
* Fixes for LVGL drawing/label usage.
2024-02-09 14:32:46 -08:00
Peter Johanson
802881b625 fix(boards): Remove references to PINMUX Kconfig. 2024-02-09 14:32:46 -08:00
Peter Johanson
f4e6d70465 fix: Proper use of CONTAINER_OF with delayable work. 2024-02-09 14:32:46 -08:00
Peter Johanson
552347b8a4 fix(kscan): Adjust composite kscan priority
* Composite kscan needs a dedicated priority to be sure it is
  initialized after the other kscan instances.
2024-02-09 14:32:46 -08:00
Peter Johanson
a81a2d37a8 refactor: Remove explicit blocklist item.
* `sof` is now not enabled by default as a west dep, so need to
  add it to the blocklist ourselves.
2024-02-09 14:32:46 -08:00
Peter Johanson
98e3b8b435 refactor: Move to new sys_poweroff API.
* Move to new `sys_poweroff` API for our deep sleep functionality.
2024-02-09 14:32:46 -08:00
Peter Johanson
b6d9f3c911 fix(ble): Ensure large enough string for setting name.
* Fix warning related to potentially large number of profiles
  causing overflow of allocated string for the setting name.
2024-02-09 14:32:46 -08:00
Peter Johanson
58413ca8c5 refactor(kscan): Clean up warning about shadowed local. 2024-02-09 14:32:46 -08:00
Peter Johanson
d6de8a3acc refactor: Move to POST_KERNEL phase for behavior inits. 2024-02-09 14:32:46 -08:00
Peter Johanson
ba1a6c08ad refactor: Return int from main function. 2024-02-09 14:32:46 -08:00
Peter Johanson
d06e90e713 fix: Fix syscalls generation setup. 2024-02-09 14:32:46 -08:00
Peter Johanson
bd9c71ab0a fix(sensors): Avoid duplicate Kconfig/DTS name.
* Upstream added an equivalent fuel gauge driver, so namespace
  our Kconfig symbol and DTS compatible for the MAX17048 driver.
2024-02-09 14:32:46 -08:00
Peter Johanson
0b5afbf9c0 refacter(bluetooth): Proper HCI header include. 2024-02-09 14:32:46 -08:00
Peter Johanson
fb99496a73 chore: Switch to 3.5 Zephyr version. 2024-02-09 14:32:46 -08:00
Peter Johanson
f7e7c9c10b fix: Add missing include for k_work types. 2024-02-09 14:32:46 -08:00
Peter Johanson
bf4008da02 refactor: All SYS_INIT functions are void args. 2024-02-09 14:32:46 -08:00
Peter Johanson
f4fce9e158 refactor(display): Move new LVGL DPI Kconfig setting. 2024-02-09 14:32:46 -08:00
Cem Aksoylar
b8846cf635 refactor(display): Remove unused BAS includes 2024-02-06 01:09:07 -08:00
Cem Aksoylar
efbcd3c8f6 fix(boards): Disable ZMK_USB for peripherals 2024-02-06 01:09:07 -08:00
Cem Aksoylar
4b03fcb709 fix(boards): Add missing battery header include 2024-02-06 01:09:07 -08:00
Joel Spadin
c2299e2203 fix(shields): Fix deprecated encoder properties
Switched remaining shields over from resolution to steps.
2024-02-03 18:45:21 -06:00
Joel Spadin
f24a0bf9c8 fix(shields): Add labels to all sensors nodes 2024-02-03 18:45:21 -06:00
Xudong Zheng
4a5806ac73 feat(core): enable FPU if CPU has FPU 2024-01-29 17:54:34 -08:00
senseored
b120daa16a
fix(boards): Assign preonic_rev3 chosen console
Quick fix to make USB-logging work on the Preonic.
2024-01-27 07:18:45 -08:00
honorless
6b547019c2 refactor: use zmk,matrix-transform instead of zmk,matrix_transform
* Align codebase with documentation.
2024-01-23 23:02:35 -06:00
Peter Johanson
f71458aca0 fix(shields): Fix battery warnings for custom widgets. 2024-01-16 16:39:28 -08:00
Peter Johanson
e5050e40fe feat(tests): Enable asserts for tests. 2024-01-14 16:19:30 -08:00
Peter Johanson
e89cffc959 fix(events): Remove our usage of assert.
* __ASSERT is converted to a do/while loop when asserts are enabled,
  which doesn't work with our usage, so revert that addition.
2024-01-14 16:19:30 -08:00
Peter Johanson
331915f989 fix: Fix missed event manager usages from refactor. 2024-01-14 11:31:05 -08:00
Peter Johanson
644feeb40d fix(core): Address review comments from Joel.
* Fix up some lingering events API tweaks for heap-less event manager.
2024-01-14 11:13:57 -08:00
Peter Johanson
33209dee1d refactor(core): Move to stack allocated events.
* Move to local/stack allocated event API that doesn't require
  dynamic allocation/freeing.
* Disable heap, we no longer use alloc/free unless using LVGL.
* Tons of refactors all over to account for the new event approach.
2024-01-14 11:13:57 -08:00
Peter Johanson
db9ab30335 fix(boards): Fix up EXT_POWER naming for adv360pro;
* Restore setting loading by preserving old device name for the
  external power node.
2024-01-08 17:50:19 -08:00
Xudong Zheng
6bf4870704 fix(battery): prevent bus fault when battery does not exist
zmk_battery_start_reporting() may be called from battery_event_listener(), which
will result in a bus fault when attempting to read a battery that does not exist
such as on a dongle.
2024-01-08 17:39:05 -08:00
Peter Johanson
7652fbeb6b fix(split): Split peripherals should auto sec req still.
* Ensure split peripherals have `BT_GATT_AUTO_SEC_REQ` enabled so that
  reconnects to centrals are automatically encrypted.
2024-01-06 00:53:49 -08:00
Peter Johanson
12bc8b0402 fix: Fix function signatures for WPM.
* Recent refactor accidentally used the wrong signatures for a few
  WPM function definitions.
2024-01-05 16:09:34 -08:00
Leonardo Bispo
cebf651d11
fix(boards): include the right flash info in XIAO BLE overlay 2024-01-05 19:00:32 -05:00
Peter Johanson
395ffaa790 fix(ble): Properly send mouse HoG using worker.
* Properly send mouse HoG reports using our worker to avoid thread issues.
2024-01-05 12:17:59 -08:00
Peter Johanson
74875314f8 feat(ble): Request encryption if notifying fails
* If attempting to notify and getting an EPERM return value, request
  upgrading the security of the connection at that moment, since it
  likely means we got a connection to a bonded host but the connection
  hasn't been upgraded to encrypted yet.
2024-01-05 12:17:59 -08:00
Pete Johanson
69f962fab2 feat(ble): Add security related tests.
* Add security related tests to verify behavior when trying to read
  a GATT characteristic from our peripheral with and without client
  auto security request/retry.
2024-01-05 12:17:59 -08:00
Peter Johanson
bc7b4b56bd fix(ble): Disable Auto Sec Req again.
* Auto security request actually makes macOS worse, so disable it,
  and remove our early request in favor of using GATT enforcement
 to ensure connections are secured.
2024-01-05 12:17:59 -08:00
Chris Andreae
194a9790eb fixup! use wider type for loop iterator 2024-01-05 12:16:38 -08:00
Chris Andreae
b813f34e34 fixup! bt: add BT_CLR_ALL behaviour 2024-01-05 12:16:38 -08:00
Chris Andreae
f4fe7fa40f Extract common behaviour of clearing a bond 2024-01-05 12:16:38 -08:00
Chris Andreae
604c95118e Remove error reporting from ble utility functions that never error 2024-01-05 12:16:38 -08:00
Chris Andreae
b8cb407351 lint: use correct type signature for Zephyr callbacks 2024-01-05 12:16:38 -08:00
Chris Andreae
7a5155f36e lint: add (void) parameter to pass -Wstrict-prototypes
Note there was one place where a non-strict prototype was actually being used
with an argument, in `zmk_hog_init`. In this case, the actual argument type was
added instead.
2024-01-05 12:16:38 -08:00
moergo-sc
5257cde1f5 bt: add BT_CLR_ALL behaviour
Defines behaviour to clear all paired Bluetooth profiles
2024-01-05 12:16:38 -08:00
Justin Ridgewell
6f8d080b6a
fix: Use zmk_battery_state_of_charge in battery widgets 2024-01-05 15:02:06 -05:00
Gabor Hornyak
0e2f94b73b feat(ble): Support perhipheral battery levels.
* Add ability to fetch and report peripheral battery levels
  on split centrals.
* Add additional support for adding a new Battery Level
  service to split centrals that exposes fetched peripheral
  battery levels to connected hosts.

Co-authored-by: Peter Johanson <peter@peterjohanson.com>
2024-01-03 09:26:51 -08:00
honorless
d35311af97 refactor: remove misleading build warning
* Among other issues, this message is often misinterpreted by users
  building out-of-tree shields -- leading them to think the shield
  "not being found" is the cause of a build failure.
2023-12-30 18:26:00 -08:00
honorless
7ef6ec7560 refactor: remove unused Kconfig files 2023-12-30 18:26:00 -08:00
Peter Johanson
a593c7260a feat(bt): Add test for unauth overwrite.
* Add a test to ensure unauth overwrite does the right thing when
  hosts try to pair again without the profile cleared on the ZMK side.
2023-12-18 13:18:09 -08:00
Peter Johanson
1b8b6b4a0e refactor(core): Make low priority queue optional.
* Add a new Kconfig symbol to enable the low priority queue, and make
  the two features that depend on it `select` the symbol to turn it on.
  This helps ensure no wasted RAM/ROM on devices that don't need it.
2023-12-16 17:10:45 -08:00
Peter Johanson
9b3a98691c refactor(bt): Split security and conn exp. Kconfig
* Split connection and security experimental changes into dedicated
  Kconfig flags for easier testing of only connection related fixes.

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2023-12-15 08:59:03 -08:00
Cem Aksoylar
ff57ccc75a feat(shields): Allow settings_reset to build with board-only keyboards 2023-12-13 11:29:33 -08:00
Hooky
2c50cff891
feat(kscan): Add charlieplex keyscan driver
* Supports matrixes with and without additional interrupt pin use.

Co-authored-by: Peter Johanson <peter@peterjohanson.com>
2023-12-09 17:10:05 -05:00
Peter Johanson
b35a5e83c0 fix(shields): Don't enable passkey support on Uno.
* The ZMK Uno has no way to input the full range of digits, so skip
  that setting so it's not pulled in by BLE experimental feature flag.
2023-12-08 14:57:23 -08:00
Peter Johanson
63c8c5700a feat(bt): Add more experimental tweaks.
* Support auto security upgrade for splits properly.
* Disable 2M and legacy LLCP if the experimental
  Kconfig flag is selected.
2023-12-08 14:57:23 -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
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
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
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