diff options
| author | Simon Glass <[email protected]> | 2025-04-02 06:29:40 +1300 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-05-02 13:40:25 -0600 |
| commit | 8301239ad05b7b786e96c6a982c92ed06a4944c6 (patch) | |
| tree | 4fce922b7be38fbd01325e46796515d60c3e00df /include | |
| parent | cdd095e48a3934b18a3875c658cbb90d70aa8739 (diff) | |
video: Add a way to write a partial string to the console
When writing multiple lines of text we need to be able to control which
text goes on each line. Add a new vidconsole_put_stringn() function to
help with this.
Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/video_console.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/video_console.h b/include/video_console.h index 1bb265dc9da..e4fc776e2d3 100644 --- a/include/video_console.h +++ b/include/video_console.h @@ -500,6 +500,23 @@ int vidconsole_entry_start(struct udevice *dev); int vidconsole_put_char(struct udevice *dev, char ch); /** + * vidconsole_put_stringn() - Output part of a string to the current console pos + * + * Outputs part of a string to the console and advances the cursor. This + * function handles wrapping to new lines and scrolling the console. Special + * characters are handled also: \n, \r, \b and \t. + * + * The device always starts with the cursor at position 0,0 (top left). It + * can be adjusted manually using vidconsole_position_cursor(). + * + * @dev: Device to adjust + * @str: String to write + * @maxlen: Maximum chars to output, or -1 for all + * Return: 0 if OK, -ve on error + */ +int vidconsole_put_stringn(struct udevice *dev, const char *str, int maxlen); + +/** * vidconsole_put_string() - Output a string to the current console position * * Outputs a string to the console and advances the cursor. This function |
