From cde03fa23e2fa47707ef81b9a91b1f4b631adbb7 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 1 Oct 2023 19:15:23 -0600 Subject: 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 --- include/console.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/console.h b/include/console.h index ceb733b5cb6..e29817e57b0 100644 --- a/include/console.h +++ b/include/console.h @@ -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. */ -- cgit v1.2.3