feat: Add initial Jumper T20 support (#3726)
* Jumper T20 * Fix center beeps * Add option to pinch top trim as well to bootloader * chore: Regenerate yaml * chore: Add entry for Buddy * Jumper T20 * Foldable section for fonction swith and fix preflight pot checks * Remove duplicated entry * Rename "function switches" to "customizable switches" * chore: Add translations * chore: Update translations * chore: Update Companion translations/wording
This commit is contained in:
@@ -230,6 +230,7 @@ PACK(struct ExpandState {
|
||||
uint8_t preflight:1;
|
||||
uint8_t throttle:1;
|
||||
uint8_t viewOpt:1;
|
||||
uint8_t functionSwitches:1;
|
||||
});
|
||||
|
||||
struct ExpandState expandState;
|
||||
@@ -248,6 +249,13 @@ uint8_t THROTTLE_ROW(uint8_t value)
|
||||
return HIDDEN_ROW;
|
||||
}
|
||||
|
||||
uint8_t FS_ROW(uint8_t value)
|
||||
{
|
||||
if (expandState.functionSwitches)
|
||||
return value;
|
||||
return HIDDEN_ROW;
|
||||
}
|
||||
|
||||
uint8_t VIEWOPT_ROW(uint8_t value)
|
||||
{
|
||||
if (expandState.viewOpt)
|
||||
@@ -341,7 +349,14 @@ inline uint8_t TIMER_ROW(uint8_t timer, uint8_t value)
|
||||
#define EXTRA_MODULE_ROWS
|
||||
|
||||
#if defined(FUNCTION_SWITCHES)
|
||||
#define FUNCTION_SWITCHES_ROWS READONLY_ROW, NAVIGATION_LINE_BY_LINE|3, NAVIGATION_LINE_BY_LINE|3, NAVIGATION_LINE_BY_LINE|3, NAVIGATION_LINE_BY_LINE|3, NAVIGATION_LINE_BY_LINE|3, NAVIGATION_LINE_BY_LINE|3, NAVIGATION_LINE_BY_LINE|(NUM_FUNCTIONS_SWITCHES-1),
|
||||
#define FUNCTION_SWITCHES_ROWS 1, \
|
||||
FS_ROW(NAVIGATION_LINE_BY_LINE|3), \
|
||||
FS_ROW(NAVIGATION_LINE_BY_LINE|3), \
|
||||
FS_ROW(NAVIGATION_LINE_BY_LINE|3), \
|
||||
FS_ROW(NAVIGATION_LINE_BY_LINE|3), \
|
||||
FS_ROW(NAVIGATION_LINE_BY_LINE|3), \
|
||||
FS_ROW(NAVIGATION_LINE_BY_LINE|3), \
|
||||
FS_ROW(NAVIGATION_LINE_BY_LINE|(NUM_FUNCTIONS_SWITCHES-1)),
|
||||
#else
|
||||
#define FUNCTION_SWITCHES_ROWS
|
||||
#endif
|
||||
@@ -779,7 +794,7 @@ void menuModelSetup(event_t event)
|
||||
#if defined(FUNCTION_SWITCHES)
|
||||
|
||||
case ITEM_MODEL_SETUP_LABEL:
|
||||
lcdDrawTextAlignedLeft(y, "Function Switches");
|
||||
expandState.functionSwitches = expandableSection(y, STR_FUNCTION_SWITCHES, expandState.functionSwitches, attr, event);
|
||||
break;
|
||||
|
||||
case ITEM_MODEL_SETUP_SW1:
|
||||
@@ -1076,9 +1091,14 @@ void menuModelSetup(event_t event)
|
||||
(g_model.potsWarnEnabled & (1 << i))) {
|
||||
flags |= INVERS;
|
||||
}
|
||||
|
||||
lcdDrawText(x, y, getPotLabel(i), flags);
|
||||
x = lcdNextPos+3;
|
||||
if (max_pots > 3) {
|
||||
lcdDrawText(x, y, getAnalogShortLabel(adcGetInputOffset(ADC_INPUT_POT) + i), flags);
|
||||
x = lcdNextPos + 1;
|
||||
}
|
||||
else {
|
||||
lcdDrawText(x, y, getPotLabel(i), flags);
|
||||
x = lcdNextPos + 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1092,7 +1112,7 @@ void menuModelSetup(event_t event)
|
||||
LcdFlags flags = 0;
|
||||
if ((menuHorizontalPosition == i) && attr)
|
||||
flags = BLINK | INVERS;
|
||||
else if (ANALOG_CENTER_BEEP(x) || (attr && CURSOR_ON_LINE()))
|
||||
else if (ANALOG_CENTER_BEEP(i) || (attr && CURSOR_ON_LINE()))
|
||||
flags = INVERS;
|
||||
lcdDrawText(x, y, getAnalogShortLabel(i), flags);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user