aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/src/endpoints.c
AgeCommit message (Collapse)Author
2024-12-09feat(mouse): Add mouse move and scroll support (#2477)Pete Johanson
* feat(mouse): Add mouse move and scroll support * Use Zephyr input subsystem for all pointers. * Input processors for modifying events, e.g. scaling, swapping codes, temporary (mouse) layers, etc. * Mouse move/scroll behaviors. * Infrastructure in place for physical pointer input devices. * feat: Add input split support. * docs: Add initial pointer docs. --------- Co-authored-by: Cem Aksoylar <[email protected]> Co-authored-by: Alexander Krikun <[email protected]> Co-authored-by: Robert U <[email protected]> Co-authored-by: Shawn Meier <[email protected]> Co-authored-by: Chris Andreae <[email protected]> Co-authored-by: Anant Thazhemadam <[email protected]> Co-authored-by: Erik Tollerud <[email protected]> Co-authored-by: Nicolas Munnich <[email protected]>
2024-09-13pre-commit: re-format using clang-format hook (v18.1.8)Maxime Vincent
2024-07-03fix: Improve startup time with proper settings loading.Peter Johanson
* Avoid doing duplicate calls to setings_load_subtree, which iterates NVS fully each time under the hood, and instead use on settings_load later in the lifecycle.
2024-03-27refactor: Promote new endpoints APIPeter Johanson
* Add ability for external callers to clear the current endpoint.
2024-02-19refactor: address transport switch enumeration warningXudong Zheng
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-09refactor: All SYS_INIT functions are void args.Peter Johanson
2024-01-14refactor(core): Move to stack allocated events.Peter Johanson
* 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-05lint: add (void) parameter to pass -Wstrict-prototypesChris Andreae
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.
2023-11-15feat(mouse): Initial mouse keys support.Alexander Krikun
* 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-13feat(usb): Add boot protocol supportChris Andreae
* 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 <[email protected]>
2023-10-02fix: Address review commentsJoel Spadin
2023-10-02refactor: Split endpoint to transport and instanceJoel Spadin
Changed the endpoints code to rename the existing endpoint types to "transport" and add the concept of "endpoint instances". A transport is the method by which data is sent, while instances allow describing multiple endpoints that use the same transport (e.g. bluetooth profiles) Also added new APIs to get the total number of possible endpoint instances and assign each instance a unique index, which can be used for tracking separate state for each endpoint in other code files.
2023-04-05refactor: Remove v1 logging vestiges.Peter Johanson
2023-04-05refactor: Move to `zephyr/` include paths.Peter Johanson
* Zephyr moved to properly namespaced headers, so major "rip the bandaid" commit to move us to those everywhere.
2022-04-13fix(usb): Split HID from core USB, logging fix.Peter Johanson
* Split core USB init from USB HID init. * Tweak logging to avoid "log loop" causing spurious buffer messages on startup.
2022-04-03refactor: Move to `k_work_delayable` API.Peter Johanson
* Move to new `k_work_delayable` APIs introduced in Zephyr 2.6. See: https://docs.zephyrproject.org/latest/releases/release-notes-2.6.html#api-changes
2021-08-03feat(endpoints): Add endpoint select changed event.Peter Johanson
2021-01-20refactor(core): Extra event payloads to own types, refactor API.Pete Johanson
* 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-15refactor(core): define usage page as uint16_tinnovaker
Aligns with the HID specification. Usage page values were sometimes declared as uint8_t and sometimes uint16_t. This commit aligns all instances with the HID specification for consistency. PR: #521
2020-12-28refactor: replace filename hyphens with underscoresinnovaker
Aligns *.h and *.c to underscore naming convention. These were kept (with warnings) for backwards compatibility with external boards/shields: - kscan-mock.h - matrix-transform.h They should be removed in the future. PR: #523
2020-12-14refactor(settings): Debounce BLE/endpoint settings savesNick
2020-12-14refactor(settings): Only load used subtreesNick Winans
2020-12-14refactor(app): replace `struct device *` with `const struct device *`innovaker
Replaced with RegExp: /(?<!const )(struct device \*)/g See: https://docs.zephyrproject.org/latest/releases/release-notes-2.4.html PR: #467
2020-12-14refactor(app): replace Zephyr integer types with C99 integer typesinnovaker
u8_t → uint8_t u16_t → uint16_t u32_t → uint32_t u64_t → uint64_t s8_t → int8_t s16_t → int16_t s32_t → int32_t s64_t → int64_t Prerequisite for #223 See: https://github.com/zephyrproject-rtos/zephyr/releases/tag/zephyr-v2.4.0 PR: #467
2020-12-02feat(display): Initial widget/status screen work.Pete Johanson
* Battery and output status widgets * Built in status screen combining them. * Ability to define a custom status screen factory function.
2020-11-21refactor: change `keypad` to `keyboard`innovaker
The application usage used by report 1 is `HID_USAGE_GD_KEYBOARD`. Moreover, the `keys` usage page (0x07) that primarily feeds into this report is predominantly keyboard codes. The rest of the system should align with this naming convention.
2020-11-03refactor(hid): Replace deprecated HID usage page referencesinnovaker
Deprecate `USAGE_KEYPAD` and replace with `HID_USAGE_KEY`. Deprecate `USAGE_CONSUMER` and replace with `HID_USAGE_CONSUMER`. Closes #217.
2020-10-28feat(endpoints): add preferred endpoint settingJoel Spadin
Added a new setting to remember the user's preferred endpoint. When both USB and BLE are connected, the preferred endpoint will be used. Added a new behavior to control this setting. It supports commands: &end END_USB - Prefer USB output &end END_BLE - Prefer BLE output &end END_TOG - Toggle between USB and BLE
2020-10-28feat(endpoints): update on BLE profile changeJoel Spadin
Added zmk_ble_active_profile_is_connected() to allow code outside ble.c to check the status of the active profile, and changed the ble_active_profile_changed event to also notify when the active profile connects or disconnects. Changed endpoint selection to to also update when the active profile changes, connects, or disconnects.
2020-10-28feat(endpoints): clear HID report on endpoint changeJoel Spadin
This prevents stuck keys when switching endpoints by clearing everything in the HID report and sending one last report before switching to the new endpoint.
2020-10-28feat: only send HID reports to one endpointJoel Spadin
Added some utility functions and an event for tracking the state of the USB connection. Updated endpoints.c to select a single endpoint to send HID reports to based on the status of the USB and BLE connections. Partially fixes #206. Future commits will add a user setting to control which endpoint is used if both USB and BLE are ready.
2020-10-04refactor(usb): Report USB status w/o HID output.Pete Johanson
2020-09-14chore: clang-format the codebase.Pete Johanson
* Use the LLVM style * Override indent width (8) and column limit (100) * Fixes #142.
2020-09-10fix: Switch to single AUTHORS file.* Closes #164Pete Johanson
2020-07-25Remove extra '#'.Pete Johanson
2020-07-07Use SYS_INIT for BLE and USB init.Pete Johanson
2020-06-22Fix consumer keys w/ refactored behaviors.Pete Johanson
2020-06-20Lots more pieces toward HID working again.Pete Johanson
2020-06-08Move Zephyr app into subdirectory.Pete Johanson