File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
tests/benchmarks/multicore/idle_comp/src Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 77#include <zephyr/drivers/comparator.h>
88#include <zephyr/drivers/gpio.h>
99#include <zephyr/kernel.h>
10+ #include <zephyr/pm/device_runtime.h>
1011
1112static const struct device * test_dev = DEVICE_DT_GET (DT_ALIAS (test_comp ));
1213static const struct gpio_dt_spec test_pin = GPIO_DT_SPEC_GET (DT_PATH (zephyr_user ), test_gpios );
@@ -24,21 +25,29 @@ int main(void)
2425
2526 gpio_pin_configure_dt (& test_pin , GPIO_OUTPUT_INACTIVE );
2627
28+ pm_device_runtime_enable (test_dev );
29+ pm_device_runtime_get (test_dev );
30+
2731 rc = comparator_set_trigger_callback (test_dev , test_callback , NULL );
2832 __ASSERT_NO_MSG (rc == 0 );
2933
3034 rc = comparator_set_trigger (test_dev , COMPARATOR_TRIGGER_BOTH_EDGES );
3135 __ASSERT_NO_MSG (rc == 0 );
32- k_msleep (1000 );
3336
3437 while (1 ) {
3538 counter = 0 ;
39+ k_msleep (200 );
3640 gpio_pin_set_dt (& test_pin , 1 );
37- k_msleep (1000 );
41+ k_msleep (400 );
3842 __ASSERT_NO_MSG (counter == 1 );
3943 gpio_pin_set_dt (& test_pin , 0 );
40- k_msleep (1000 );
44+ k_msleep (400 );
4145 __ASSERT_NO_MSG (counter == 2 );
46+ pm_device_runtime_put (test_dev );
47+ k_msleep (1000 );
48+
49+ pm_device_runtime_get (test_dev );
50+ k_msleep (1 );
4251 }
4352 return 0 ;
4453}
You can’t perform that action at this time.
0 commit comments