Clear active model internal module settings if radio level setting changed (#1316)

* [colorlcd] Ensure active internalModule is reset if different to radio level setting

* [B&W] Ensure active internalModule is reset if different to radio level setting

* storageDirty only when model setting cleared

* [b&w] Remove reusablebuffer, code re-order

* [colorlcd] More direct moduleType comparision
Consistent with B&W test
This commit is contained in:
Peter Feerick
2022-01-03 20:55:49 +10:00
committed by GitHub
parent d1f56d6dfe
commit 351643b652
2 changed files with 19 additions and 6 deletions
@@ -528,13 +528,19 @@ void menuRadioHardware(event_t event)
#endif
#if !defined(PCBX9D) && !defined(PCBX9DP) && !defined(PCBX9E)
case ITEM_RADIO_HARDWARE_INTERNAL_MODULE:
case ITEM_RADIO_HARDWARE_INTERNAL_MODULE: {
g_eeGeneral.internalModule =
editChoice(HW_SETTINGS_COLUMN2, y, STR_INTERNAL_MODULE,
STR_INTERNAL_MODULE_PROTOCOLS,
g_eeGeneral.internalModule, MODULE_TYPE_NONE,
MODULE_TYPE_MAX, attr, event, isInternalModuleSupported);
break;
if (g_model.moduleData[INTERNAL_MODULE].type !=
g_eeGeneral.internalModule) {
memclear(&g_model.moduleData[INTERNAL_MODULE], sizeof(ModuleData));
storageDirty(EE_MODEL);
storageDirty(EE_GENERAL);
}
} break;
#endif
#if (defined(CROSSFIRE) || defined(GHOST))