mirror of
https://github.com/opentx/opentx.git
synced 2025-07-17 13:25:20 +03:00
[Taranis] LR12 is now EU compatible (ported from master ce3d5dbac
)
This commit is contained in:
parent
493130504b
commit
e8983250ca
6 changed files with 18 additions and 17 deletions
|
@ -832,9 +832,9 @@ int OpenTxFirmware::isAvailable(PulsesProtocol proto, int port)
|
|||
switch (proto) {
|
||||
case PULSES_OFF:
|
||||
case PULSES_PXX_XJT_X16:
|
||||
case PULSES_PXX_XJT_LR12:
|
||||
return 1;
|
||||
case PULSES_PXX_XJT_D8:
|
||||
case PULSES_PXX_XJT_LR12:
|
||||
return id.contains("eu") ? 0 : 1;
|
||||
case PULSES_PPM:
|
||||
return id.contains("internalppm") ? 1 : 0;
|
||||
|
|
|
@ -415,6 +415,16 @@ bool isModuleAvailable(int module)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool isRfProtocolAvailable(int protocol)
|
||||
{
|
||||
#if defined(MODULE_D16_EU_ONLY_SUPPORT)
|
||||
if (protocol == RF_PROTO_D8) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
bool modelHasNotes()
|
||||
{
|
||||
char filename[sizeof(MODELS_PATH)+1+sizeof(g_model.header.name)+sizeof(TEXT_EXT)] = MODELS_PATH "/";
|
||||
|
|
|
@ -60,6 +60,7 @@ bool isSwitchAvailableInCustomFunctions(int swtch);
|
|||
bool isSwitchAvailableInMixes(int swtch);
|
||||
bool isSwitchAvailableInTimers(int swtch);
|
||||
bool isModuleAvailable(int module);
|
||||
bool isRfProtocolAvailable(int protocol);
|
||||
|
||||
bool modelHasNotes();
|
||||
|
||||
|
|
|
@ -192,8 +192,6 @@ int getSwitchWarningsCount()
|
|||
|
||||
#if !defined(TARANIS_INTERNAL_PPM)
|
||||
#define INTERNAL_MODULE_MODE_ROWS 0 // (OFF / RF protocols)
|
||||
#elif defined(MODULE_D16_EU_ONLY_SUPPORT)
|
||||
#define INTERNAL_MODULE_MODE_ROWS 0 // Module Type only
|
||||
#else
|
||||
#define INTERNAL_MODULE_MODE_ROWS (IS_MODULE_XJT(INTERNAL_MODULE) ? (uint8_t)1 : (uint8_t)0) // Module type + RF protocols
|
||||
#endif
|
||||
|
@ -212,11 +210,7 @@ int getSwitchWarningsCount()
|
|||
#define PORT_CHANNELS_ROWS(x) (x==INTERNAL_MODULE ? INTERNAL_MODULE_CHANNELS_ROWS : (x==EXTERNAL_MODULE ? EXTERNAL_MODULE_CHANNELS_ROWS : TRAINER_CHANNELS_ROWS()))
|
||||
#define FAILSAFE_ROWS(x) (HAS_RF_PROTOCOL_FAILSAFE(g_model.moduleData[x].rfProtocol) ? (g_model.moduleData[x].failsafeMode==FAILSAFE_CUSTOM ? (uint8_t)1 : (uint8_t)0) : HIDDEN_ROW)
|
||||
#define TIMER_ROWS 2|NAVIGATION_LINE_BY_LINE, 0, CASE_PERSISTENT_TIMERS(0) 0, 0
|
||||
#if defined(MODULE_D16_EU_ONLY_SUPPORT)
|
||||
#define EXTERNAL_MODULE_MODE_ROWS IS_MODULE_DSM2(EXTERNAL_MODULE) ? (uint8_t)1 : (uint8_t)0
|
||||
#else
|
||||
#define EXTERNAL_MODULE_MODE_ROWS (IS_MODULE_XJT(EXTERNAL_MODULE) || IS_MODULE_DSM2(EXTERNAL_MODULE)) ? (uint8_t)1 : (uint8_t)0
|
||||
#endif
|
||||
#define EXTERNAL_MODULE_MODE_ROWS (IS_MODULE_XJT(EXTERNAL_MODULE) || IS_MODULE_DSM2(EXTERNAL_MODULE)) ? (uint8_t)1 : (uint8_t)0
|
||||
#if TIMERS == 1
|
||||
#define TIMERS_ROWS TIMER_ROWS
|
||||
#elif TIMERS == 2
|
||||
|
@ -647,7 +641,7 @@ void menuModelSetup(uint8_t event)
|
|||
}
|
||||
break;
|
||||
case 1:
|
||||
CHECK_INCDEC_MODELVAR(event, g_model.moduleData[INTERNAL_MODULE].rfProtocol, RF_PROTO_X16, RF_PROTO_LAST);
|
||||
g_model.moduleData[INTERNAL_MODULE].rfProtocol = checkIncDec(event, g_model.moduleData[INTERNAL_MODULE].rfProtocol, RF_PROTO_X16, RF_PROTO_LAST, EE_MODEL, isRfProtocolAvailable);
|
||||
if (checkIncDec_Ret) {
|
||||
g_model.moduleData[INTERNAL_MODULE].channelsStart = 0;
|
||||
g_model.moduleData[INTERNAL_MODULE].channelsCount = 0;
|
||||
|
@ -660,7 +654,7 @@ void menuModelSetup(uint8_t event)
|
|||
lcd_putsLeft(y, STR_MODE);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_XJT_PROTOCOLS, 1+g_model.moduleData[0].rfProtocol, attr);
|
||||
if (attr) {
|
||||
CHECK_INCDEC_MODELVAR(event, g_model.moduleData[0].rfProtocol, RF_PROTO_OFF, RF_PROTO_LAST);
|
||||
g_model.moduleData[INTERNAL_MODULE].rfProtocol = checkIncDec(event, g_model.moduleData[INTERNAL_MODULE].rfProtocol, RF_PROTO_OFF, RF_PROTO_LAST, EE_MODEL, isRfProtocolAvailable);
|
||||
if (checkIncDec_Ret) {
|
||||
g_model.moduleData[0].type = MODULE_TYPE_XJT;
|
||||
g_model.moduleData[0].channelsStart = 0;
|
||||
|
@ -699,7 +693,7 @@ void menuModelSetup(uint8_t event)
|
|||
if (IS_MODULE_DSM2(EXTERNAL_MODULE))
|
||||
CHECK_INCDEC_MODELVAR(event, g_model.moduleData[EXTERNAL_MODULE].rfProtocol, DSM2_PROTO_LP45, DSM2_PROTO_DSMX);
|
||||
else
|
||||
CHECK_INCDEC_MODELVAR(event, g_model.moduleData[EXTERNAL_MODULE].rfProtocol, RF_PROTO_X16, RF_PROTO_LAST);
|
||||
g_model.moduleData[EXTERNAL_MODULE].rfProtocol = checkIncDec(event, g_model.moduleData[EXTERNAL_MODULE].rfProtocol, RF_PROTO_X16, RF_PROTO_LAST, EE_MODEL, isRfProtocolAvailable);
|
||||
if (checkIncDec_Ret) {
|
||||
g_model.moduleData[EXTERNAL_MODULE].channelsStart = 0;
|
||||
g_model.moduleData[EXTERNAL_MODULE].channelsCount = 0;
|
||||
|
|
|
@ -2197,13 +2197,9 @@ enum Protocols {
|
|||
enum RFProtocols {
|
||||
RF_PROTO_OFF = -1,
|
||||
RF_PROTO_X16,
|
||||
#if defined(MODULE_D16_EU_ONLY_SUPPORT)
|
||||
RF_PROTO_LAST = RF_PROTO_X16
|
||||
#else
|
||||
RF_PROTO_D8,
|
||||
RF_PROTO_LR12,
|
||||
RF_PROTO_LAST = RF_PROTO_LR12
|
||||
#endif
|
||||
};
|
||||
|
||||
#define HAS_RF_PROTOCOL_FAILSAFE(protocol) ((protocol) == RF_PROTO_X16)
|
||||
|
|
|
@ -107,8 +107,8 @@
|
|||
#define TR_TARANIS_PROTOCOLS "AUS\0""PPM\0""XJT\0""DSM?"
|
||||
|
||||
#if defined(MODULE_D16_EU_ONLY_SUPPORT)
|
||||
#define LEN_XJT_PROTOCOLS "\006"
|
||||
#define TR_XJT_PROTOCOLS "AUS\0 ""D16-EU"
|
||||
#define LEN_XJT_PROTOCOLS "\007"
|
||||
#define TR_XJT_PROTOCOLS "AUS\0 ""D16-EU\0""D8\0 ""LR12-EU"
|
||||
#else
|
||||
#define LEN_XJT_PROTOCOLS "\004"
|
||||
#define TR_XJT_PROTOCOLS "AUS\0""X16\0""D8\0 ""LR12"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue