1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-20 06:45:10 +03:00

Harmonise module default channel count

This commit is contained in:
Andre Bernet 2015-10-31 11:24:28 +04:00
parent 3d29b8e7e5
commit 8b419770e2

View file

@ -645,17 +645,14 @@ void menuModelSetup(uint8_t event)
if (checkIncDec_Ret) { if (checkIncDec_Ret) {
g_model.moduleData[INTERNAL_MODULE].rfProtocol = 0; g_model.moduleData[INTERNAL_MODULE].rfProtocol = 0;
g_model.moduleData[INTERNAL_MODULE].channelsStart = 0; g_model.moduleData[INTERNAL_MODULE].channelsStart = 0;
if (g_model.moduleData[INTERNAL_MODULE].type == MODULE_TYPE_PPM)
g_model.moduleData[INTERNAL_MODULE].channelsCount = 0; g_model.moduleData[INTERNAL_MODULE].channelsCount = 0;
else
g_model.moduleData[INTERNAL_MODULE].channelsCount = MAX_INTERNAL_MODULE_CHANNELS();
} }
break; break;
case 1: case 1:
CHECK_INCDEC_MODELVAR(event, g_model.moduleData[INTERNAL_MODULE].rfProtocol, RF_PROTO_X16, RF_PROTO_LAST); CHECK_INCDEC_MODELVAR(event, g_model.moduleData[INTERNAL_MODULE].rfProtocol, RF_PROTO_X16, RF_PROTO_LAST);
if (checkIncDec_Ret) { if (checkIncDec_Ret) {
g_model.moduleData[INTERNAL_MODULE].channelsStart = 0; g_model.moduleData[INTERNAL_MODULE].channelsStart = 0;
g_model.moduleData[INTERNAL_MODULE].channelsCount = MAX_INTERNAL_MODULE_CHANNELS(); g_model.moduleData[INTERNAL_MODULE].channelsCount = 0;
} }
} }
} }
@ -696,10 +693,8 @@ void menuModelSetup(uint8_t event)
if (checkIncDec_Ret) { if (checkIncDec_Ret) {
g_model.moduleData[EXTERNAL_MODULE].rfProtocol = 0; g_model.moduleData[EXTERNAL_MODULE].rfProtocol = 0;
g_model.moduleData[EXTERNAL_MODULE].channelsStart = 0; g_model.moduleData[EXTERNAL_MODULE].channelsStart = 0;
if (g_model.moduleData[EXTERNAL_MODULE].type == MODULE_TYPE_PPM)
g_model.moduleData[EXTERNAL_MODULE].channelsCount = 0; g_model.moduleData[EXTERNAL_MODULE].channelsCount = 0;
else
g_model.moduleData[EXTERNAL_MODULE].channelsCount = MAX_EXTERNAL_MODULE_CHANNELS();
} }
break; break;
case 1: case 1:
@ -709,7 +704,7 @@ void menuModelSetup(uint8_t event)
CHECK_INCDEC_MODELVAR(event, g_model.moduleData[EXTERNAL_MODULE].rfProtocol, RF_PROTO_X16, RF_PROTO_LAST); CHECK_INCDEC_MODELVAR(event, g_model.moduleData[EXTERNAL_MODULE].rfProtocol, RF_PROTO_X16, RF_PROTO_LAST);
if (checkIncDec_Ret) { if (checkIncDec_Ret) {
g_model.moduleData[EXTERNAL_MODULE].channelsStart = 0; g_model.moduleData[EXTERNAL_MODULE].channelsStart = 0;
g_model.moduleData[EXTERNAL_MODULE].channelsCount = MAX_EXTERNAL_MODULE_CHANNELS(); g_model.moduleData[EXTERNAL_MODULE].channelsCount = 0;
} }
} }
} }