Skip to content

Commit 2e06803

Browse files
nordic-krchrlubos
authored andcommitted
tests: benchmarks: multicore: idle_uarte: Enable device runtime PM
Enable runtime PM for UART device is CONFIG_PM_DEVICE_RUNTIME=y. Signed-off-by: Krzysztof Chruściński <[email protected]>
1 parent ee8c3e2 commit 2e06803

File tree

1 file changed

+7
-0
lines changed
  • tests/benchmarks/multicore/idle_uarte/src

1 file changed

+7
-0
lines changed

tests/benchmarks/multicore/idle_uarte/src/main.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
#include <zephyr/drivers/uart.h>
8+
#include <zephyr/pm/device_runtime.h>
89
#include <zephyr/kernel.h>
910
#include <zephyr/logging/log.h>
1011

@@ -23,6 +24,7 @@ LOG_MODULE_REGISTER(idle_uarte);
2324
#define TEST_BUFFER_LEN 10
2425

2526
static const struct device *const uart_dev = DEVICE_DT_GET(UART_NODE);
27+
static const struct device *const console_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_console));
2628

2729
const uint8_t test_pattern[TEST_BUFFER_LEN] = {0x11, 0x12, 0x13, 0x14, 0x15,
2830
0x16, 0x17, 0x18, 0x19, 0x20};
@@ -96,6 +98,11 @@ int main(void)
9698
return -1;
9799
}
98100

101+
if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) {
102+
pm_device_runtime_enable(uart_dev);
103+
pm_device_runtime_enable(console_dev);
104+
}
105+
99106
while (1) {
100107
printk("Hello\n");
101108

0 commit comments

Comments
 (0)