Skip to content
Snippets Groups Projects
Commit 56a514c1 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

zephyr/uart_core: Access console UART directly instead of printk() hack.

This is required to avoid extra level of output "cooking" ("\r\r\n") and
make test infrastructure work. On the other hand, this breaks somewhat
Zephyr console abstraction.
parent 0c59c30f
No related branches found
No related tags found
No related merge requests found
...@@ -26,9 +26,8 @@ ...@@ -26,9 +26,8 @@
#include <unistd.h> #include <unistd.h>
#include "py/mpconfig.h" #include "py/mpconfig.h"
#include "src/zephyr_getchar.h" #include "src/zephyr_getchar.h"
// Zephyr headers
// Stopgap #include <uart.h>
extern void printk(const char*, ...);
/* /*
* Core UART functions to implement for a port * Core UART functions to implement for a port
...@@ -41,7 +40,12 @@ int mp_hal_stdin_rx_chr(void) { ...@@ -41,7 +40,12 @@ int mp_hal_stdin_rx_chr(void) {
// Send string of given length // Send string of given length
void mp_hal_stdout_tx_strn(const char *str, mp_uint_t len) { void mp_hal_stdout_tx_strn(const char *str, mp_uint_t len) {
static struct device *uart_console_dev;
if (uart_console_dev == NULL) {
uart_console_dev = device_get_binding(CONFIG_UART_CONSOLE_ON_DEV_NAME);
}
while (len--) { while (len--) {
printk("%c", *str++); uart_poll_out(uart_console_dev, *str++);
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment