summaryrefslogtreecommitdiff
path: root/include/video_console.h
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2017-09-13 18:12:21 -0400
committerAnatolij Gustschin <agust@denx.de>2017-09-29 17:53:21 +0200
commita085aa1f2737baf60d322296f02c066ee3c6a53e (patch)
tree8bc7a47f5cc1ac717f0dc230e13ec4c7ddc49ad7 /include/video_console.h
parent889808da9b78d193e5a117a6bf6bc9366d6a3f30 (diff)
dm: video: Add basic ANSI escape sequence support
Really just the subset that is needed by efi_console. Perhaps more will be added later, for example color support would be useful to implement efi_cout_set_attribute(). Signed-off-by: Rob Clark <robdclark@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/video_console.h')
-rw-r--r--include/video_console.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/video_console.h b/include/video_console.h
index 26047934da..9dce234bd9 100644
--- a/include/video_console.h
+++ b/include/video_console.h
@@ -29,6 +29,9 @@
* @xsize_frac: Width of the display in fractional units
* @xstart_frac: Left margin for the text console in fractional units
* @last_ch: Last character written to the text console on this line
+ * @escape: TRUE if currently accumulating an ANSI escape sequence
+ * @escape_len: Length of accumulated escape sequence so far
+ * @escape_buf: Buffer to accumulate escape sequence
*/
struct vidconsole_priv {
struct stdio_dev sdev;
@@ -42,6 +45,14 @@ struct vidconsole_priv {
int xsize_frac;
int xstart_frac;
int last_ch;
+ /*
+ * ANSI escape sequences are accumulated character by character,
+ * starting after the ESC char (0x1b) until the entire sequence
+ * is consumed at which point it is acted upon.
+ */
+ int escape;
+ int escape_len;
+ char escape_buf[32];
};
/**