Skip to content

Commit 11d4e79

Browse files
committed
Scroll speed fix for badjeff's PMW3610 driver
1 parent 247df54 commit 11d4e79

File tree

3 files changed

+34
-18
lines changed

3 files changed

+34
-18
lines changed
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
CONFIG_SPI=y
22
CONFIG_INPUT=y
3-
CONFIG_ZMK_MOUSE=y
3+
CONFIG_ZMK_POINTING=y
44
CONFIG_PMW3610=y
5-
CONFIG_PMW3610_CPI=2000
6-
CONFIG_PMW3610_CPI_DIVIDOR=4
7-
CONFIG_PMW3610_ORIENTATION_90=y
8-
CONFIG_PMW3610_SNIPE_CPI=200
9-
CONFIG_PMW3610_SNIPE_CPI_DIVIDOR=1
10-
CONFIG_PMW3610_SCROLL_TICK=70
5+
CONFIG_PMW3610_SWAP_XY=y
116
CONFIG_PMW3610_INVERT_X=y
12-
CONFIG_PMW3610_POLLING_RATE_125_SW=y
7+
CONFIG_PMW3610_INVERT_Y=y
138
CONFIG_PMW3610_SMART_ALGORITHM=y
149

1510
CONFIG_ZMK_EXT_POWER=y

boards/shields/charybdis/charybdis_right.overlay

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66

77
#include "charybdis.dtsi"
8+
#include <input/processors.dtsi>
9+
#include <zephyr/dt-bindings/input/input-event-codes.h>
810

911
&default_transform {
1012
col-offset = <6>;
@@ -55,19 +57,38 @@
5557
reg = <0>;
5658
spi-max-frequency = <2000000>;
5759
irq-gpios = <&gpio0 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
58-
scroll-layers = <3>;
59-
//snipe-layers = <2>;
60-
// automouse-layer = <3>;
60+
cpi = <1000>;
61+
evt-type = <INPUT_EV_REL>;
62+
x-input-code = <INPUT_REL_X>;
63+
y-input-code = <INPUT_REL_Y>;
64+
65+
force-awake;
66+
/* keep the sensor awake while ZMK activity state is ACTIVE,
67+
fallback to normal downshift mode after ZMK goes into IDLE / SLEEP mode.
68+
thus, the sensor would be a `wakeup-source` */
69+
70+
force-awake-4ms-mode;
71+
/* while force-awake is acitvated, enable this mode to force sampling per
72+
4ms, where the default sampling rate is 8ms. */
73+
/* NOTE: apply this mode if you need 250Hz with direct USB connection. */
6174
};
6275
};
6376

6477
/ {
65-
trackball_listener {
66-
compatible = "zmk,input-listener";
67-
device = <&trackball>;
68-
};
78+
trackball_listener {
79+
compatible = "zmk,input-listener";
80+
device = <&trackball>;
81+
82+
input-processors = <&zip_scroll_scaler 1 10>;
83+
84+
scroller {
85+
layers = <3>;
86+
input-processors = <&zip_xy_to_scroll_mapper>;
87+
};
88+
};
6989
};
7090

91+
7192
//RGB bus
7293
//&pinctrl {
7394
// spi3_default: spi3_default {

config/west.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ manifest:
22
remotes:
33
- name: zmkfirmware
44
url-base: https://github.com/zmkfirmware
5-
- name: inorichi
6-
url-base: https://github.com/inorichi
5+
- name: badjeff
6+
url-base: https://github.com/badjeff
77
projects:
88
- name: zmk
99
remote: zmkfirmware
1010
revision: main
1111
import: app/west.yml
1212
- name: zmk-pmw3610-driver
13-
remote: inorichi
13+
remote: badjeff
1414
revision: main
1515
self:
1616
path: config

0 commit comments

Comments
 (0)