summaryrefslogtreecommitdiffstatshomepage
path: root/zephyr/src
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-10-26 17:49:20 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-10-28 17:53:10 +0300
commitb0feef7a57cc31cb54be39839411962abef6d838 (patch)
treea2e96f193b898060bda34340e6642e390229724f /zephyr/src
parentc28f9df63a8be93559621be0daa24403893c73d8 (diff)
downloadmicropython-b0feef7a57cc31cb54be39839411962abef6d838.tar.gz
micropython-b0feef7a57cc31cb54be39839411962abef6d838.zip
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.
Diffstat (limited to 'zephyr/src')
-rw-r--r--zephyr/src/zephyr_getchar.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/zephyr/src/zephyr_getchar.c b/zephyr/src/zephyr_getchar.c
index 89e3e0efbc..0f673c9c80 100644
--- a/zephyr/src/zephyr_getchar.c
+++ b/zephyr/src/zephyr_getchar.c
@@ -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);
}