Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bw): fixes and improvements for model setup page #5256

Merged
merged 1 commit into from
Jul 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions radio/src/gui/128x64/model_setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ bool checkCFSSwitchAvailable(int sw)
void menuModelSetup(event_t event)
{
int8_t old_editMode = s_editMode;
bool CURSOR_ON_CELL = (menuHorizontalPosition >= 0);

#if defined(PCBTARANIS)
int8_t old_posHorz = menuHorizontalPosition;
Expand All @@ -627,10 +628,10 @@ void menuModelSetup(event_t event)

0, // Preflight section
PREFLIGHT_ROW(0), // Checklist
PREFLIGHT_ROW(0), // Checklist interactive
PREFLIGHT_ROW(g_model.displayChecklist ? 0 : HIDDEN_ROW), // Checklist interactive
PREFLIGHT_ROW(0), // Throttle warning
PREFLIGHT_ROW(0), // Custom position for throttle warning enable
PREFLIGHT_ROW(0), // Custom position for throttle warning value
PREFLIGHT_ROW(!g_model.disableThrottleWarning ? 0 : HIDDEN_ROW), // Custom position for throttle warning enable
PREFLIGHT_ROW(!g_model.disableThrottleWarning && g_model.enableCustomThrottleWarning ? 0 : HIDDEN_ROW), // Custom position for throttle warning value
WARN_ROWS

uint8_t(NAVIGATION_LINE_BY_LINE | (adcGetInputOffset(ADC_INPUT_FLEX + 1) - 1)), // Center beeps
Expand Down Expand Up @@ -1189,17 +1190,23 @@ void menuModelSetup(event_t event)

case ITEM_MODEL_SETUP_BEEP_CENTER: {
lcdDrawTextAlignedLeft(y, STR_BEEPCTR);
uint8_t pot_offset = adcGetInputOffset(ADC_INPUT_FLEX);
uint8_t input_max = adcGetMaxInputs(ADC_INPUT_MAIN) + adcGetMaxInputs(ADC_INPUT_FLEX);
coord_t x = MODEL_SETUP_2ND_COLUMN;
for (uint8_t i = 0; i < input_max; i++) {
coord_t x = MODEL_SETUP_2ND_COLUMN + i*FW;
if ( i >= pot_offset && (IS_POT_MULTIPOS(i - pot_offset) || !IS_POT_SLIDER_AVAILABLE(i - pot_offset)) ) {
if (attr && menuHorizontalPosition == i) repeatLastCursorMove(event);
continue;
}
LcdFlags flags = 0;
if ((menuHorizontalPosition == i) && attr)
flags = BLINK | INVERS;
else if (ANALOG_CENTER_BEEP(i) || (attr && CURSOR_ON_LINE()))
flags = INVERS;
lcdDrawText(x, y, getAnalogShortLabel(i), flags);
x = lcdNextPos;
}
if (attr) {
if (attr && CURSOR_ON_CELL) {
if (event == EVT_KEY_BREAK(KEY_ENTER)) {
s_editMode = 0;
g_model.beepANACenter ^= ((BeepANACenter)1<<menuHorizontalPosition);
Expand Down
10 changes: 5 additions & 5 deletions radio/src/gui/212x64/model_setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -531,10 +531,10 @@ void menuModelSetup(event_t event)

0, // ITEM_MODEL_SETUP_PREFLIGHT_LABEL
PREFLIGHT_ROW(0), // ITEM_MODEL_SETUP_CHECKLIST_DISPLAY
PREFLIGHT_ROW(0), // ITEM_MODEL_SETUP_CHECKLIST_INTERACTIVE
PREFLIGHT_ROW(0), // ITEM_MODEL_SETUP_THROTTLE_WARNING
PREFLIGHT_ROW(0), // ITEM_MODEL_SETUP_CUSTOM_THROTTLE_WARNING
PREFLIGHT_ROW(0), // ITEM_MODEL_SETUP_CUSTOM_THROTTLE_WARNING_VALUE
PREFLIGHT_ROW(g_model.displayChecklist ? 0 : HIDDEN_ROW), // Checklist interactive
PREFLIGHT_ROW(0), // Throttle warning
PREFLIGHT_ROW(!g_model.disableThrottleWarning ? 0 : HIDDEN_ROW), // Custom position for throttle warning enable
PREFLIGHT_ROW(!g_model.disableThrottleWarning && g_model.enableCustomThrottleWarning ? 0 : HIDDEN_ROW), // Custom position for throttle warning value
SW_WARN_ROWS, // ITEM_MODEL_SETUP_SWITCHES_WARNING1
POT_WARN_ROWS, // ITEM_MODEL_SETUP_POTS_WARNING

Expand Down Expand Up @@ -1011,7 +1011,7 @@ void menuModelSetup(event_t event)
uint8_t max_inputs = adcGetMaxInputs(ADC_INPUT_MAIN) + adcGetMaxInputs(ADC_INPUT_FLEX);
coord_t x = MODEL_SETUP_2ND_COLUMN;
for (uint8_t i = 0; i < max_inputs; i++) {
if ( i >= pot_offset && IS_POT_MULTIPOS(i - pot_offset) ) {
if ( i >= pot_offset && (IS_POT_MULTIPOS(i - pot_offset) || !IS_POT_SLIDER_AVAILABLE(i - pot_offset)) ) {
if (attr && menuHorizontalPosition == i) repeatLastCursorMove(event);
continue;
}
Expand Down