Browse Source

Tweaks for orientation and A/B pins for Kyria left

xmkb
Pete Johanson 4 years ago
parent
commit
f3267e6030
  1. 4
      app/boards/shields/kyria/kyria_left.overlay
  2. 4
      app/drivers/zephyr/ec11.c

4
app/boards/shields/kyria/kyria_left.overlay

@ -10,8 +10,8 @@ @@ -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>;
};
};

4
app/drivers/zephyr/ec11.c

@ -41,10 +41,10 @@ static int ec11_sample_fetch(struct device *dev, enum sensor_channel chan) @@ -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;

Loading…
Cancel
Save