Commit Graph

140 Commits

Author SHA1 Message Date
Horu
7d1f84e3eb
chore: fix typos in various places 2024-05-13 16:47:33 -04:00
Peter Johanson
bb94a7aafe fix: Fixes for building soft off without deep sleep. 2024-03-27 20:59:26 -07:00
Peter Johanson
8d54e287f0 fix: Adjustments for Zephyr 3.5. 2024-03-27 20:59:26 -07:00
Peter Johanson
bd21f41412 refactor: Fixes for review feedback. 2024-03-27 20:59:26 -07:00
Peter Johanson
5d960a758f fix: Cleanups of sideband and direct kscan from review.
* Add dedicated init priority for the sideband kscan.
* Refactor sideband code for clarity.
* Tweaks to direct kscan for clarity.
* Make sideband behavior row optional for brevity.
* Allow overriding ZMK Uno sideband behaviors.
2024-03-27 20:59:26 -07:00
Peter Johanson
a0ad1d4c94 refactor: Add kscan sideband behavior driver
* Instead of gpio key behavior trigger, add new kscan driver that
  decorates/wraps a given kscan driver and will invoke basic system
  behavior assigned to a given row + column, without the need for keymap
  mapping in the matrix transform, bypassing keymaps entirely.
2024-03-27 20:59:26 -07:00
Pete Johanson
5ebe924e94 chore: Various soft-off review fixes
* Code style to avoid goto.
* Enable pm.c compilation via dedicated Kconfig flag.
* Comment wakeup trigger PM behavior.
2024-03-27 20:59:26 -07:00
Peter Johanson
fceb0351a5 refactor: Fixes for soft-off based on review.
* Better naming for gpio-key behavior triggers.
* Tweaks to scanned behavior trigger to avoid bad semaphore use,
  and reduce chance of issues with slowly scanned matrixes.
* Various code cleanups of style issues.
2024-03-27 20:59:26 -07:00
Peter Johanson
adb3a13dc5 feat: Add soft on/off support.
Initial work on a soft on/off support for ZMK. Triggering soft off
puts the device into deep sleep with only a specific GPIO pin
configured to wake the device, avoiding waking from other key
presses in the matrix like the normal deep sleep.

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2024-03-27 20:59:26 -07:00
Peter Johanson
44358798d3 feat: Add ability to fetch battery voltage.
* To be able to use the Zephyr `voltage-divider` driver,
  add a mode for fetching raw voltage from the sensor
 and do state of charge calculation outside of the driver.
2024-03-24 13:28:55 -07:00
Peter Johanson
3a3eed2960 fix: Add settings reset on start init priority.
* Add a dedicated settings reset on start init priority and default
  it to lower priority (high number) than default FLASH_INIT_PRIORITY
  to be sure flash is initialized before we open the area.
2024-03-20 11:18:43 -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
honorless
ccf0380179 refactor: remove redundant Kconfig defaults
bool symbols implicitly default to n.
2024-02-19 16:39:31 -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
a6c0399493 fix(bluetooth): Remove LLCP impl override. 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
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
Xudong Zheng
4a5806ac73 feat(core): enable FPU if CPU has FPU 2024-01-29 17:54:34 -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
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
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
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
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
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
ReFil
9bacaffe62
feat(hid): Add KConfig option for higher NKRO usages
By default the maximum NKRO usage is set to maximise compatibility, but some keys dont work, this adds the ability to use those extended keys, at the cost of compatibiltity

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
Co-authored-by: Pete Johanson <peter@peterjohanson.com>
2023-12-04 18:24:05 -05:00
Peter Johanson
da15564d0e feat(bluetooth): Build on ARCH_POSIX. 2023-12-02 17:11:45 -08:00
Alessandro Bortolin
4e55c5f6e9 feat: handle LED indicators report 2023-11-27 16:03:18 -08:00
Alexander Krikun
d7d9eed317 feat(mouse): Initial mouse keys support.
* Add HID report/descriptor for a new report with mouse buttons,
  and x/y/wheel deltas.
* New mouse key press behavior for press/release of mouse keys.
* Add constants for HID main item values (e.g. data/array/absolute)
* Define and use constants for our HID report IDs.
2023-11-15 11:16:59 -08:00
ReFil
8776911da5
feat(ble): Allow disabling BLE BAS reporting
The battery reporting has been known to cause macOS computers to wakeup repeatedly. In some cases (e.g. display or custom lighting implementation) one might want to collect battery SOC without broadcasting over BLE

* Update docs/docs/config/battery.md

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2023-11-15 13:03:30 -05:00
Peter Johanson
3027b2a6e8 chore(usb): Don't enable ZMK_USB_ROOT by default.
* Some initial reports of crashes with this code enabled, so disabling
  by default for now pending further investigation.
2023-11-13 23:56:10 -08:00
Peter Johanson
964c54139d fix(usb): Tweak how ZMK_USB gets enabled.
* Previous version of multiple overrides of the default value of ZMK_USB
  were problematic. Move to using board _defconfig files for the
  defaults for those, along with proper `depends on` for ZMK_USB that
  accounts for split and split roles.
