Merge pull request #598 from EdgeTX/maxChannels

Tweak max channel values for MPM generally, MPM DSM2 and DSM2
This commit is contained in:
Peter Feerick
2021-08-19 20:55:36 +10:00
committed by GitHub
2 changed files with 11 additions and 0 deletions
+1
View File
@@ -567,6 +567,7 @@ class ModuleWindow : public FormGroup {
channelStart->setMax(MAX_OUTPUT_CHANNELS - sentModuleChannels(moduleIdx) + 1);
});
channelEnd->enable(minModuleChannels(moduleIdx) < maxModuleChannels(moduleIdx));
if (channelEnd->getValue() > channelEnd->getMax()) channelEnd->setValue(channelEnd->getMax());
}
void update()
+10
View File
@@ -367,6 +367,16 @@ inline int8_t maxModuleChannels_M8(uint8_t moduleIdx)
else if (isModuleAFHDS3(moduleIdx)) {
return 10;
}
else if (isModuleDSM2(moduleIdx)) {
return 0; // 8 channels
}
else if (isModuleMultimoduleDSM2(moduleIdx)) {
return 4; // 12 channels
}
//TODO: This should be based on the selected protocol
else if(isModuleMultimodule(moduleIdx)) {
return 8; // 16 channels
}
else {
return maxChannelsModules_M8[g_model.moduleData[moduleIdx].type];
}