SafetySwich function redesigned
This commit is contained in:
+18
-7
@@ -2073,7 +2073,7 @@ void menuProcCustomSwitches(uint8_t event)
|
|||||||
|
|
||||||
void menuProcFunctionSwitches(uint8_t event)
|
void menuProcFunctionSwitches(uint8_t event)
|
||||||
{
|
{
|
||||||
MENU(STR_MENUFUNCSWITCHES, menuTabModel, e_FunctionSwitches, NUM_FSW+1, {0, 2/*repeated*/});
|
MENU(STR_MENUFUNCSWITCHES, menuTabModel, e_FunctionSwitches, NUM_FSW+1, {0, 3/*repeated*/});
|
||||||
|
|
||||||
uint8_t y = 0;
|
uint8_t y = 0;
|
||||||
uint8_t k = 0;
|
uint8_t k = 0;
|
||||||
@@ -2084,7 +2084,7 @@ void menuProcFunctionSwitches(uint8_t event)
|
|||||||
k=i+s_pgOfs;
|
k=i+s_pgOfs;
|
||||||
if(k==NUM_CHNOUT) break;
|
if(k==NUM_CHNOUT) break;
|
||||||
FuncSwData *sd = &g_model.funcSw[k];
|
FuncSwData *sd = &g_model.funcSw[k];
|
||||||
for (uint8_t j=0; j<3; j++) {
|
for (uint8_t j=0; j<4; j++) {
|
||||||
uint8_t attr = ((sub==k && m_posHorz==j) ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
|
uint8_t attr = ((sub==k && m_posHorz==j) ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
|
||||||
uint8_t active = (attr && (s_editMode>0 || p1valdiff));
|
uint8_t active = (attr && (s_editMode>0 || p1valdiff));
|
||||||
switch (j) {
|
switch (j) {
|
||||||
@@ -2099,7 +2099,7 @@ void menuProcFunctionSwitches(uint8_t event)
|
|||||||
uint8_t func_displayed;
|
uint8_t func_displayed;
|
||||||
if (sd->func < 16) {
|
if (sd->func < 16) {
|
||||||
func_displayed = 0;
|
func_displayed = 0;
|
||||||
putsChnRaw(14*FW-2, y, NUM_STICKS+NUM_POTS+NUM_ROTARY_ENCODERS+NUM_STICKS+2+3+NUM_PPM+sd->func+1, attr);
|
putsChnRaw(11*FW-2, y, NUM_STICKS+NUM_POTS+NUM_ROTARY_ENCODERS+NUM_STICKS+2+3+NUM_PPM+sd->func+1, attr);
|
||||||
}
|
}
|
||||||
else if (sd->func < 16 + NUM_STICKS + 1) {
|
else if (sd->func < 16 + NUM_STICKS + 1) {
|
||||||
func_displayed = 1;
|
func_displayed = 1;
|
||||||
@@ -2146,12 +2146,13 @@ void menuProcFunctionSwitches(uint8_t event)
|
|||||||
lcd_putsiAtt(15*FW, y, STR_VFSWRESET, sd->param, attr);
|
lcd_putsiAtt(15*FW, y, STR_VFSWRESET, sd->param, attr);
|
||||||
}
|
}
|
||||||
else if (sd->func <= FUNC_SAFETY_CH16) {
|
else if (sd->func <= FUNC_SAFETY_CH16) {
|
||||||
val_displayed = (int16_t)(int8_t)sd->param;
|
int8_t value = ((int8_t)sd->param >> 1);
|
||||||
val_min = -125;
|
lcd_outdezAtt(18*FW, y, value * 2, attr);
|
||||||
val_max = 125;
|
if (active) sd->param = (sd->param & 1) + (checkIncDecModel(event, value, -63, 63) << 1);
|
||||||
lcd_outdezAtt(21*FW, y, val_displayed, attr);
|
break;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
if (attr) m_posHorz = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2163,6 +2164,16 @@ void menuProcFunctionSwitches(uint8_t event)
|
|||||||
m_posHorz = 0;
|
m_posHorz = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
if (sd->swtch && sd->func <= FUNC_SAFETY_CH16) {
|
||||||
|
menu_lcd_onoff(18*FW+2, y, (sd->param & 1), attr ) ;
|
||||||
|
if (active) sd->param = (sd->param & 0xfe) + checkIncDecModel(event,sd->param & 1, 0, 1);
|
||||||
|
}
|
||||||
|
else if (attr) {
|
||||||
|
m_posHorz = 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -1436,8 +1436,8 @@ void evalFunctions()
|
|||||||
swtch += MAX_SWITCH+1;
|
swtch += MAX_SWITCH+1;
|
||||||
}
|
}
|
||||||
if (getSwitch(swtch, 0)) {
|
if (getSwitch(swtch, 0)) {
|
||||||
if (sd->func < FUNC_TRAINER && (g_menuStack[g_menuStackPtr] != menuProcFunctionSwitches || m_posVert != (i+1) || m_posHorz > 1)) {
|
if (sd->func < FUNC_TRAINER && (sd->param & 1)) {
|
||||||
safetyCh[sd->func] = (int8_t)sd->param;
|
safetyCh[sd->func] = ((int8_t)sd->param >> 1) * 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (~active_functions & function_mask) {
|
if (~active_functions & function_mask) {
|
||||||
|
|||||||
@@ -121,7 +121,7 @@
|
|||||||
#else
|
#else
|
||||||
#define TR_TEST
|
#define TR_TEST
|
||||||
#endif
|
#endif
|
||||||
#define TR_VFSWFUNC "Bezpecny \0 ""Trener\0 ""Instant Trim " TR_SOUND TR_HAPTIC TR_SOMO "Reset\0 " TR_VVARIO TR_SDCLOGS TR_TEST
|
#define TR_VFSWFUNC "Bezpec.\0 ""Trener\0 ""Instant Trim " TR_SOUND TR_HAPTIC TR_SOMO "Reset\0 " TR_VVARIO TR_SDCLOGS TR_TEST
|
||||||
|
|
||||||
#define LEN_VFSWRESET "\006"
|
#define LEN_VFSWRESET "\006"
|
||||||
#define TR_VFSWRESET "Timer1""Timer2""Vse ""Telem."
|
#define TR_VFSWRESET "Timer1""Timer2""Vse ""Telem."
|
||||||
|
|||||||
@@ -121,7 +121,7 @@
|
|||||||
#else
|
#else
|
||||||
#define TR_TEST
|
#define TR_TEST
|
||||||
#endif
|
#endif
|
||||||
#define TR_VFSWFUNC "Security \0 ""Trainer \0 ""Instant Trim " TR_SOUND TR_HAPTIC TR_SOMO "Reset\0 " TR_VVARIO TR_SDCLOGS TR_TEST
|
#define TR_VFSWFUNC "Safety\0 ""Trainer \0 ""Instant Trim " TR_SOUND TR_HAPTIC TR_SOMO "Reset\0 " TR_VVARIO TR_SDCLOGS TR_TEST
|
||||||
|
|
||||||
#define LEN_VFSWRESET "\006"
|
#define LEN_VFSWRESET "\006"
|
||||||
#define TR_VFSWRESET "Timer1""Timer2""All ""Telem."
|
#define TR_VFSWRESET "Timer1""Timer2""All ""Telem."
|
||||||
|
|||||||
@@ -121,7 +121,7 @@
|
|||||||
#else
|
#else
|
||||||
#define TR_TEST
|
#define TR_TEST
|
||||||
#endif
|
#endif
|
||||||
#define TR_VFSWFUNC "Securite \0 ""Ecolage \0 ""Trim instant " TR_SOUND TR_HAPTIC TR_SOMO "Reset\0 " TR_VVARIO TR_SDCLOGS TR_TEST
|
#define TR_VFSWFUNC "Secur.\0 ""Ecolage \0 ""Trim instant " TR_SOUND TR_HAPTIC TR_SOMO "Reset\0 " TR_VVARIO TR_SDCLOGS TR_TEST
|
||||||
|
|
||||||
#define LEN_VFSWRESET "\006"
|
#define LEN_VFSWRESET "\006"
|
||||||
#define TR_VFSWRESET "Timer1""Timer2""All ""Telem."
|
#define TR_VFSWRESET "Timer1""Timer2""All ""Telem."
|
||||||
|
|||||||
@@ -121,7 +121,7 @@
|
|||||||
#else
|
#else
|
||||||
#define TR_TEST
|
#define TR_TEST
|
||||||
#endif
|
#endif
|
||||||
#define TR_VFSWFUNC "Blocco \0 ""Trainer \0 ""Instant Trim " TR_SOUND TR_HAPTIC TR_SOMO "Reset\0 " TR_VVARIO TR_SDCLOGS TR_TEST
|
#define TR_VFSWFUNC "Blocco\0 ""Trainer \0 ""Instant Trim " TR_SOUND TR_HAPTIC TR_SOMO "Reset\0 " TR_VVARIO TR_SDCLOGS TR_TEST
|
||||||
|
|
||||||
#define LEN_VFSWRESET "\006"
|
#define LEN_VFSWRESET "\006"
|
||||||
#define TR_VFSWRESET "Timer1""Timer2""Tutto ""Telem."
|
#define TR_VFSWRESET "Timer1""Timer2""Tutto ""Telem."
|
||||||
|
|||||||
@@ -121,7 +121,7 @@
|
|||||||
#else
|
#else
|
||||||
#define TR_TEST
|
#define TR_TEST
|
||||||
#endif
|
#endif
|
||||||
#define TR_VFSWFUNC "S\201kerhet \0 ""Trainer \0 ""Instant Trim " TR_SOUND TR_HAPTIC TR_SOMO "Reset\0 " TR_VVARIO TR_SDCLOGS TR_TEST
|
#define TR_VFSWFUNC "S\201kerh.\0 ""Trainer \0 ""Instant Trim " TR_SOUND TR_HAPTIC TR_SOMO "Reset\0 " TR_VVARIO TR_SDCLOGS TR_TEST
|
||||||
|
|
||||||
#define LEN_VFSWRESET "\006"
|
#define LEN_VFSWRESET "\006"
|
||||||
#define TR_VFSWRESET "Timer1""Timer2""All ""Telem."
|
#define TR_VFSWRESET "Timer1""Timer2""All ""Telem."
|
||||||
|
|||||||
Reference in New Issue
Block a user