Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/drivers/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,7 @@ static inline int gpio_pin_configure(struct device *port, u32_t pin,
data->invert &= ~BIT(pin);
}
if (api->pin_interrupt_configure) {
flags &= ~GPIO_INT_DEBOUNCE;
ret = z_impl_gpio_pin_interrupt_configure(port, pin, flags);
}

Expand Down
7 changes: 3 additions & 4 deletions tests/drivers/gpio/gpio_basic_api/src/test_callback_manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ static int init_callback(struct device *dev,

if (rc == 0) {
/* 2. configure PIN_IN callback, but don't enable */
rc = gpio_pin_configure(dev, PIN_IN, GPIO_INPUT);
rc = gpio_pin_configure(dev, PIN_IN,
GPIO_INPUT | GPIO_INT_DEBOUNCE);
}

if (rc == 0) {
Expand All @@ -79,9 +80,7 @@ static void trigger_callback(struct device *dev, int enable_cb)
cb_cnt[0] = 0;
cb_cnt[1] = 0;
if (enable_cb == 1) {
gpio_pin_interrupt_configure(dev, PIN_IN,
GPIO_INT_EDGE_RISING
| GPIO_INT_DEBOUNCE);
gpio_pin_interrupt_configure(dev, PIN_IN, GPIO_INT_EDGE_RISING);
} else {
gpio_pin_interrupt_configure(dev, PIN_IN, GPIO_INT_DISABLE);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/drivers/gpio/gpio_basic_api/src/test_callback_trigger.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static int test_callback(int mode)
}

/* 2. configure PIN_IN callback and trigger condition */
rc = gpio_pin_configure(dev, PIN_IN, GPIO_INPUT);
rc = gpio_pin_configure(dev, PIN_IN, GPIO_INPUT | GPIO_INT_DEBOUNCE);
if (rc != 0) {
TC_ERROR("config PIN_IN fail: %d\n", rc);
goto err_exit;
Expand All @@ -90,7 +90,7 @@ static int test_callback(int mode)

/* 3. enable callback, trigger PIN_IN interrupt by operate PIN_OUT */
cb_cnt = 0;
rc = gpio_pin_interrupt_configure(dev, PIN_IN, mode | GPIO_INT_DEBOUNCE);
rc = gpio_pin_interrupt_configure(dev, PIN_IN, mode);
if (rc == -ENOTSUP) {
TC_PRINT("Mode %x not supported\n", mode);
goto pass_exit;
Expand Down