Skip to content

Commit

Permalink
Fix ext module change save (opentx#8885)
Browse files Browse the repository at this point in the history
  • Loading branch information
3djc authored Mar 17, 2022
1 parent d1125a7 commit 48f0d8d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions radio/src/gui/128x64/model_setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1063,6 +1063,7 @@ void menuModelSetup(event_t event)
g_model.moduleData[moduleIdx].type = reusableBuffer.moduleSetup.newType;
reusableBuffer.moduleSetup.previousType = reusableBuffer.moduleSetup.newType;
setModuleType(moduleIdx, g_model.moduleData[moduleIdx].type);
storageDirty(EE_MODEL);
}
else if (g_model.moduleData[moduleIdx].type == MODULE_TYPE_NONE) {
g_model.moduleData[moduleIdx].type = reusableBuffer.moduleSetup.newType;
Expand All @@ -1081,8 +1082,7 @@ void menuModelSetup(event_t event)
}
else
#endif
reusableBuffer.moduleSetup.newType = checkIncDec(event, reusableBuffer.moduleSetup.newType, MODULE_TYPE_NONE, MODULE_TYPE_MAX, EE_MODEL,
isExternalModuleAvailable);
reusableBuffer.moduleSetup.newType = checkIncDec(event, reusableBuffer.moduleSetup.newType, MODULE_TYPE_NONE, MODULE_TYPE_MAX, 0,isExternalModuleAvailable);
break;

case 1:
Expand Down
3 changes: 2 additions & 1 deletion radio/src/gui/212x64/model_setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,7 @@ void menuModelSetup(event_t event)
g_model.moduleData[EXTERNAL_MODULE].type = reusableBuffer.moduleSetup.newType;
reusableBuffer.moduleSetup.previousType = reusableBuffer.moduleSetup.newType;
setModuleType(EXTERNAL_MODULE, g_model.moduleData[EXTERNAL_MODULE].type);
storageDirty(EE_MODEL);
}
else if (g_model.moduleData[EXTERNAL_MODULE].type == MODULE_TYPE_NONE) {
g_model.moduleData[EXTERNAL_MODULE].type = reusableBuffer.moduleSetup.newType;
Expand All @@ -876,7 +877,7 @@ void menuModelSetup(event_t event)
if (s_editMode > 0) {
switch (menuHorizontalPosition) {
case 0:
reusableBuffer.moduleSetup.newType = checkIncDec(event, reusableBuffer.moduleSetup.newType, MODULE_TYPE_NONE, MODULE_TYPE_MAX, EE_MODEL, isExternalModuleAvailable);
reusableBuffer.moduleSetup.newType = checkIncDec(event, reusableBuffer.moduleSetup.newType, MODULE_TYPE_NONE, MODULE_TYPE_MAX, 0, isExternalModuleAvailable);
break;

case 1:
Expand Down
3 changes: 2 additions & 1 deletion radio/src/gui/480x272/model_setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1117,6 +1117,7 @@ bool menuModelSetup(event_t event)
g_model.moduleData[EXTERNAL_MODULE].type = reusableBuffer.moduleSetup.newType;
reusableBuffer.moduleSetup.previousType = reusableBuffer.moduleSetup.newType;
setModuleType(EXTERNAL_MODULE, g_model.moduleData[EXTERNAL_MODULE].type);
storageDirty(EE_MODEL);
}
else if (g_model.moduleData[EXTERNAL_MODULE].type == MODULE_TYPE_NONE) {
g_model.moduleData[EXTERNAL_MODULE].type = reusableBuffer.moduleSetup.newType;
Expand All @@ -1136,7 +1137,7 @@ bool menuModelSetup(event_t event)
}
else
#endif
reusableBuffer.moduleSetup.newType = checkIncDec(event, reusableBuffer.moduleSetup.newType, MODULE_TYPE_NONE, MODULE_TYPE_MAX, EE_MODEL,
reusableBuffer.moduleSetup.newType = checkIncDec(event, reusableBuffer.moduleSetup.newType, MODULE_TYPE_NONE, MODULE_TYPE_MAX, 0,
isExternalModuleAvailable);
}
break;
Expand Down

0 comments on commit 48f0d8d

Please sign in to comment.