Skip to content

Commit

Permalink
tests: benchmarks: multicore: idle_uarte: Enable device runtime PM
Browse files Browse the repository at this point in the history
Enable runtime PM for UART device is CONFIG_PM_DEVICE_RUNTIME=y.

Signed-off-by: Krzysztof Chruściński <[email protected]>
  • Loading branch information
nordic-krch authored and rlubos committed Nov 4, 2024
1 parent ee8c3e2 commit 2e06803
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/benchmarks/multicore/idle_uarte/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include <zephyr/drivers/uart.h>
#include <zephyr/pm/device_runtime.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>

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

static const struct device *const uart_dev = DEVICE_DT_GET(UART_NODE);
static const struct device *const console_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_console));

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

if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) {
pm_device_runtime_enable(uart_dev);
pm_device_runtime_enable(console_dev);
}

while (1) {
printk("Hello\n");

Expand Down

0 comments on commit 2e06803

Please sign in to comment.