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.
This commit is contained in:
Paul Sokolovsky 2016-10-26 17:49:20 +03:00
parent c28f9df63a
commit b0feef7a57
2 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,5 @@
CONFIG_STDOUT_CONSOLE=y
CONFIG_CONSOLE_HANDLER=y
CONFIG_UART_CONSOLE_DEBUG_SERVER_HOOKS=y
CONFIG_NEWLIB_LIBC=y
CONFIG_FLOAT=y

View File

@ -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);
}