mirror of
https://github.com/zmkfirmware/zmk.git
synced 2026-03-20 04:55:20 -05:00
Tweaks for orientation and A/B pins for Kyria left
This commit is contained in:
@@ -10,8 +10,8 @@
|
||||
encoder: encoder0 {
|
||||
compatible = "alps,ec11";
|
||||
label = "Rotary Encoder";
|
||||
a-gpios = <&pro_micro_d 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
|
||||
b-gpios = <&pro_micro_d 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
|
||||
a-gpios = <&pro_micro_d 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
|
||||
b-gpios = <&pro_micro_d 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
|
||||
resolution = <4>;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -41,10 +41,10 @@ static int ec11_sample_fetch(struct device *dev, enum sensor_channel chan)
|
||||
|
||||
switch(val | (drv_data->ab_state << 2)) {
|
||||
case 0b0010: case 0b0100: case 0b1101: case 0b1011:
|
||||
delta = 1;
|
||||
delta = -1;
|
||||
break;
|
||||
case 0b0001: case 0b0111: case 0b1110: case 0b1000:
|
||||
delta = -1;
|
||||
delta = 1;
|
||||
break;
|
||||
default:
|
||||
delta = 0;
|
||||
|
||||
Reference in New Issue
Block a user