diff options
Diffstat (limited to 'firmware/microblaze/lib/hal_io.c')
-rw-r--r-- | firmware/microblaze/lib/hal_io.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/firmware/microblaze/lib/hal_io.c b/firmware/microblaze/lib/hal_io.c index 18cc34aaf..0e3754958 100644 --- a/firmware/microblaze/lib/hal_io.c +++ b/firmware/microblaze/lib/hal_io.c @@ -252,6 +252,15 @@ fngets(hal_uart_name_t u, char * const s, int len) return (x-s)-1; } +int +fngets_timeout(hal_uart_name_t u, char * const s, int len) +{ + char *x = s; + while(((*x=(char)hal_uart_getc_timeout(u)) != '\n') && ((x-s) < len)) x++; + *x = 0; + return (x-s)-1; +} + char * gets(char * const s) { |