From patchwork Sat Dec 17 17:03:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 132012 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id E9C161007DB for ; Sun, 18 Dec 2011 04:19:10 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3B1852832E; Sat, 17 Dec 2011 18:18:25 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YJFlqE8NF0-i; Sat, 17 Dec 2011 18:18:25 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 853F428332; Sat, 17 Dec 2011 18:17:21 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 394BF282CE for ; Sat, 17 Dec 2011 18:04:49 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EpsoAL4skkRK for ; Sat, 17 Dec 2011 18:04:49 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-ee0-f44.google.com (mail-ee0-f44.google.com [74.125.83.44]) by theia.denx.de (Postfix) with ESMTPS id EA62A282D7 for ; Sat, 17 Dec 2011 18:04:48 +0100 (CET) Received: by mail-ee0-f44.google.com with SMTP id c14so2998501eek.3 for ; Sat, 17 Dec 2011 09:04:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=xoo098VTLAmGA0PVkl+QO7JUFLAPiN7WkGam8J+gHDg=; b=ep5dnTz+0f1NEI27HU+Qjm+pO7Kh0TnkSno6U4aoIuuD04bceI8mVQFSoaSwrSOYGy mvGdqJ0ZAIRG3vZ/9IFj3J4GMif8PbF5Zq47fTBJ1GHsWjncKwaJlPXVeW/LWAZHAmQ7 0kkcTNdLTKz/npix46gVGZvAOP9wn+fbleHRM= Received: by 10.14.121.136 with SMTP id r8mr1397474eeh.109.1324141488593; Sat, 17 Dec 2011 09:04:48 -0800 (PST) Received: from Pali-EliteBook.kolej.mff.cuni.cz (pali.kolej.mff.cuni.cz. [78.128.193.202]) by mx.google.com with ESMTPS id a60sm17652568eeb.4.2011.12.17.09.04.47 (version=SSLv3 cipher=OTHER); Sat, 17 Dec 2011 09:04:47 -0800 (PST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: u-boot@lists.denx.de Date: Sat, 17 Dec 2011 18:03:13 +0100 Message-Id: <1324141398-14859-11-git-send-email-pali.rohar@gmail.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1324141398-14859-1-git-send-email-pali.rohar@gmail.com> References: <2772527.Czs1Sl5aoH@pali-elitebook> <1324141398-14859-1-git-send-email-pali.rohar@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sat, 17 Dec 2011 18:17:05 +0100 Cc: Sebastian Reichel , Marcel Mol , Martin Jansa , =?UTF-8?q?Pali=20Roh=C3=A1r?= Subject: [U-Boot] [PATCH 11/16] New command clr: Clear the ANSI terminal X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Marcel Mol * Command can be enabled by CONFIG_CMD_CLR Signed-off-by: Pali Rohár --- common/Makefile | 1 + common/cmd_clr.c | 38 ++++++++++++++++++++++++++++++++++++++ include/config_cmd_all.h | 1 + 3 files changed, 40 insertions(+), 0 deletions(-) create mode 100644 common/cmd_clr.c diff --git a/common/Makefile b/common/Makefile index 2d9ae8c..0552f19 100644 --- a/common/Makefile +++ b/common/Makefile @@ -69,6 +69,7 @@ COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o cmd_bedbug.o COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o COBJS-$(CONFIG_CMD_CACHE) += cmd_cache.o +COBJS-$(CONFIG_CMD_CLR) += cmd_clr.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 diff --git a/common/cmd_clr.c b/common/cmd_clr.c new file mode 100644 index 0000000..5077bbb --- /dev/null +++ b/common/cmd_clr.c @@ -0,0 +1,38 @@ +/* + * Copyright 2011 + * Marcel Mol, MESA Consulting, marcel@mesa.nl + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include +#include + +int do_clr(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ + printf(ANSI_CLEAR_CONSOLE); + return 0; +} + +U_BOOT_CMD( + clr, CONFIG_SYS_MAXARGS, 1, do_clr, + "clr", + "\n" + " - clear screen and move cursor to top of screen" +); diff --git a/include/config_cmd_all.h b/include/config_cmd_all.h index 9716f9c..f3c49ed 100644 --- a/include/config_cmd_all.h +++ b/include/config_cmd_all.h @@ -23,6 +23,7 @@ #define CONFIG_CMD_BSP /* Board Specific functions */ #define CONFIG_CMD_CACHE /* icache, dcache */ #define CONFIG_CMD_CDP /* Cisco Discovery Protocol */ +#define CONFIG_CMD_CLR /* ANSI clear screen command */ #define CONFIG_CMD_CONSOLE /* coninfo */ #define CONFIG_CMD_DATE /* support for RTC, date/time...*/ #define CONFIG_CMD_DHCP /* DHCP Support */