Skip to content

Commit 91f9715

Browse files
authored
fix(bw): changing some model and radio settings does not update corresponding yaml file (#6111)
1 parent 8f6f4cc commit 91f9715

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

radio/src/gui/128x64/model_setup.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,7 @@ void menuModelCFSOne(event_t event)
690690
if (config == SWITCH_TOGGLE) {
691691
FSWITCH_SET_STARTUP(cfsIndex, FS_START_PREVIOUS); // Toggle switches do not have startup position
692692
}
693+
storageDirty(EE_MODEL);
693694
}
694695
break;
695696

@@ -709,6 +710,7 @@ void menuModelCFSOne(event_t event)
709710
FSWITCH_SET_STARTUP(cfsIndex, FS_START_PREVIOUS);
710711
}
711712
setGroupSwitchState(oldGroup);
713+
storageDirty(EE_MODEL);
712714
}
713715
break;
714716

@@ -718,6 +720,7 @@ void menuModelCFSOne(event_t event)
718720
if (attr) {
719721
startPos = checkIncDec(event, startPos, FS_START_ON, FS_START_PREVIOUS, EE_MODEL);
720722
FSWITCH_SET_STARTUP(cfsIndex, startPos);
723+
storageDirty(EE_MODEL);
721724
}
722725
break;
723726

radio/src/gui/common/stdlcd/menus.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void pushMenu(MenuHandlerFunc newMenu)
5959
killAllEvents();
6060

6161
if (menuLevel == 0) {
62-
if (newMenu == menuRadioSetup)
62+
if (newMenu == menuTabGeneral[0].menuFunc)
6363
menuVerticalPositions[0] = 1;
6464
if (newMenu == menuModelSelect)
6565
menuVerticalPositions[0] = 0;

radio/src/gui/common/stdlcd/radio_hardware.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ void menuRadioHardware(event_t event)
516516
flags = menuHorizontalPosition == 2 ? attr : 0;
517517
bool potinversion = getPotInversion(idx);
518518
lcdDrawChar(LCD_W - 8, y, potinversion ? 127 : 126, flags);
519-
if (flags & (~RIGHT)) potinversion = checkIncDec(event, potinversion, 0, 1, (isModelMenuDisplayed()) ? EE_MODEL : EE_GENERAL);
519+
if (flags & (~RIGHT)) potinversion = checkIncDec(event, potinversion, 0, 1, EE_GENERAL);
520520
setPotInversion(idx, potinversion);
521521
} else if (getPotInversion(idx)) {
522522
setPotInversion(idx, 0);
@@ -537,7 +537,7 @@ void menuRadioHardware(event_t event)
537537
flags = menuHorizontalPosition == 0 ? attr : 0;
538538
auto source = switchGetFlexConfig(index);
539539
lcdDrawText(HW_SETTINGS_COLUMN1, y, (source < 0) ? STR_NONE : adcGetInputLabel(ADC_INPUT_FLEX, source), flags);
540-
if (flags & (~RIGHT)) source = checkIncDec(event, source, -1, adcGetMaxInputs(ADC_INPUT_FLEX) - 1, (isModelMenuDisplayed()) ? EE_MODEL : EE_GENERAL, isFlexSwitchSourceValid);
540+
if (flags & (~RIGHT)) source = checkIncDec(event, source, -1, adcGetMaxInputs(ADC_INPUT_FLEX) - 1, EE_GENERAL, isFlexSwitchSourceValid);
541541
switchConfigFlex(index, source);
542542

543543
//Name
@@ -561,6 +561,7 @@ void menuRadioHardware(event_t event)
561561
g_eeGeneral.switchConfig =
562562
(g_eeGeneral.switchConfig & ~mask) |
563563
((swconfig_t(config) & SW_CFG_MASK) << (SW_CFG_BITS * index));
564+
storageDirty(EE_GENERAL);
564565
}
565566
}
566567
else {
@@ -584,6 +585,7 @@ void menuRadioHardware(event_t event)
584585
g_eeGeneral.switchConfig =
585586
(g_eeGeneral.switchConfig & ~mask) |
586587
((swconfig_t(config) & SW_CFG_MASK) << (SW_CFG_BITS * index));
588+
storageDirty(EE_GENERAL);
587589
}
588590
}
589591
} else if (k <= ITEM_RADIO_HARDWARE_SERIAL_PORT_END) {

0 commit comments

Comments
 (0)