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_TIMEOUT (1<<0)
#define MENU_JUSTONCE (1<<1)
extern uint8_t menuflags; extern uint8_t menuflags;

View File

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