fix(cpn): Improve module and protocol conversion (#2237)

This commit is contained in:
elecpower
2022-09-01 20:56:59 +10:00
committed by Peter Feerick
parent c6b7aca5fa
commit 8aa2b55c50
5 changed files with 29 additions and 7 deletions
@@ -346,6 +346,15 @@ void GeneralSettings::convert(RadioDataConversionState & cstate)
setDefaultControlTypes(cstate.toType); // start with default switches/pots/sliders
cstate.setComponent("Hardware");
cstate.setItemType("Int. Module");
RadioDataConversionState::LogField oldData(internalModule, ModuleData::typeToString(internalModule));
if (internalModule != MODULE_TYPE_NONE && (int)internalModule != g.currentProfile().defaultInternalModule()) {
internalModule = MODULE_TYPE_NONE;
cstate.setInvalid(oldData);
}
// Try to intelligently copy any custom control names
// SE and SG are skipped on X7 board