Merge remote-tracking branch 'origin/3djc/xlite-swwarning-fix' into 2.2
This commit is contained in:
@@ -148,7 +148,11 @@ enum MenuModelSetupItems {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
|
#if defined(PCBXLITE)
|
||||||
|
#define SW_WARN_ROWS uint8_t(NAVIGATION_LINE_BY_LINE|getSwitchWarningsCount()), uint8_t(getSwitchWarningsCount() > 5 ? TITLE_ROW : HIDDEN_ROW) //xlite needs an additional column for full line selection (<])
|
||||||
|
#else
|
||||||
#define SW_WARN_ROWS uint8_t(NAVIGATION_LINE_BY_LINE|(getSwitchWarningsCount()-1)), uint8_t(getSwitchWarningsCount() > 5 ? TITLE_ROW : HIDDEN_ROW)
|
#define SW_WARN_ROWS uint8_t(NAVIGATION_LINE_BY_LINE|(getSwitchWarningsCount()-1)), uint8_t(getSwitchWarningsCount() > 5 ? TITLE_ROW : HIDDEN_ROW)
|
||||||
|
#endif
|
||||||
#if !defined(TARANIS_INTERNAL_PPM)
|
#if !defined(TARANIS_INTERNAL_PPM)
|
||||||
#define INTERNAL_MODULE_MODE_ROWS 0 // (OFF / RF protocols)
|
#define INTERNAL_MODULE_MODE_ROWS 0 // (OFF / RF protocols)
|
||||||
#else
|
#else
|
||||||
@@ -170,7 +174,7 @@ enum MenuModelSetupItems {
|
|||||||
|
|
||||||
#define CURSOR_ON_CELL (true)
|
#define CURSOR_ON_CELL (true)
|
||||||
#define MODEL_SETUP_MAX_LINES (HEADER_LINE+ITEM_MODEL_SETUP_MAX)
|
#define MODEL_SETUP_MAX_LINES (HEADER_LINE+ITEM_MODEL_SETUP_MAX)
|
||||||
#define POT_WARN_ITEMS() ((g_model.nPotsToWarn >> 6) ? (uint8_t)NUM_POTS+NUM_SLIDERS : (uint8_t)0)
|
#define POT_WARN_ITEMS() ((g_model.potsWarnMode) ? (uint8_t)(NUM_POTS+NUM_SLIDERS) : (uint8_t)0)
|
||||||
#define TIMER_ROWS 2, 0, CASE_PERSISTENT_TIMERS(0) 0, 0
|
#define TIMER_ROWS 2, 0, CASE_PERSISTENT_TIMERS(0) 0, 0
|
||||||
#if defined(PCBSKY9X) && !defined(REVA)
|
#if defined(PCBSKY9X) && !defined(REVA)
|
||||||
#define EXTRA_MODULE_ROWS LABEL(ExtraModule), 1, 2,
|
#define EXTRA_MODULE_ROWS LABEL(ExtraModule), 1, 2,
|
||||||
@@ -272,7 +276,7 @@ void menuModelSetup(event_t event)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PCBXLITE)
|
#if defined(PCBXLITE)
|
||||||
MENU_TAB({ HEADER_LINE_COLUMNS 0, TIMER_ROWS, TIMER_ROWS, TIMER_ROWS, 0, 1, 0, 0, 0, 0, 0, CASE_CPUARM(LABEL(PreflightCheck)) CASE_CPUARM(0) 0, SW_WARN_ROWS, NUM_POTS, NUM_STICKS + NUM_POTS + NUM_SLIDERS + NUM_ROTARY_ENCODERS - 1, 0,
|
MENU_TAB({ HEADER_LINE_COLUMNS 0, TIMER_ROWS, TIMER_ROWS, TIMER_ROWS, 0, 1, 0, 0, 0, 0, 0, CASE_CPUARM(LABEL(PreflightCheck)) CASE_CPUARM(0) 0, SW_WARN_ROWS, POT_WARN_ITEMS(), NUM_STICKS + NUM_POTS + NUM_SLIDERS + NUM_ROTARY_ENCODERS - 1, 0,
|
||||||
LABEL(InternalModule),
|
LABEL(InternalModule),
|
||||||
INTERNAL_MODULE_MODE_ROWS,
|
INTERNAL_MODULE_MODE_ROWS,
|
||||||
INTERNAL_MODULE_CHANNELS_ROWS,
|
INTERNAL_MODULE_CHANNELS_ROWS,
|
||||||
@@ -650,6 +654,9 @@ void menuModelSetup(event_t event)
|
|||||||
if (!READ_ONLY() && event==EVT_KEY_BREAK(KEY_ENTER) && line && l_posHorz==current) {
|
if (!READ_ONLY() && event==EVT_KEY_BREAK(KEY_ENTER) && line && l_posHorz==current) {
|
||||||
g_model.switchWarningEnable ^= (1 << i);
|
g_model.switchWarningEnable ^= (1 << i);
|
||||||
storageDirty(EE_MODEL);
|
storageDirty(EE_MODEL);
|
||||||
|
#if defined(PCBXLITE)
|
||||||
|
s_editMode = 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
uint8_t swactive = !(g_model.switchWarningEnable & (1<<i));
|
uint8_t swactive = !(g_model.switchWarningEnable & (1<<i));
|
||||||
c = "\300-\301"[states & 0x03];
|
c = "\300-\301"[states & 0x03];
|
||||||
@@ -663,7 +670,7 @@ void menuModelSetup(event_t event)
|
|||||||
if (attr && ((menuHorizontalPosition < 0) || menuHorizontalPosition >= NUM_SWITCHES)) {
|
if (attr && ((menuHorizontalPosition < 0) || menuHorizontalPosition >= NUM_SWITCHES)) {
|
||||||
lcdDrawFilledRect(MODEL_SETUP_2ND_COLUMN-1, y-1, 8*(2*FW+1), 1+FH*((current+4)/5));
|
lcdDrawFilledRect(MODEL_SETUP_2ND_COLUMN-1, y-1, 8*(2*FW+1), 1+FH*((current+4)/5));
|
||||||
}
|
}
|
||||||
#else
|
#else //PCBTARANIS
|
||||||
{
|
{
|
||||||
lcdDrawTextAlignedLeft(y, STR_SWITCHWARNING);
|
lcdDrawTextAlignedLeft(y, STR_SWITCHWARNING);
|
||||||
swarnstate_t states = g_model.switchWarningState;
|
swarnstate_t states = g_model.switchWarningState;
|
||||||
|
|||||||
Reference in New Issue
Block a user