XJT2 channel count can only be 8, 16 or 24

This commit is contained in:
3djc
2019-02-22 10:31:54 +01:00
parent a90b1c43de
commit 16e54f27e0
4 changed files with 19 additions and 8 deletions
+3 -3
View File
@@ -199,8 +199,8 @@ inline bool isModuleDSM2(uint8_t idx)
}
#endif
// order is the same as in enum Protocols in myeeprom.h (none, ppm, pxx, dsm, crossfire, multi, r9m, sbus)
static const int8_t maxChannelsModules[] = { 0, 8, 8, -2, 8, 4, 8, 8}; // relative to 8!
// order is the same as in enum Protocols in myeeprom.h (none, ppm, pxx, pxx2, dsm, crossfire, multi, r9m, r9m2, sbus)
static const int8_t maxChannelsModules[] = { 0, 8, 8, 16, -2, 8, 4, 8, 16, 8}; // relative to 8!
static const int8_t maxChannelsXJT[] = { 0, 8, 0, 4 }; // relative to 8!
constexpr int8_t MAX_TRAINER_CHANNELS_M8 = MAX_TRAINER_CHANNELS - 8;
@@ -242,7 +242,7 @@ inline int8_t sentModuleChannels(uint8_t idx)
{
if (isModuleCrossfire(idx))
return CROSSFIRE_CHANNELS_COUNT;
else if ((isModuleMultimodule(idx) && !isModuleMultimoduleDSM2(idx)) || isModuleXJT2(idx))
else if (isModuleMultimodule(idx) && !isModuleMultimoduleDSM2(idx))
return 16;
else
return 8 + g_model.moduleData[idx].channelsCount;