Skip to content

Commit

Permalink
HWDEV-2398 enalbe pull up for actuator encoder pins
Browse files Browse the repository at this point in the history
  • Loading branch information
Masahiro Wada committed Sep 19, 2024
1 parent b6c3e7b commit aad70c2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lexxpluss_apps/src/actuator_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,12 @@ class encoder {
dev = GPIO_DT_SPEC_GET(DT_NODELABEL(encoder_center_actuator_ch1), gpios);
// PD12 CH1, PD13 CH2
if (gpio_is_ready_dt(&dev)) {
gpio_pin_configure_dt(&dev, GPIO_INPUT | GPIO_ACTIVE_HIGH);
gpio_pin_configure_dt(&dev, GPIO_INPUT | GPIO_PULL_UP | GPIO_ACTIVE_HIGH);
}

dev = GPIO_DT_SPEC_GET(DT_NODELABEL(encoder_center_actuator_ch2), gpios);
if (gpio_is_ready_dt(&dev)) {
gpio_pin_configure_dt(&dev, GPIO_INPUT | GPIO_ACTIVE_HIGH);
gpio_pin_configure_dt(&dev, GPIO_INPUT | GPIO_PULL_UP | GPIO_ACTIVE_HIGH);
}

// set callback function for center
Expand All @@ -170,12 +170,12 @@ class encoder {
dev = GPIO_DT_SPEC_GET(DT_NODELABEL(encoder_left_actuator_ch1), gpios);
// PD12 CH1, PD13 CH2
if (gpio_is_ready_dt(&dev)) {
gpio_pin_configure_dt(&dev, GPIO_INPUT | GPIO_ACTIVE_HIGH);
gpio_pin_configure_dt(&dev, GPIO_INPUT | GPIO_PULL_UP | GPIO_ACTIVE_HIGH);
}

dev = GPIO_DT_SPEC_GET(DT_NODELABEL(encoder_left_actuator_ch2), gpios);
if (gpio_is_ready_dt(&dev)) {
gpio_pin_configure_dt(&dev, GPIO_INPUT | GPIO_ACTIVE_HIGH);
gpio_pin_configure_dt(&dev, GPIO_INPUT | GPIO_PULL_UP | GPIO_ACTIVE_HIGH);
}

// set callback function for LEFT
Expand All @@ -188,12 +188,12 @@ class encoder {
dev = GPIO_DT_SPEC_GET(DT_NODELABEL(encoder_right_actuator_ch1), gpios);
// PD12 CH1, PD13 CH2
if (gpio_is_ready_dt(&dev)) {
gpio_pin_configure_dt(&dev, GPIO_INPUT | GPIO_ACTIVE_HIGH);
gpio_pin_configure_dt(&dev, GPIO_INPUT | GPIO_PULL_UP | GPIO_ACTIVE_HIGH);
}

dev = GPIO_DT_SPEC_GET(DT_NODELABEL(encoder_right_actuator_ch2), gpios);
if (gpio_is_ready_dt(&dev)) {
gpio_pin_configure_dt(&dev, GPIO_INPUT | GPIO_ACTIVE_HIGH);
gpio_pin_configure_dt(&dev, GPIO_INPUT | GPIO_PULL_UP | GPIO_ACTIVE_HIGH);
}

// set callback function for RIGHT
Expand Down

0 comments on commit aad70c2

Please sign in to comment.