diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-11-30 01:42:58 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-11-30 01:42:58 +0300 |
commit | 295266178c298bcf69f5954decd9493dbe195e5a (patch) | |
tree | 80b5356ddc19fa97fd28c0b7534399a0db15f8b3 /zephyr/src | |
parent | a6de451a13c4bac3b9d15e4ff13b6754b8b634d5 (diff) | |
download | micropython-295266178c298bcf69f5954decd9493dbe195e5a.tar.gz micropython-295266178c298bcf69f5954decd9493dbe195e5a.zip |
zephyr/zephyr_getchar: Update to Zephyr 1.6 unified kernel API.
Diffstat (limited to 'zephyr/src')
-rw-r--r-- | zephyr/src/zephyr_getchar.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/zephyr/src/zephyr_getchar.c b/zephyr/src/zephyr_getchar.c index 0f673c9c80..95912f3df2 100644 --- a/zephyr/src/zephyr_getchar.c +++ b/zephyr/src/zephyr_getchar.c @@ -43,12 +43,12 @@ static int console_irq_input_hook(uint8_t ch) i_put = i_next; } //printk("%x\n", ch); - nano_isr_sem_give(&uart_sem); + k_sem_give(&uart_sem); return 1; } uint8_t zephyr_getchar(void) { - nano_task_sem_take(&uart_sem, TICKS_UNLIMITED); + k_sem_take(&uart_sem, K_FOREVER); unsigned int key = irq_lock(); uint8_t c = uart_ringbuf[i_get++]; i_get &= UART_BUFSIZE - 1; @@ -57,7 +57,7 @@ uint8_t zephyr_getchar(void) { } void zephyr_getchar_init(void) { - nano_sem_init(&uart_sem); + k_sem_init(&uart_sem, 0, UINT_MAX); 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); |