From patchwork Fri Feb 1 15:07:57 2013 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: 217492 X-Patchwork-Delegate: agust@denx.de 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 56CEA2C0294 for ; Sat, 2 Feb 2013 02:16:58 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BE65F4A01C; Fri, 1 Feb 2013 16:16:56 +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 SBOs4Rlb4Pa0; Fri, 1 Feb 2013 16:16:56 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4D6E04A0BE; Fri, 1 Feb 2013 16:16:55 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E6E9C4A0BE for ; Fri, 1 Feb 2013 16:16:53 +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 nPh3Kq3w6zGW for ; Fri, 1 Feb 2013 16:16:53 +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-ea0-f173.google.com (mail-ea0-f173.google.com [209.85.215.173]) by theia.denx.de (Postfix) with ESMTPS id 2FDA54A01C for ; Fri, 1 Feb 2013 16:16:51 +0100 (CET) Received: by mail-ea0-f173.google.com with SMTP id i1so1775403eaa.4 for ; Fri, 01 Feb 2013 07:16:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=7QjOO6e0xrxEgTyYUT5yZ4zhDrXAHPx8ZcoBgvtezU4=; b=RYrbQcjNyeclv1l6CGhiicFu0S6LyS2cFmpZeNb4bLFCn2unw/agMGN0U0Ilpzz+ZQ fNzSZxcOfqVqEporD6hRW04u2Uz8JxkDezseL9fXVOjQ5OxTEbzadsZI9uqVQxKGDV7j 0vkek8n764trCsfg73gFinEhy6FSNsgwkZJnaKDJiQDG5b0ZoDucF11Wa8PxKKBOgGKe ZKkpwLeNIXQAkTLnAkKJV8WquAYqi8Cy8qhAU9K0W8I3X3QzJmp8JfXUpmWnEoVTDJUw vKjLaHJtRZbTFKNZO8PMzG3nDerEcA3RoyH1xCIBPh5xSDOXxyXx8hZfO6W0f8whqSHM 8ACw== X-Received: by 10.14.207.6 with SMTP id m6mr40299582eeo.10.1359731339206; Fri, 01 Feb 2013 07:08:59 -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 f49sm12938576eep.12.2013.02.01.07.08.57 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 01 Feb 2013 07:08:58 -0800 (PST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: u-boot@lists.denx.de Date: Fri, 1 Feb 2013 16:07:57 +0100 Message-Id: <1359731279-22431-4-git-send-email-pali.rohar@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1359731279-22431-1-git-send-email-pali.rohar@gmail.com> References: <1338136729-3907-1-git-send-email-pali.rohar@gmail.com> <1359731279-22431-1-git-send-email-pali.rohar@gmail.com> MIME-Version: 1.0 Cc: Marcel Mol , =?UTF-8?q?Pali=20Roh=C3=A1r?= Subject: [U-Boot] [PATCH v3 3/4] New command clear: 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 This patch adding new simple command clear which clear ANSI terminal. Signed-off-by: Pali Rohár Cc: Marcel Mol --- No changes in v3 This patch was in Nokia RX-51 patch series (v2). Changes since RX-51 patch v2: - Removed from include/config_cmd_all.h - Removed ANSI escape codes (now in BootMenu command patch) Changes since original version: - Renamed command clr to clear - Use puts instead printf - Move cursor to pos1,1 common/Makefile | 1 + common/cmd_clear.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 common/cmd_clear.c diff --git a/common/Makefile b/common/Makefile index 0bd82a9..4a0519b 100644 --- a/common/Makefile +++ b/common/Makefile @@ -76,6 +76,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_CLEAR) += cmd_clear.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_clear.c b/common/cmd_clear.c new file mode 100644 index 0000000..29b4718 --- /dev/null +++ b/common/cmd_clear.c @@ -0,0 +1,43 @@ +/* + * Copyright 2011 + * Marcel Mol, MESA Consulting, marcel@mesa.nl + * + * Copyright 2011 + * Pali Rohár, pali.rohar@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. + * + * 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 +#include + +static int do_clear(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ + puts(ANSI_CLEAR_CONSOLE); + printf(ANSI_CURSOR_POSITION, 1, 1); + return 0; +} + +U_BOOT_CMD( + clear, CONFIG_SYS_MAXARGS, 1, do_clear, + "clear", + "\n" + " - clear screen and move cursor to top of screen" +);