[stock] Around 110bytes flash saved

[all] EXIT now closes the popup on main views when a GVAR is modified
This commit is contained in:
bsongis
2012-10-24 07:55:58 +00:00
parent f9e64eb2ab
commit 6a35d36c0a
4 changed files with 17 additions and 10 deletions
+7 -5
View File
@@ -155,12 +155,17 @@ void menuMainView(uint8_t event)
killEvents(event);
break;
case EVT_KEY_FIRST(KEY_EXIT):
if(s_timerState[0]==TMR_BEEPING) {
if (s_timerState[0]==TMR_BEEPING) {
s_timerState[0] = TMR_STOPPED;
}
else if (s_global_warning) {
s_global_warning = NULL;
}
#if defined(GVARS)
else if (s_gvar_timer > 0) {
s_gvar_timer = 0;
}
#endif
else if (view == e_timer2) {
resetTimer(1);
}
@@ -381,10 +386,7 @@ void menuMainView(uint8_t event)
// lcd_outdezNAtt(33+11*FW, FH*6, s_timerVal_10ms[1], LEADING0, 2); // 1/100s
}
if (s_warning) {
// Nothing here
}
else if (s_global_warning) {
if (s_global_warning) {
s_warning = s_global_warning;
displayWarning(_event);
if (!s_warning) s_global_warning = NULL;
+5
View File
@@ -228,6 +228,11 @@ void check_rotary_encoder()
}
#endif
void title(const pm_char * s)
{
lcd_putsAtt(0, 0, s, INVERS);
}
#define SCROLL_TH 64
#define SCROLL_POT1_TH 32
+2 -2
View File
@@ -159,8 +159,8 @@ bool check_submenu_simple(uint8_t event, uint8_t maxrow);
typedef void (*MenuFuncP_PROGMEM)(uint8_t event);
#define TITLEP(pstr) lcd_putsAtt(0,0,pstr,INVERS)
#define TITLE(str) TITLEP(str)
void title(const pm_char * s);
#define TITLE(str) title(str)
#define MENU(title, tab, menu, lines_count, ...) \
static const pm_uint8_t mstate_tab[] PROGMEM = __VA_ARGS__; \
+3 -3
View File
@@ -1706,7 +1706,7 @@ enum MixFields {
void menuModelMixOne(uint8_t event)
{
TITLEP(s_currCh ? STR_INSERTMIX : STR_EDITMIX);
TITLE(s_currCh ? STR_INSERTMIX : STR_EDITMIX);
MixData *md2 = mixaddress(s_currIdx) ;
putsChn(lcdLastPos+1*FW,0,md2->destCh+1,0);
@@ -1856,7 +1856,7 @@ void menuModelExpoMix(uint8_t expo, uint8_t _event)
event -= KEY_EXIT;
}
TITLEP(expo ? STR_MENUDREXPO : STR_MIXER);
TITLE(expo ? STR_MENUDREXPO : STR_MIXER);
lcd_outdezAtt(lcdLastPos+2*FW+FW/2, 0, getExpoMixCount(expo));
lcd_puts(lcdLastPos, 0, expo ? STR_MAX(MAX_EXPOS) : STR_MAX(MAX_MIXERS));
SIMPLE_MENU_NOTITLE(menuTabModel, expo ? e_ExposAll : e_MixAll, s_maxLines);
@@ -2396,7 +2396,7 @@ enum CustomSwitchFields {
#define CSW_2ND_COLUMN (9*FW)
void menuModelCustomSwitchOne(uint8_t event)
{
TITLEP(STR_MENUCUSTOMSWITCH);
TITLE(STR_MENUCUSTOMSWITCH);
CustomSwData * cs = cswaddress(s_currIdx);
uint8_t sw = DSW_SW1+s_currIdx;
putsSwitches(14*FW, 0, sw, (getSwitch(sw, 0) ? BOLD : 0));