Skip to content

Commit 345f201

Browse files
committed
feat(mouse): Upgrade PS/2 mouse code to zephyr 3.5
PS2 Mouse: Increase init priority to be after UART drivers PS2 Mouse: Add config option to disable additional error mitigation Auto Layer: Add automatic layer toggling on mouse movement PS2 Mouse: Log transmission error reason Auto Layer: Fixes Scroll Mode: Initial implementation PS2 Mouse: Auto lint code PS2 Mouse: Scroll mode improvements (uncommitted changes from 3 month ago) Mouse Settings & Scroll Mode: Apply new auto-formatting Mouse Settings: Silence zephyr 3.5 compile warnings PS2 Mouse: Move to zephyr 3.5 input system PS2 Mouse: Add mouse ps2 work queue PS2 Mouse: Increase err_msg buffer size for zmk_mouse_ps2_send_cmd_resp to avoid truncating Mouse Settings & Scroll Mode: Update mouse settings and scroll mode behaviors to new labelless behavior init method PS2 Mouse: Disable restore of mouse PS2 settings Mouse Auto Layer: Added toggle delay to prevent accidental activations PS2 Mouse: Added script to generate interrupt priority overrides for zmk-config PS2 Mouse: Don’t override interrupt priorities in all zmk builds by default PS2 Mouse: Reset device if invalid self-test result is received PS2 Mouse: Delay PS2 init sequence to give mouse time to send init data PS2 Mouse: Remove kconfig settings that are handled by input-config PS2 Mouse: Log when settings were set successfully PS2 Mouse: Moved sampling rate and press to select from kconfig to device tree PS2 Mouse: Added devicetree settings for TP settings Correct val6 default value PS2 Mouse: Enable settings restore again PS2 Mouse: Don’t restore runtime settings if device config is present Mouse Settings: Added log and reset behavior Adjust settings log PS2 Mouse: Fix wrong type for tp press to select var PS2 Mouse: Replace kconfig enable clicking with devicetree disable clicking PS2 Mouse: Disable error mitigations by default PS2 Mouse: Moved axis options from kconfig to devicetree PS2 Mouse: Removed scroll mode behavior PS2 Mouse: Move scroll mode from kconfig to devicetree PS2 Mouse: Removed movement buffer / queue Remove butter kconfigs PS2 Mouse: Convert clicking to zephyr 3.5 input system Mouse Auto Layer: Removed it in preparation for zephyr 3.5 module PS2 Mouse: Moved mouse_ps2 driver to module
1 parent 2794f12 commit 345f201

File tree

15 files changed

+798
-1003
lines changed

15 files changed

+798
-1003
lines changed

app/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ target_sources_ifdef(CONFIG_ZMK_USB app PRIVATE src/usb_hid.c)
9696
target_sources_ifdef(CONFIG_ZMK_RGB_UNDERGLOW app PRIVATE src/rgb_underglow.c)
9797
target_sources_ifdef(CONFIG_ZMK_BACKLIGHT app PRIVATE src/backlight.c)
9898
target_sources_ifdef(CONFIG_ZMK_LOW_PRIORITY_WORK_QUEUE app PRIVATE src/workqueue.c)
99-
target_sources_ifdef(CONFIG_ZMK_MOUSE_PS2 app PRIVATE src/mouse/mouse_ps2.c)
100-
target_sources_ifdef(CONFIG_ZMK_MOUSE_PS2 app PRIVATE src/behaviors/behavior_mouse_setting.c)
99+
target_sources_ifdef(CONFIG_ZMK_INPUT_MOUSE_PS2 app PRIVATE src/behaviors/behavior_mouse_setting.c)
100+
101101
target_sources(app PRIVATE src/main.c)
102102

103103
add_subdirectory(src/display/)

app/dts/arm/nordic/override.dtsi

Lines changed: 0 additions & 1 deletion
This file was deleted.

app/dts/behaviors/mouse_setting.dtsi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
behaviors {
99
mms: behavior_mouse_setting {
1010
compatible = "zmk,behavior-mouse-setting";
11-
label = "MOUSE_SETTING";
1211
#binding-cells = <1>;
1312
};
1413
};

app/dts/bindings/zmk,mouse-ps2.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

app/include/dt-bindings/zmk/mouse_settings.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
*/
66
#pragma once
77

8+
#define MS_LOG 0
9+
#define MS_RESET 1
10+
811
#define MS_TP_SENSITIVITY_INCR 10
912
#define MS_TP_SENSITIVITY_DECR 11
1013

app/module/drivers/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ add_subdirectory_ifdef(CONFIG_GPIO gpio)
55
add_subdirectory_ifdef(CONFIG_KSCAN kscan)
66
add_subdirectory_ifdef(CONFIG_SENSOR sensor)
77
add_subdirectory_ifdef(CONFIG_DISPLAY display)
8+
add_subdirectory_ifdef(CONFIG_INPUT input)

app/module/drivers/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ rsource "gpio/Kconfig"
55
rsource "kscan/Kconfig"
66
rsource "sensor/Kconfig"
77
rsource "display/Kconfig"
8+
rsource "input/Kconfig"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright (c) 2022 The ZMK Contributors
2+
# SPDX-License-Identifier: MIT
3+
4+
zephyr_library_amend()
5+
6+
zephyr_library_sources_ifdef(CONFIG_ZMK_INPUT_MOUSE_PS2 input_mouse_ps2.c)

app/module/drivers/input/Kconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright (c) 2022 The ZMK Contributors
2+
# SPDX-License-Identifier: MIT
3+
4+
DT_COMPAT_ZMK_INPUT_PS2_MOUSE := zmk,input-mouse-ps2
5+
6+
config ZMK_INPUT_MOUSE_PS2
7+
bool
8+
default $(dt_compat_enabled,$(DT_COMPAT_ZMK_INPUT_PS2_MOUSE))
9+
depends on (!ZMK_SPLIT || ZMK_SPLIT_ROLE_CENTRAL)
10+
select ZMK_MOUSE
11+
select PS2
12+
13+
if ZMK_INPUT_MOUSE_PS2
14+
15+
config ZMK_INPUT_MOUSE_PS2_ENABLE_ERROR_MITIGATION
16+
bool "Tries to mitigate transmission errors. Only useful when using a PS2 driver that is prone to miscommunication like the GPIO bitbanging driver."
17+
default n
18+
19+
endif # ZMK_INPUT_MOUSE_PS2

0 commit comments

Comments
 (0)