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>
40 struct menu my_menu[] = {
42 MENU_FCT("a", f, &myparam),
44 MENU_FCT("b", f, &myparam),
45 MENU_FCT("c", f, &myparam),
46 MENU_FCT("d", f, &myparam),
49 MENU_FCT("e", f, &myparam),
51 MENU_FCT("f", f, &myparam),
59 struct menu *m = my_menu;
64 fdevopen(uart0_dev_send, uart0_dev_recv);
69 printf("Root is %s\n", menu_get_name(m));
71 printf("1st son of root is %s\n", menu_get_name(m));
73 printf("The submenu is %s\n", menu_get_name(m));
76 m = menu_get_first_son(m);
77 printf("1st son is %s\n", menu_get_name(m));
79 printf("2nd son is %s\n", menu_get_name(m));
81 printf("3rd son is %s\n", menu_get_name(m));
83 printf("return to 1st son : %s\n", menu_get_name(m));
86 printf("3rd son is %s\n", menu_get_name(m));
88 printf("2nd son is %s\n", menu_get_name(m));
90 printf("1st son is %s\n", menu_get_name(m));
101 menu_default_display(m);
107 m=menu_default_update(m, c);