tests: drivers: gpio: gpio_basic_api
Update to remove failure on GPIO_INT_EDGE_BOTH when devices return -ENOTSUP Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
This commit is contained in:
parent
ba08a9a499
commit
6d7b62452e
1 changed files with 12 additions and 2 deletions
|
@ -40,7 +40,12 @@ ZTEST(after_flash_gpio_config_trigger, test_gpio_config_twice_trigger)
|
|||
|
||||
/* 2. Enable PIN callback as both edges */
|
||||
ret = gpio_pin_interrupt_configure(dev, PIN_IN, GPIO_INT_EDGE_BOTH);
|
||||
zassert_ok(ret, "enable callback failed");
|
||||
if (ret == -ENOTSUP) {
|
||||
TC_PRINT("Both edge GPIO interrupt not supported.\n");
|
||||
gpio_remove_callback(dev, &drv_data->gpio_cb);
|
||||
} else {
|
||||
zassert_ok(ret, "enable callback failed");
|
||||
}
|
||||
|
||||
/* 3. Configure PIN_OUT as open drain, internal pull-up (may trigger
|
||||
* callback)
|
||||
|
@ -87,7 +92,12 @@ ZTEST(after_flash_gpio_config_trigger, test_gpio_config_trigger)
|
|||
|
||||
/* 2. Enable PIN callback as both edges */
|
||||
ret = gpio_pin_interrupt_configure(dev, PIN_IN, GPIO_INT_EDGE_BOTH);
|
||||
zassert_ok(ret, "enable callback failed");
|
||||
if (ret == -ENOTSUP) {
|
||||
TC_PRINT("Both edge GPIO interrupt not supported.\n");
|
||||
gpio_remove_callback(dev, &drv_data->gpio_cb);
|
||||
} else {
|
||||
zassert_ok(ret, "enable callback failed");
|
||||
}
|
||||
|
||||
/* 3. Configure PIN_OUT as open drain, internal pull-up (may trigger
|
||||
* callback)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue