fix(kscan): Proper pull flag detection for inputs.
* Check against `GPIO_ACTIVE_LOW` properly which has a non-zero value.
This commit is contained in:
parent
32e7ac4782
commit
903ad462ba
1 changed files with 2 additions and 1 deletions
|
@ -110,7 +110,8 @@ static int kscan_charlieplex_set_as_input(const struct gpio_dt_spec *gpio) {
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
gpio_flags_t pull_flag = (gpio->dt_flags & GPIO_ACTIVE_HIGH) ? GPIO_PULL_DOWN : GPIO_PULL_UP;
|
||||
gpio_flags_t pull_flag =
|
||||
((gpio->dt_flags & GPIO_ACTIVE_LOW) == GPIO_ACTIVE_LOW) ? GPIO_PULL_UP : GPIO_PULL_DOWN;
|
||||
|
||||
int err = gpio_pin_configure_dt(gpio, GPIO_INPUT | pull_flag);
|
||||
if (err) {
|
||||
|
|
Loading…
Add table
Reference in a new issue