Skip to content

Commit

Permalink
tests: drivers: gpio: egpio_basic_api: switch to k_sleep
Browse files Browse the repository at this point in the history
When using `k_busy_wait`, icbmsg fails to handle
messaging on APP side.

Signed-off-by: Marcin Szymczyk <[email protected]>
  • Loading branch information
masz-nordic committed Oct 22, 2024
1 parent 4b98781 commit 1c37e62
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/drivers/gpio/egpio_basic_api/src/test_egpio_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ static const struct device *const dev_in = DEVICE_DT_GET(DEV_IN);
/* Delay after pull input config to allow signal to settle. The value
* selected is conservative (higher than may be necessary).
*/
#define PULL_DELAY_US 1000U
#define PULL_DELAY_MS K_MSEC(1U)

/* Short-hand for a checked read of PIN_IN raw state */
static bool raw_in(void)
{
k_busy_wait(PULL_DELAY_US);
k_sleep(PULL_DELAY_MS);
gpio_port_value_t v;
int rc = gpio_port_get_raw(dev_in, &v);

Expand All @@ -41,7 +41,7 @@ static void raw_out(bool set)
}
zassert_equal(rc, 0,
"raw_out failed");
k_busy_wait(PULL_DELAY_US);
k_sleep(PULL_DELAY_MS);
}

/* Short-hand for a checked write of PIN_OUT logic state */
Expand All @@ -56,7 +56,7 @@ static void logic_out(bool set)
}
zassert_equal(rc, 0,
"raw_out failed");
k_busy_wait(PULL_DELAY_US);
k_sleep(PULL_DELAY_MS);
}

/* Verify device, configure for physical in and out, verify
Expand Down Expand Up @@ -85,7 +85,7 @@ static int setup(void)
zassert_equal(rc, 0,
"pin config output low failed");

k_busy_wait(PULL_DELAY_US);
k_sleep(PULL_DELAY_MS);

rc = gpio_port_get_raw(dev_in, &v1);
zassert_equal(rc, 0,
Expand Down Expand Up @@ -114,7 +114,7 @@ static int setup(void)
zassert_equal(rc, 0,
"pin config output high failed");

k_busy_wait(PULL_DELAY_US);
k_sleep(PULL_DELAY_MS);

rc = gpio_port_get_raw(dev_in, &v1);
zassert_equal(rc, 0,
Expand Down

0 comments on commit 1c37e62

Please sign in to comment.