option added for menus to show "JUSTONCE"

This commit is contained in:
iggy 2011-08-04 16:29:13 +02:00
parent 9add0367fe
commit 13f5444745
2 changed files with 9 additions and 0 deletions

View File

@ -180,6 +180,7 @@ struct MENU {
};
#define MENU_TIMEOUT (1<<0)
#define MENU_JUSTONCE (1<<1)
extern uint8_t menuflags;

View File

@ -68,6 +68,10 @@ void handleMenu(const struct MENU *the_menu) {
case BTN_RIGHT:
if (the_menu->entries[menuselection].callback!=NULL)
the_menu->entries[menuselection].callback();
if (menuflags&MENU_JUSTONCE)
return;
break;
case BTN_ENTER:
lcdClear();
@ -77,6 +81,10 @@ void handleMenu(const struct MENU *the_menu) {
if (the_menu->entries[menuselection].callback!=NULL)
the_menu->entries[menuselection].callback();
lcdRefresh();
if (menuflags&MENU_JUSTONCE)
return;
getInputWait();
break;