[all] Many little fixes
This commit is contained in:
+23
-7
@@ -280,6 +280,12 @@ void title(const pm_char * s)
|
||||
#define SCROLL(min, val, max) limit(min, val, max)
|
||||
#endif
|
||||
|
||||
#if defined(PCBX9D)
|
||||
#define POS_VERT_INIT (menuTab ? (MAXCOL((int16_t)1) == 255 ? 2 : 1) : 0)
|
||||
#else
|
||||
#define POS_VERT_INIT 0
|
||||
#endif
|
||||
|
||||
bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t menuTabSize, const pm_uint8_t *horTab, uint8_t horTabMax, maxrow_t maxrow)
|
||||
{
|
||||
maxrow_t l_posVert = m_posVert;
|
||||
@@ -448,8 +454,9 @@ bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t
|
||||
}
|
||||
else {
|
||||
#if defined(PCBX9D)
|
||||
l_posVert = (menuTab ? 1 : 0);
|
||||
l_posVert = POS_VERT_INIT;
|
||||
l_posHorz = 0;
|
||||
s_pgOfs = 0;
|
||||
#else
|
||||
--l_posHorz;
|
||||
scrollRE = 0;
|
||||
@@ -493,11 +500,7 @@ bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t
|
||||
switch(event)
|
||||
{
|
||||
case EVT_ENTRY:
|
||||
#if defined(PCBX9D)
|
||||
l_posVert = (menuTab ? 1 : 0);
|
||||
#else
|
||||
l_posVert = 0;
|
||||
#endif
|
||||
l_posVert = POS_VERT_INIT;
|
||||
l_posHorz = 0;
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
if (menuTab) {
|
||||
@@ -542,7 +545,19 @@ bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t
|
||||
s_editMode = 0;
|
||||
break;
|
||||
}
|
||||
if (IF_PCBX9D() || l_posVert==0 || !menuTab) {
|
||||
#if defined(PCBX9D)
|
||||
uint8_t posVertInit = POS_VERT_INIT;
|
||||
if (s_pgOfs != 0 || l_posHorz != 0 || l_posVert != posVertInit) {
|
||||
s_pgOfs = 0;
|
||||
l_posVert = posVertInit;
|
||||
l_posHorz = 0;
|
||||
}
|
||||
else {
|
||||
popMenu();
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
if (l_posVert==0 || !menuTab) {
|
||||
popMenu(); // beeps itself
|
||||
return false;
|
||||
}
|
||||
@@ -551,6 +566,7 @@ bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t
|
||||
l_posVert = 0;
|
||||
l_posHorz = 0;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
#if !defined(PCBX9D) && !defined(PCBACT)
|
||||
|
||||
+2
-2
@@ -249,10 +249,10 @@ int8_t switchMenuItem(uint8_t x, uint8_t y, int8_t value, LcdFlags attr, uint8_t
|
||||
|
||||
#if defined(GVARS)
|
||||
int16_t gvarMenuItem(uint8_t x, uint8_t y, int16_t value, int8_t min, int8_t max, LcdFlags attr, uint8_t event);
|
||||
#define displayGVar(x, y, v) gvarMenuItem(x, y, v, 0, 0, 0, 0)
|
||||
#define displayGVar(x, y, v, min, max) gvarMenuItem(x, y, v, min, max, 0, 0)
|
||||
#else
|
||||
int8_t gvarMenuItem(uint8_t x, uint8_t y, int8_t value, int8_t min, int8_t max, LcdFlags attr, uint8_t event);
|
||||
#define displayGVar(x, y, v) lcd_outdez8(x, y, v)
|
||||
#define displayGVar(x, y, v, min, max) lcd_outdez8(x, y, v)
|
||||
#endif
|
||||
|
||||
#define WARNING_TYPE_ASTERISK 0
|
||||
|
||||
+12
-12
@@ -382,13 +382,9 @@ void menuModelSelect(uint8_t event)
|
||||
// TODO merge with lines below
|
||||
case EVT_KEY_BREAK(KEY_PAGE):
|
||||
case EVT_KEY_LONG(KEY_PAGE):
|
||||
if (sub == g_eeGeneral.currModel) {
|
||||
chainMenu(event == EVT_KEY_BREAK(KEY_PAGE) ? menuModelSetup : menuTabModel[DIM(menuTabModel)-1]);
|
||||
killEvents(event);
|
||||
return;
|
||||
}
|
||||
AUDIO_WARNING2();
|
||||
break;
|
||||
chainMenu(event == EVT_KEY_BREAK(KEY_PAGE) ? menuModelSetup : menuTabModel[DIM(menuTabModel)-1]);
|
||||
killEvents(event);
|
||||
return;
|
||||
#else
|
||||
case EVT_KEY_FIRST(KEY_LEFT):
|
||||
case EVT_KEY_FIRST(KEY_RIGHT):
|
||||
@@ -439,6 +435,8 @@ void menuModelSelect(uint8_t event)
|
||||
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
displayScreenIndex(e_ModelSelect, DIM(menuTabModel), (sub == g_eeGeneral.currModel) ? ((IS_RE_NAVIGATION_ENABLE() && s_editMode < 0) ? INVERS|BLINK : INVERS) : 0);
|
||||
#elif defined(PCBX9D)
|
||||
displayScreenIndex(e_ModelSelect, DIM(menuTabModel), 0);
|
||||
#else
|
||||
displayScreenIndex(e_ModelSelect, DIM(menuTabModel), (sub == g_eeGeneral.currModel) ? INVERS : 0);
|
||||
#endif
|
||||
@@ -862,10 +860,10 @@ void menuModelSetup(uint8_t event)
|
||||
|
||||
case ITEM_MODEL_BEEP_CENTER:
|
||||
lcd_putsLeft(y, STR_BEEPCTR);
|
||||
for (uint8_t i=0;i<NUM_STICKS+NUM_POTS+NUM_ROTARY_ENCODERS;i++)
|
||||
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS+NUM_ROTARY_ENCODERS; i++)
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN+i*FW, y, STR_RETA123, i, ((m_posHorz==i) && attr) ? BLINK|INVERS : ((g_model.beepANACenter & ((BeepANACenter)1<<i)) ? INVERS : 0 ) );
|
||||
if (attr) {
|
||||
if((event==EVT_KEY_BREAK(KEY_MENU)) || p1valdiff) {
|
||||
if((event==EVT_KEY_BREAK(KEY_ENTER)) || p1valdiff) {
|
||||
s_editMode = 0;
|
||||
g_model.beepANACenter ^= ((BeepANACenter)1<<m_posHorz);
|
||||
STORE_MODELVARS;
|
||||
@@ -2306,7 +2304,7 @@ void menuModelExpoMix(uint8_t expo, uint8_t event)
|
||||
if (ed->curveMode == MODE_CURVE)
|
||||
putsCurve(EXPO_LINE_EXPO_POS-3*FW, y, ed->curveParam);
|
||||
else
|
||||
displayGVar(EXPO_LINE_EXPO_POS, y, ed->curveParam);
|
||||
displayGVar(EXPO_LINE_EXPO_POS, y, ed->curveParam, -100, 100);
|
||||
|
||||
#if defined(CPUARM)
|
||||
if (ed->name[0]) {
|
||||
@@ -2343,7 +2341,7 @@ void menuModelExpoMix(uint8_t expo, uint8_t event)
|
||||
if (md->curveMode == MODE_CURVE)
|
||||
putsCurve(12*FW+2, y, md->curveParam);
|
||||
else
|
||||
displayGVar(15*FW+2, y, md->curveParam);
|
||||
displayGVar(15*FW+2, y, md->curveParam, -125, 125);
|
||||
}
|
||||
if (md->swtch) putsSwitches(16*FW, y, md->swtch);
|
||||
|
||||
@@ -3599,7 +3597,9 @@ void menuModelTelemetry(uint8_t event)
|
||||
CHECK_INCDEC_MODELVAR(event, value, 0, g_model.frsky.usrProto ? ((lineIndex==3 && c==0) ? TELEM_STATUS_MAX : TELEM_DISPLAY_MAX) : TELEM_NOUSR_MAX);
|
||||
}
|
||||
}
|
||||
if (attr && m_posHorz == 2) m_posHorz = 0;
|
||||
if (attr && m_posHorz == 2) {
|
||||
REPEAT_LAST_CURSOR_MOVE();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -3432,6 +3432,7 @@ uint16_t stack_free()
|
||||
inline void open9xInit(OPEN9X_INIT_ARGS)
|
||||
{
|
||||
#if defined(PCBX9D)
|
||||
BACKLIGHT_ON();
|
||||
Splash();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@ uint32_t sdMounted();
|
||||
#endif
|
||||
|
||||
// Backlight driver
|
||||
#define setBacklight(xx) PWM->PWM_CH_NUM[0].PWM_CDTYUPD = xx
|
||||
#define setBacklight(xx) (PWM->PWM_CH_NUM[0].PWM_CDTYUPD = xx)
|
||||
#define __BACKLIGHT_ON (PWM->PWM_CH_NUM[0].PWM_CDTY = g_eeGeneral.backlightBright)
|
||||
#define __BACKLIGHT_OFF (PWM->PWM_CH_NUM[0].PWM_CDTY = 100)
|
||||
#define IS_BACKLIGHT_ON() (PWM->PWM_CH_NUM[0].PWM_CDTY != 100)
|
||||
|
||||
Reference in New Issue
Block a user