refactor: consolidate encoder config

This commit is contained in:
honorless 2024-11-17 15:55:04 -05:00
parent 9da0f34455
commit b85964cf00
No known key found for this signature in database
GPG Key ID: 1B48A311ABE8DA4D
3 changed files with 13 additions and 13 deletions

View File

@ -24,18 +24,19 @@
zmk,backlight = &backlight;
};
left_encoder: encoder_left {
compatible = "alps,ec11";
label = "LEFT_ENCODER";
resolution = <4>;
steps = <40>;
status = "disabled";
};
left_encoder: encoder_left {
compatible = "alps,ec11";
a-gpios = <&gpio1 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&gpio1 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
steps = <40>;
status = "disabled";
};
sensors {
compatible = "zmk,keymap-sensors";
sensors = <&left_encoder>;
};
compatible = "zmk,keymap-sensors";
triggers-per-rotation = <20>;
sensors = <&left_encoder>;
};
default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";

View File

@ -7,6 +7,7 @@ arch: arm
features:
- keys
- display
- encoder
outputs:
- usb
- ble

View File

@ -48,8 +48,6 @@
};
&left_encoder {
a-gpios = <&gpio1 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&gpio1 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
status = "okay";
};
};