[PATCH v1 1/2] video: Add VIDEO_FONT_4x6 to Kconfig add fix compile waring

From: qianfan Zhao qianfanguijin@163.com
CONFIG_VIDEO_FONT_4x6 is referenced in include/video_font.h, but doesn't has a Kconfig configuration.
Add it.
Signed-off-by: qianfan Zhao qianfanguijin@163.com --- drivers/video/Kconfig | 8 ++++++++ include/video_font_4x6.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index e2cf1e752f..7b2efdfd8a 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -138,6 +138,14 @@ config CONSOLE_NORMAL CONFIG_CONSOLE_ROTATION for that). A built-in 8x16 font is used for the display.
+config VIDEO_FONT_4X6 + bool "Minuscule 4x6 font" + depends on CONSOLE_NORMAL + default n + help + Use Minuscule 4x6 font for code page 437, 8x16 bitmap font is used + by default if this options is not selected. + config CONSOLE_ROTATION bool "Support rotated displays" depends on DM_VIDEO diff --git a/include/video_font_4x6.h b/include/video_font_4x6.h index c7e6351b64..65dd5e8c1d 100644 --- a/include/video_font_4x6.h +++ b/include/video_font_4x6.h @@ -46,7 +46,7 @@ __END__; #define VIDEO_FONT_HEIGHT 6 #define VIDEO_FONT_SIZE (VIDEO_FONT_CHARS * VIDEO_FONT_HEIGHT)
-static unsigned char video_fontdata[VIDEO_FONT_SIZE] = { +static unsigned char __maybe_unused video_fontdata[VIDEO_FONT_SIZE] = {
/*{*/ /* Char 0: ' ' */

From: qianfan Zhao qianfanguijin@163.com
Add support \, \r, \n, \t and \b.
eg: => lcdputs "hello\nworld"
Signed-off-by: qianfan Zhao qianfanguijin@163.com --- drivers/video/vidconsole-uclass.c | 34 +++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-)
diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index f42db40d4c..d2554fd3f7 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -709,15 +709,45 @@ static int do_video_puts(struct cmd_tbl *cmdtp, int flag, int argc, { struct udevice *dev; const char *s; + char c;
if (argc != 2) return CMD_RET_USAGE;
if (uclass_first_device_err(UCLASS_VIDEO_CONSOLE, &dev)) return CMD_RET_FAILURE; - for (s = argv[1]; *s; s++) - vidconsole_put_char(dev, *s);
+ for (s = argv[1]; (c = *s); s++) { + if (c == '\') { + s++; + + switch (*s) { + case '\0': + goto sync; + case '\': + c = '\'; + break; + case 'r': + c = '\r'; + break; + case 'n': + c = '\n'; + break; + case 't': + c = '\t'; + break; + case 'b': + c = '\b'; + break; + default: + continue; + } + } + + vidconsole_put_char(dev, c); + } + +sync: return video_sync(dev->parent, false); }
participants (1)
-
qianfanguijin@163.com