2023-11-13 12:56:23 -08:00
Chris Andreae
91aa3378f3
feat(usb): Add boot protocol support
* USB boot protocol support
* Use a single definition of a boot report, used for regular reports in
  non-6KRO, and for rollover in all branches.
* Handle gaps in the zmk report when producing a boot report in HKRO mode. For
  .example, if it was 8KRO, it would be possible to have the state 0 0 0 0 0 0 0
  17 (by pressing 8 keys, and letting go of the first 7). Copying the first 6
  bytes would not show up the single pressed key.
* Disable usb status change and callback on SOF events:
  SOF events were introduced by the boot protocol changes, and required internally
  by Zephyr's idle support, but are unused within ZMK itself. Ignore them in the
  usb status callback.

---------

Co-authored-by: Andrew Childs <lorne@cons.org.nz>
2023-11-13 13:04:04 -05:00
Peter Johanson
690bc1bb44 refactor: Move drivers into properly module.
* Align our driver module layout to properly match Zephyr conventions,
  allowing proper CMake setup to amend the library for each type of driver.
2023-09-16 11:52:40 -07:00
Xudong Zheng
9a963abfc8 refactor: use low priority workqueue for underglow and battery reporting
Blocking operations on the high priority system workqueue may result in
deadlocks, particularly when Bluetooth is in use.
2023-07-24 17:04:51 -07:00
Cem Aksoylar
ee1e135104
fix: Proper battery sensor Kconfig dependencies.
Properly make the battery sensor Kconfig symbols depend
on `SENSOR` config, and minor battery reporting Kconfig
symbol dependency fix.
2023-07-19 02:21:09 -04:00
Peter Johanson
753802cd79 fix(sensors): Clean ups based on code review. 2023-06-18 20:45:06 -06:00
Peter Johanson
d781ec795b refactor(bluetooth): Add battery reporting config.
* Add dedicated battery reporting Kconfig that is `imply`d by
  enabling ZMK_BLE.
2023-06-18 20:45:06 -06:00
Peter Johanson
621d946d29 refactor(bluetooth): Bump HoG stack size.
* Bump the default stack size for the HoG processing thread
  to avoid issues w/ some pathways.
2023-06-18 20:45:06 -06:00
Peter Johanson
f0f7e2081b refactor(config): Select SENSOR as needed.
* Don't force on SENSOR Kconfig setting unless
  needed based on the detected DT.
2023-06-18 20:45:06 -06:00
Peter Johanson
2244bd3d81 refactor(sensors): Sensor event channel data, resolution tweaks.
* Refactor sensor events to include channel data,
  necessary for prop split encoders, and avoiding duplicate calls,
  to fetch channel data twice, etc.
* More consistent behavior driver API.
* Allow setting triggers per resolution at the behavior level optionally.
2023-06-18 20:45:06 -06:00
Joel Spadin
9ff1eaeb5a fix: Enable BT_TINYCRYPT_ECC when using HCI
BT_TINYCRYPT_ECC is required for BT_SMP_SC_PAIR_ONLY to work on setups
that use BT HCI like the nRF5340.
2023-06-18 14:52:45 -06:00
Peter Johanson
19d883cdfe fix(bluetooth): Passkey pairing improvements.
* Capture the last 6 entered digits, and then require pressing
   Enter/Return to submit the entered digits. This matches the
   messaging shown on hosts regarding how to complete pairing.
* Fix the wording on the Kconfig menu item to accurately describe
  the feature.
2023-06-05 00:01:44 -06:00
Peter Johanson
e52e734480 chore: Fix formatting of Kconfig setting. 2023-04-24 23:01:48 -07:00
Peter Johanson
de152fe741 fix(bluetooth): Revert to Legacy LLCP
* Reports of constant/frequent disconnects, with HCI err 0x28,
  "instant passed", seem linked to newer LLCP that became default
  in Zephyr 3.2, so revert to the Legacy LLCP for now until a
  proper fix for new LLCP can be found.
2023-04-24 22:41:03 -07:00
Joel Spadin
94061bb916 refactor: Replace tabs with spaces
Standardized indentation to use spaces with a new pre-commit hook.
2023-04-24 16:07:04 -07:00
Nick Conway
3db163aa2c feat(behaviors): Add reusable sensor behaviors.
* Add new sensor behaviors that either take full bindings
  add definition, or accept parameters when bound in the
  keymap.
* Remove existing hard-coded key press sensor behavior
  and instead leverage new generic sensor behaviors to
  achieve the same functionality.

Co-authored-by: nick@conway.dev
2023-04-21 21:13:31 -07:00
Xudong Zheng
ee9fcec3c9 feat(core): Process log every 100ms 2023-04-09 23:29:22 -07:00
Xudong Zheng
a20b9502bc feat(core): Add RTT logging Kconfig option 2023-04-09 23:29:22 -07:00