1 /* 2 * Copyright (c) 2017 Linaro Limited 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #include <string.h> 8 #include <zephyr.h> 9 #include <sys/printk.h> 10 #include <console/console.h> 11 main(void)12void main(void) 13 { 14 console_getline_init(); 15 16 printk("Enter a line\n"); 17 18 while (1) { 19 char *s = console_getline(); 20 21 printk("line: %s\n", s); 22 printk("last char was: 0x%x\n", s[strlen(s) - 1]); 23 } 24 } 25