video: Add a function to clear the display

Move the code from the 'cls' command into the console file, so it can
be called from elsewhere.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass 2023-10-01 19:15:23 -06:00 committed by Tom Rini
parent c0e708eb9f
commit cde03fa23e
3 changed files with 44 additions and 22 deletions

View file

@ -156,6 +156,16 @@ int console_announce_r(void);
*/
void console_puts_select_stderr(bool serial_only, const char *s);
/**
* console_clear() - Clear the console
*
* Uses an ANSI sequence to clear the display, failing back to clearing the
* video display directly if !CONFIG_VIDEO_ANSI
*
* Return: 0 if OK, -ve on error
*/
int console_clear(void);
/*
* CONSOLE multiplexing.
*/