summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaureen Helm <maureen.helm@intel.com>2022-01-03 17:19:37 -0600
committerDamien George <damien@micropython.org>2022-01-06 14:09:39 +1100
commit1e5df0982aea7adaac74ce9be3be62a638660fcd (patch)
treed4a9e6bfb6a75903b394d21d1194c2394ae4bff0
parent080a9e906d2ab231dad5c984d55608a340ddb68c (diff)
zephyr: Get UART console device from devicetree instead of Kconfig.
Updates the Zephyr port to get the UART console device from devicetree instead of Kconfig. The Kconfig option CONFIG_UART_CONSOLE_ON_DEV_NAME was removed in Zephyr v2.7.0. Signed-off-by: Maureen Helm <maureen.helm@intel.com>
-rw-r--r--ports/zephyr/uart_core.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/ports/zephyr/uart_core.c b/ports/zephyr/uart_core.c
index 44bdeb5c2..1313a51ae 100644
--- a/ports/zephyr/uart_core.c
+++ b/ports/zephyr/uart_core.c
@@ -53,10 +53,8 @@ void mp_hal_stdout_tx_strn(const char *str, mp_uint_t len) {
}
}
#else
- static const struct device *uart_console_dev;
- if (uart_console_dev == NULL) {
- uart_console_dev = device_get_binding(CONFIG_UART_CONSOLE_ON_DEV_NAME);
- }
+ static const struct device *uart_console_dev =
+ DEVICE_DT_GET(DT_CHOSEN(zephyr_console));
while (len--) {
uart_poll_out(uart_console_dev, *str++);