Skip to content

Commit 2952661

Browse files
committed
zephyr/zephyr_getchar: Update to Zephyr 1.6 unified kernel API.
1 parent a6de451 commit 2952661

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

zephyr/src/zephyr_getchar.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ static int console_irq_input_hook(uint8_t ch)
4343
i_put = i_next;
4444
}
4545
//printk("%x\n", ch);
46-
nano_isr_sem_give(&uart_sem);
46+
k_sem_give(&uart_sem);
4747
return 1;
4848
}
4949

5050
uint8_t zephyr_getchar(void) {
51-
nano_task_sem_take(&uart_sem, TICKS_UNLIMITED);
51+
k_sem_take(&uart_sem, K_FOREVER);
5252
unsigned int key = irq_lock();
5353
uint8_t c = uart_ringbuf[i_get++];
5454
i_get &= UART_BUFSIZE - 1;
@@ -57,7 +57,7 @@ uint8_t zephyr_getchar(void) {
5757
}
5858

5959
void zephyr_getchar_init(void) {
60-
nano_sem_init(&uart_sem);
60+
k_sem_init(&uart_sem, 0, UINT_MAX);
6161
uart_console_in_debug_hook_install(console_irq_input_hook);
6262
// All NULLs because we're interested only in the callback above
6363
uart_register_input(NULL, NULL, NULL);

0 commit comments

Comments
 (0)