1 parent a6de451 commit 2952661Copy full SHA for 2952661
1 file changed
zephyr/src/zephyr_getchar.c
@@ -43,12 +43,12 @@ static int console_irq_input_hook(uint8_t ch)
43
i_put = i_next;
44
}
45
//printk("%x\n", ch);
46
- nano_isr_sem_give(&uart_sem);
+ k_sem_give(&uart_sem);
47
return 1;
48
49
50
uint8_t zephyr_getchar(void) {
51
- nano_task_sem_take(&uart_sem, TICKS_UNLIMITED);
+ k_sem_take(&uart_sem, K_FOREVER);
52
unsigned int key = irq_lock();
53
uint8_t c = uart_ringbuf[i_get++];
54
i_get &= UART_BUFSIZE - 1;
@@ -57,7 +57,7 @@ uint8_t zephyr_getchar(void) {
57
58
59
void zephyr_getchar_init(void) {
60
- nano_sem_init(&uart_sem);
+ k_sem_init(&uart_sem, 0, UINT_MAX);
61
uart_console_in_debug_hook_install(console_irq_input_hook);
62
// All NULLs because we're interested only in the callback above
63
uart_register_input(NULL, NULL, NULL);
0 commit comments