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.
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.
* 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.
* 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.
* 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.
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.
* 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.
* 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.
* 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.
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.
* 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>
* 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.
* 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.
* 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>
* 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.
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.
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().
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.
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.