2 * Copyright Droids Corporation, Microb Technology, Eirbot (2005)
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * Revision : $Id: main.c,v 1.3.4.2 2007-05-23 17:18:15 zer0 Exp $
22 /* Olivier MATZ, Droids-corp 2004 - 2006
23 * Test program for a menu
29 #include <aversive/wait.h>
44 struct menu my_menu[] = {
46 MENU_FCT("a", f, &myparam),
48 MENU_FCT("b", f, &myparam),
49 MENU_FCT("c", f, &myparam),
50 MENU_FCT("d", f, &myparam),
53 MENU_FCT("e", f, &myparam),
55 MENU_FCT("f", f, &myparam),
63 struct menu *m = my_menu;
68 fdevopen(uart0_dev_send, uart0_dev_recv);
73 printf("Root is %s\n", menu_get_name(m));
75 printf("1st son of root is %s\n", menu_get_name(m));
77 printf("The submenu is %s\n", menu_get_name(m));
80 m = menu_get_first_son(m);
81 printf("1st son is %s\n", menu_get_name(m));
83 printf("2nd son is %s\n", menu_get_name(m));
85 printf("3rd son is %s\n", menu_get_name(m));
87 printf("return to 1st son : %s\n", menu_get_name(m));
90 printf("3rd son is %s\n", menu_get_name(m));
92 printf("2nd son is %s\n", menu_get_name(m));
94 printf("1st son is %s\n", menu_get_name(m));
105 menu_default_display(m);
111 m=menu_default_update(m, c);