From 6559456534254645a31ae294ba0f6b85880d3c02 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Thu, 4 Aug 2016 16:45:23 +0200 Subject: [PATCH] Fix channel count on dsm2 module, purely cosmetic (closes issue #3673) (#3689) Taranis menu always use 8 channels as default opposed to 9x and Horus, which use the maximum number as default channel count (which is 6 on dsm2). This commit does not change that logic. --- radio/src/gui/212x64/model_setup.cpp | 2 +- radio/src/opentx.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/radio/src/gui/212x64/model_setup.cpp b/radio/src/gui/212x64/model_setup.cpp index 78ed3948a..532f64d35 100644 --- a/radio/src/gui/212x64/model_setup.cpp +++ b/radio/src/gui/212x64/model_setup.cpp @@ -767,7 +767,7 @@ void menuModelSetup(uint8_t event) if (checkIncDec_Ret) { g_model.moduleData[EXTERNAL_MODULE].rfProtocol = 0; g_model.moduleData[EXTERNAL_MODULE].channelsStart = 0; - g_model.moduleData[EXTERNAL_MODULE].channelsCount = 0; + g_model.moduleData[EXTERNAL_MODULE].channelsCount = min(0, MAX_EXTERNAL_MODULE_CHANNELS()); } break; case 1: diff --git a/radio/src/opentx.h b/radio/src/opentx.h index be01eb28d..3938f986e 100644 --- a/radio/src/opentx.h +++ b/radio/src/opentx.h @@ -404,7 +404,8 @@ void memswap(void * a, void * b, uint8_t size); #endif #if defined(CPUARM) - static const int8_t maxChannelsModules[] = { 0, 8, 8, -2, 8 }; // relative to 8! +// Order is the same as in enum Protocols in myeeprom.h (none, ppm, xjt, dsm, crossfire, multi) + static const int8_t maxChannelsModules[] = { 0, 8, 8, -2, 8, 8 }; // relative to 8! static const int8_t maxChannelsXJT[] = { 0, 8, 0, 4 }; // relative to 8! #define MAX_TRAINER_CHANNELS() (8) #endif