Commit b0feef7a authored by Paul Sokolovsky's avatar Paul Sokolovsky

zephyr/zephyr_getchar: Update for recent Zephyr refactor of console hooks.

uart_irq_input_hook_set() was renamed to uart_console_in_debug_hook_install()
and accepts different params.
parent c28f9df6
CONFIG_STDOUT_CONSOLE=y
CONFIG_CONSOLE_HANDLER=y
CONFIG_UART_CONSOLE_DEBUG_SERVER_HOOKS=y
CONFIG_NEWLIB_LIBC=y
CONFIG_FLOAT=y
......@@ -28,7 +28,7 @@ static struct nano_sem uart_sem;
static uint8_t uart_ringbuf[UART_BUFSIZE];
static uint8_t i_get, i_put;
static int console_irq_input_hook(struct device *dev, uint8_t ch)
static int console_irq_input_hook(uint8_t ch)
{
int i_next = (i_put + 1) & (UART_BUFSIZE - 1);
if (i_next == i_get) {
......@@ -58,8 +58,7 @@ uint8_t zephyr_getchar(void) {
void zephyr_getchar_init(void) {
nano_sem_init(&uart_sem);
struct device *uart_console_dev = device_get_binding(CONFIG_UART_CONSOLE_ON_DEV_NAME);
uart_irq_input_hook_set(uart_console_dev, console_irq_input_hook);
uart_console_in_debug_hook_install(console_irq_input_hook);
// All NULLs because we're interested only in the callback above
uart_register_input(NULL, NULL, NULL);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment