From 41093fa791c03dc19bf6f6abbf07ed9b0456c5ae Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Tue, 17 Aug 2021 21:53:47 +1000 Subject: [PATCH 1/3] Set better max channel values for for DSM2 and MPM --- radio/src/pulses/modules_helpers.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/radio/src/pulses/modules_helpers.h b/radio/src/pulses/modules_helpers.h index 23eca3f9f..d35cf5e92 100644 --- a/radio/src/pulses/modules_helpers.h +++ b/radio/src/pulses/modules_helpers.h @@ -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 -1; // 7 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]; } From 8ae13bb565c1a7ead4cd0231fee94b77c054a184 Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Tue, 17 Aug 2021 22:19:30 +1000 Subject: [PATCH 2/3] If end channel is out of range, pull it into line --- radio/src/gui/colorlcd/model_setup.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/radio/src/gui/colorlcd/model_setup.cpp b/radio/src/gui/colorlcd/model_setup.cpp index e7bec9ba7..4dc2373e3 100644 --- a/radio/src/gui/colorlcd/model_setup.cpp +++ b/radio/src/gui/colorlcd/model_setup.cpp @@ -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() From 275515df642724afcb045f387abeaeb35facfeba Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Thu, 19 Aug 2021 20:10:36 +1000 Subject: [PATCH 3/3] MPM DSM2 default is 7, maximum of 12 --- radio/src/pulses/modules_helpers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/pulses/modules_helpers.h b/radio/src/pulses/modules_helpers.h index d35cf5e92..0b4c1a237 100644 --- a/radio/src/pulses/modules_helpers.h +++ b/radio/src/pulses/modules_helpers.h @@ -371,7 +371,7 @@ inline int8_t maxModuleChannels_M8(uint8_t moduleIdx) return 0; // 8 channels } else if (isModuleMultimoduleDSM2(moduleIdx)) { - return -1; // 7 channels + return 4; // 12 channels } //TODO: This should be based on the selected protocol else if(isModuleMultimodule(moduleIdx)) {