Generalize "cls" command
PATCH 1/1 Generalize "cls" command
From: Pali Roh?r <[email protected]>
Add unified command "cls". Previously this command existed only as part of the LCD driver, now it is available for other users as well and supports clearing ANSI terminal. The command is enabled for all boards defining CONFIG_LCD to be backward compatible.
Also add command description to README and fix nokia_rx51 board config file to enable the "cls" command.
---
This patch is a rework based on the original patch
http://patchwork.ozlabs.org/patch/217492/
README | 1 + common/Makefile | 1 + common/cmd_cls.c | 37 +++++++++++++++++++++++++++++++++++++ common/lcd.c | 13 ------------- include/common.h | 9 +++++++++ include/configs/nokia_rx51.h | 2 +- 6 files changed, 49 insertions(+), 14 deletions(-) create mode 100644 common/cmd_cls.c
README +1 -0
@@ -819,6 +819,7 @@ The following options need to be configured: CONFIG_CMD_BSP * Board specific commands CONFIG_CMD_BOOTD bootd CONFIG_CMD_CACHE * icache, dcache + CONFIG_CMD_CLS clear screen CONFIG_CMD_CONSOLE coninfo CONFIG_CMD_CRC32 * crc32 CONFIG_CMD_DATE * support for RTC, date/time...
common/Makefile +1 -0
@@ -80,6 +80,7 @@ COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o COBJS-$(CONFIG_CMD_BOOTSTAGE) += cmd_bootstage.o COBJS-$(CONFIG_CMD_CACHE) += cmd_cache.o COBJS-$(CONFIG_CMD_CBFS) += cmd_cbfs.o +COBJS-$(CONFIG_CMD_CLS) += cmd_cls.o COBJS-$(CONFIG_CMD_CONSOLE) += cmd_console.o COBJS-$(CONFIG_CMD_CPLBINFO) += cmd_cplbinfo.o COBJS-$(CONFIG_DATAFLASH_MMC_SELECT) += cmd_dataflash_mmc_mux.o
common/cmd_cls.c new file +37 -0
@@ -0,0 +1,37 @@ +/* +* Copyright 2011 +* Marcel Mol, MESA Consulting, marcel at mesa.nl +* +* Copyright 2011 +* Pali Roh?r, pali.rohar at gmail.com +* +* See file CREDITS for list of people who contributed to this +* project. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +*/ + +#include <common.h> +#include <command.h> +#include <ansi.h> +#include <lcd.h> + +static int do_clear (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) +{ +#ifdef CONFIG_LCD +lcd_clear (); +#else +puts (ANSI_CLEAR_CONSOLE ); +printf (ANSI_CURSOR_POSITION ,1 ,1 ); +#endif +return 0 ; +} + +U_BOOT_CMD ( + cls,1 ,1 , do_clear, +"clear screen" , +"" +);
common/lcd.c +0 -13
@@ -449,19 +449,6 @@ void lcd_clear(void)lcd_sync (); } -static int do_lcd_clear (cmd_tbl_t *cmdtp,int flag,int argc, -char *const argv[]) -{ -lcd_clear (); -return 0 ; -} - -U_BOOT_CMD ( - cls,1 ,1 , do_lcd_clear, -"clear screen" , -"" -); -/*----------------------------------------------------------------------*/ static int lcd_init (void *lcdbase)
include/common.h +9 -0
@@ -1015,4 +1015,13 @@ static inline void unmap_sysmem(const void *vaddr)# include <environment.h> #endif +/* +* Boards with LCD support always provided the "cls" command. +* Enable this command for these boards to be backward +* compatible. +*/ +#if defined(CONFIG_LCD ) +#define CONFIG_CMD_CLS +#endif +#endif /* __COMMON_H_ */
include/configs/nokia_rx51.h +1 -1
@@ -148,7 +148,7 @@#define CONFIG_CMDLINE_EDITING /* add command line history */ #define CONFIG_AUTO_COMPLETE /* add autocompletion support */ -#define CONFIG_CMD_CLEAR /* ANSI terminal clear screen command */ +#define CONFIG_CMD_CLS /* ANSI terminal clear screen command */ #ifdef ONENAND_SUPPORT
Signature · 1 line
1.7.5.4
PATCH 1/1 Generalize "cls" command
Hi,
Quoted 18 lines · On Sat, 30 Mar 2013 19:53:40 +0100 Anatolij Gustschin <[email protected]> wrote:
From: Pali Roh?r <[email protected]>
Add unified command "cls". Previously this command existed only as part of the LCD driver, now it is available for other users as well and supports clearing ANSI terminal. The command is enabled for all boards defining
CONFIG_LCDto be backward compatible.Also add command description to README and fix
nokia_rx51board config file to enable the "cls" command.Signed-off-by Pali Roh?r <[email protected]>Cc Marcel Mol <[email protected]>Signed-off-by Anatolij Gustschin <[email protected]>---
This patch is a rework based on the original patch
http://patchwork.ozlabs.org/patch/217492/
Quoted 8 lines
README | 1 + common/Makefile | 1 + common/cmd_cls.c | 37 +++++++++++++++++++++++++++++++++++++ common/lcd.c | 13 ------------- include/common.h | 9 +++++++++ include/configs/nokia_rx51.h | 2 +- 6 files changed, 49 insertions(+), 14 deletions(-) create mode 100644 common/cmd_cls.c
Applied to u-boot-staging/agust at denx.de after re-base.
Thanks,
Anatolij