[U-Boot] [RFC/PATCH 1/2] r2dplus: add menu example support

Wolfgang Denk wd at denx.de
Sun Jun 14 01:15:23 CEST 2009


Dear Jean-Christophe PLAGNIOL-VILLARD,

In message <1244920382-21434-2-git-send-email-plagnioj at jcrosoft.com> you wrote:
> this patch is just an example to show you how to create your own menu using
> the C API. It will not be a part of the final version
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
> ---
>  board/renesas/r2dplus/Makefile       |   12 ++++---
>  board/renesas/r2dplus/menu_example.c |   57 ++++++++++++++++++++++++++++++++++
>  board/renesas/r2dplus/r2dplus.c      |    3 ++
>  include/configs/r2dplus.h            |    3 ++
>  lib_sh/board.c                       |    4 ++
>  5 files changed, 74 insertions(+), 5 deletions(-)
>  create mode 100644 board/renesas/r2dplus/menu_example.c
> 
> diff --git a/board/renesas/r2dplus/Makefile b/board/renesas/r2dplus/Makefile
> index e96a8aa..5fbaeb9 100644
> --- a/board/renesas/r2dplus/Makefile
> +++ b/board/renesas/r2dplus/Makefile
> @@ -21,12 +21,14 @@ include $(TOPDIR)/config.mk
>  
>  LIB	= $(obj)lib$(BOARD).a
>  
> -COBJS	:= r2dplus.o
> -SOBJS	:= lowlevel_init.o
> +COBJS-y	= r2dplus.o
> +COBJS-$(CONFIG_MENU_EXAMPLE) += menu_example.o
>  
> -SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
> -OBJS	:= $(addprefix $(obj),$(COBJS))
> -SOBJS	:= $(addprefix $(obj),$(SOBJS))
> +SOBJS-y	= lowlevel_init.o
> +
> +SRCS	:= $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
> +OBJS	:= $(addprefix $(obj),$(COBJS-y))
> +SOBJS	:= $(addprefix $(obj),$(SOBJS-y))
>  
>  $(LIB):	$(OBJS) $(SOBJS)
>  	$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
> diff --git a/board/renesas/r2dplus/menu_example.c b/board/renesas/r2dplus/menu_example.c
> new file mode 100644
> index 0000000..6b9aa4f
> --- /dev/null
> +++ b/board/renesas/r2dplus/menu_example.c
> @@ -0,0 +1,57 @@
> +/*
> + * (C) Copyright 2009 Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.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 <common.h>
> +#include <command.h>
> +#include <console.h>
> +#include <menu.h>
> +
> +struct menu boot;
> +struct menu_entry boot_entry[5];
> +
> +static int menu_action_example(struct menu *m, struct menu_entry *me)
> +{
> +	clear();
> +	gotoXY(0, 0);
> +	printf("selected: %d\n", me->num);
> +	return 0;
> +}

Please do not add example code to a regular board.

NAK.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Look! There! Evil!.. pure and simple, total  evil  from  the  Eighth
Dimension!"                                         - Buckaroo Banzai


More information about the U-Boot mailing list