mirror of
https://xff.cz/git/u-boot/
synced 2025-08-31 16:22:36 +02:00
console: Add a function to read a line of the output / eof
When recording the console output for testing it is useful to be able to read the output a line at a time to check that the output is correct. Also we need to check that we get to the end of the output. Add a console function to return the next line and another to see how must data is left. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -621,6 +621,17 @@ void console_record_reset_enable(void)
|
||||
console_record_reset();
|
||||
gd->flags |= GD_FLG_RECORD;
|
||||
}
|
||||
|
||||
int console_record_readline(char *str, int maxlen)
|
||||
{
|
||||
return membuff_readline(&gd->console_out, str, maxlen, ' ');
|
||||
}
|
||||
|
||||
int console_record_avail(void)
|
||||
{
|
||||
return membuff_avail(&gd->console_out);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* test if ctrl-c was pressed */
|
||||
|
Reference in New Issue
Block a user