mirror of
https://github.com/opentx/opentx.git
synced 2025-07-23 00:05:17 +03:00
Better handling of Protocols and Functions which are not chosen at compilation time. Now they are proposed as [Vario] / [PXX] when not available
This commit is contained in:
parent
8a7dc4d009
commit
7eded397f7
6 changed files with 81 additions and 107 deletions
|
@ -2041,10 +2041,8 @@ void menuProcCustomSwitches(uint8_t event)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
{
|
|
||||||
CHECK_INCDEC_MODELVAR(event, cs.v1, v1_min, v1_max);
|
CHECK_INCDEC_MODELVAR(event, cs.v1, v1_min, v1_max);
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case 2:
|
case 2:
|
||||||
CHECK_INCDEC_MODELVAR(event, cs.v2, v2_min, v2_max);
|
CHECK_INCDEC_MODELVAR(event, cs.v2, v2_min, v2_max);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -100,34 +100,6 @@ enum BeeperMode {
|
||||||
#define EXTRA_ARM_FIELDS
|
#define EXTRA_ARM_FIELDS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(FRSKY)
|
|
||||||
#define FRSKY_OPTION 0x01
|
|
||||||
#else
|
|
||||||
#define FRSKY_OPTION 0x00
|
|
||||||
#endif
|
|
||||||
#if defined(HAPTIC)
|
|
||||||
#define HAPTIC_OPTION 0x02
|
|
||||||
#else
|
|
||||||
#define HAPTIC_OPTION 0x00
|
|
||||||
#endif
|
|
||||||
#if defined(VARIO)
|
|
||||||
#define VARIO_OPTION 0x04
|
|
||||||
#else
|
|
||||||
#define VARIO_OPTION 0x00
|
|
||||||
#endif
|
|
||||||
#if defined(PXX)
|
|
||||||
#define PXX_OPTION 0x10
|
|
||||||
#else
|
|
||||||
#define PXX_OPTION 0x00
|
|
||||||
#endif
|
|
||||||
#if defined(DSM2)
|
|
||||||
#define DSM2_OPTION 0x20
|
|
||||||
#else
|
|
||||||
#define DSM2_OPTION 0x00
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define FW_OPTIONS (FRSKY_OPTION|HAPTIC_OPTION|VARIO_OPTION|PXX_OPTION|DSM2_OPTION)
|
|
||||||
|
|
||||||
#define ALTERNATE_VIEW 0x10
|
#define ALTERNATE_VIEW 0x10
|
||||||
PACK(typedef struct t_EEGeneral {
|
PACK(typedef struct t_EEGeneral {
|
||||||
uint8_t myVers;
|
uint8_t myVers;
|
||||||
|
@ -173,8 +145,6 @@ PACK(typedef struct t_EEGeneral {
|
||||||
|
|
||||||
EXTRA_ARM_FIELDS
|
EXTRA_ARM_FIELDS
|
||||||
|
|
||||||
uint8_t fwOptions;
|
|
||||||
|
|
||||||
}) EEGeneral;
|
}) EEGeneral;
|
||||||
|
|
||||||
// eeprom modelspec
|
// eeprom modelspec
|
||||||
|
@ -316,21 +286,17 @@ enum Functions {
|
||||||
FUNC_TRAINER_AIL,
|
FUNC_TRAINER_AIL,
|
||||||
FUNC_INSTANT_TRIM,
|
FUNC_INSTANT_TRIM,
|
||||||
FUNC_PLAY_SOUND,
|
FUNC_PLAY_SOUND,
|
||||||
#ifdef HAPTIC
|
|
||||||
FUNC_HAPTIC,
|
FUNC_HAPTIC,
|
||||||
#endif
|
#if defined(PCBV4)
|
||||||
#ifdef SOMO
|
|
||||||
FUNC_PLAY_SOMO,
|
FUNC_PLAY_SOMO,
|
||||||
#endif
|
#endif
|
||||||
FUNC_RESET,
|
FUNC_RESET,
|
||||||
#if defined(FRSKY)
|
|
||||||
FUNC_VARIO,
|
FUNC_VARIO,
|
||||||
#endif
|
#if defined(PCBV4)
|
||||||
#ifdef SDCARD
|
|
||||||
FUNC_LOGS,
|
FUNC_LOGS,
|
||||||
#endif
|
#endif
|
||||||
#ifdef DEBUG
|
#if defined(DEBUG)
|
||||||
FUNC_TEST,
|
FUNC_TEST, // should remain the last before MAX as not added in companion9x
|
||||||
#endif
|
#endif
|
||||||
FUNC_MAX
|
FUNC_MAX
|
||||||
};
|
};
|
||||||
|
@ -542,12 +508,8 @@ enum Protocols {
|
||||||
PROTO_PPM,
|
PROTO_PPM,
|
||||||
PROTO_PPM16,
|
PROTO_PPM16,
|
||||||
PROTO_PPMSIM,
|
PROTO_PPMSIM,
|
||||||
#if defined(PXX)
|
|
||||||
PROTO_PXX,
|
PROTO_PXX,
|
||||||
#endif
|
|
||||||
#if defined(DSM2)
|
|
||||||
PROTO_DSM2,
|
PROTO_DSM2,
|
||||||
#endif
|
|
||||||
PROTO_MAX
|
PROTO_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -135,7 +135,6 @@ void generalDefault()
|
||||||
memset(&g_eeGeneral, 0, sizeof(g_eeGeneral));
|
memset(&g_eeGeneral, 0, sizeof(g_eeGeneral));
|
||||||
g_eeGeneral.lightSw = SWITCH_ON;
|
g_eeGeneral.lightSw = SWITCH_ON;
|
||||||
g_eeGeneral.myVers = EEPROM_VER;
|
g_eeGeneral.myVers = EEPROM_VER;
|
||||||
g_eeGeneral.fwOptions = FW_OPTIONS;
|
|
||||||
g_eeGeneral.contrast = 25;
|
g_eeGeneral.contrast = 25;
|
||||||
g_eeGeneral.vBatWarn = 90;
|
g_eeGeneral.vBatWarn = 90;
|
||||||
for (int i = 0; i < 7; ++i) {
|
for (int i = 0; i < 7; ++i) {
|
||||||
|
|
|
@ -50,12 +50,12 @@
|
||||||
#ifdef PXX
|
#ifdef PXX
|
||||||
#define TR_PXX "PXX\0 "
|
#define TR_PXX "PXX\0 "
|
||||||
#else
|
#else
|
||||||
#define TR_PXX
|
#define TR_PXX "[PXX]\0"
|
||||||
#endif
|
#endif
|
||||||
#ifdef DSM2
|
#ifdef DSM2
|
||||||
#define TR_DSM2 "DSM2\0 "
|
#define TR_DSM2 "DSM2\0 "
|
||||||
#else
|
#else
|
||||||
#define TR_DSM2
|
#define TR_DSM2 "[DSM2]"
|
||||||
#endif
|
#endif
|
||||||
#define TR_VPROTOS "PPM\0 ""PPM16\0""PPMsim" TR_PXX TR_DSM2
|
#define TR_VPROTOS "PPM\0 ""PPM16\0""PPMsim" TR_PXX TR_DSM2
|
||||||
|
|
||||||
|
@ -89,37 +89,42 @@
|
||||||
#define TR_VCSWFUNC "----\0 ""v>ofs ""v<ofs ""|v|>ofs""|v|<ofs""AND ""OR ""XOR ""v1==v2 ""v1!=v2 ""v1>v2 ""v1<v2 ""v1>=v2 ""v1<=v2 "
|
#define TR_VCSWFUNC "----\0 ""v>ofs ""v<ofs ""|v|>ofs""|v|<ofs""AND ""OR ""XOR ""v1==v2 ""v1!=v2 ""v1>v2 ""v1<v2 ""v1>=v2 ""v1<=v2 "
|
||||||
|
|
||||||
#define LEN_VFSWFUNC "\015"
|
#define LEN_VFSWFUNC "\015"
|
||||||
#if defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
|
#if defined(VARIO)
|
||||||
#define TR_VVARIO "Vario "
|
#define TR_VVARIO "Vario "
|
||||||
#else
|
#else
|
||||||
#define TR_VVARIO
|
#define TR_VVARIO "[Vario] "
|
||||||
#endif
|
#endif
|
||||||
#ifdef SDCARD
|
#if defined(AUDIO)
|
||||||
#define TR_SDCLOGGS "SDCARD Logs "
|
#define TR_SOUND "[Play Sound]\0"
|
||||||
#else
|
|
||||||
#define TR_SDCLOGGS
|
|
||||||
#endif
|
|
||||||
#ifdef SOMO
|
|
||||||
#define TR_SOMO "Play Track\0 "
|
|
||||||
#else
|
|
||||||
#define TR_SOMO
|
|
||||||
#endif
|
|
||||||
#ifdef AUDIO
|
|
||||||
#define TR_SOUND "Play Sound\0 "
|
|
||||||
#else
|
#else
|
||||||
#define TR_SOUND "Beep\0 "
|
#define TR_SOUND "Beep\0 "
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAPTIC
|
#if defined(HAPTIC)
|
||||||
#define TR_HAPTIC "Haptic\0 "
|
#define TR_HAPTIC "Haptic\0 "
|
||||||
#else
|
#else
|
||||||
#define TR_HAPTIC
|
#define TR_HAPTIC "[Haptic]\0 "
|
||||||
|
#endif
|
||||||
|
#if defined(PCBV4)
|
||||||
|
#if defined(SDCARD)
|
||||||
|
#define TR_SDCLOGS "SDCARD Logs "
|
||||||
|
#else
|
||||||
|
#define TR_SDCLOGS "[SDCARD Logs]"
|
||||||
|
#endif
|
||||||
|
#if defined(SOMO)
|
||||||
|
#define TR_SOMO "Play Track\0 "
|
||||||
|
#else
|
||||||
|
#define TR_SOMO "[Play Track]\0"
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define TR_SDCLOGS
|
||||||
|
#define TR_SOMO
|
||||||
#endif
|
#endif
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
#define TR_TEST "Test\0 "
|
#define TR_TEST "Test\0 "
|
||||||
#else
|
#else
|
||||||
#define TR_TEST
|
#define TR_TEST
|
||||||
#endif
|
#endif
|
||||||
#define TR_VFSWFUNC "Security \0 ""Trainer \0 ""Instant Trim " TR_SOUND TR_HAPTIC TR_SOMO "Reset\0 " TR_VVARIO TR_SDCLOGGS TR_TEST
|
#define TR_VFSWFUNC "Security \0 ""Trainer \0 ""Instant Trim " TR_SOUND TR_HAPTIC TR_SOMO "Reset\0 " TR_VVARIO TR_SDCLOGS TR_TEST
|
||||||
|
|
||||||
#define LEN_VFSWRESET "\006"
|
#define LEN_VFSWRESET "\006"
|
||||||
#define TR_VFSWRESET "Timer1""Timer2""All ""Telem."
|
#define TR_VFSWRESET "Timer1""Timer2""All ""Telem."
|
||||||
|
|
|
@ -50,12 +50,12 @@
|
||||||
#ifdef PXX
|
#ifdef PXX
|
||||||
#define TR_PXX "PXX\0 "
|
#define TR_PXX "PXX\0 "
|
||||||
#else
|
#else
|
||||||
#define TR_PXX
|
#define TR_PXX "[PXX]\0"
|
||||||
#endif
|
#endif
|
||||||
#ifdef DSM2
|
#ifdef DSM2
|
||||||
#define TR_DSM2 "DSM2\0 "
|
#define TR_DSM2 "DSM2\0 "
|
||||||
#else
|
#else
|
||||||
#define TR_DSM2
|
#define TR_DSM2 "[DSM2]"
|
||||||
#endif
|
#endif
|
||||||
#define TR_VPROTOS "PPM\0 ""PPM16\0""PPMsim" TR_PXX TR_DSM2
|
#define TR_VPROTOS "PPM\0 ""PPM16\0""PPMsim" TR_PXX TR_DSM2
|
||||||
|
|
||||||
|
@ -89,37 +89,42 @@
|
||||||
#define TR_VCSWFUNC "----\0 ""v>ofs ""v<ofs ""|v|>ofs""|v|<ofs""AND ""OR ""XOR ""v1==v2 ""v1!=v2 ""v1>v2 ""v1<v2 ""v1>=v2 ""v1<=v2 "
|
#define TR_VCSWFUNC "----\0 ""v>ofs ""v<ofs ""|v|>ofs""|v|<ofs""AND ""OR ""XOR ""v1==v2 ""v1!=v2 ""v1>v2 ""v1<v2 ""v1>=v2 ""v1<=v2 "
|
||||||
|
|
||||||
#define LEN_VFSWFUNC "\015"
|
#define LEN_VFSWFUNC "\015"
|
||||||
#if defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
|
#if defined(VARIO)
|
||||||
#define TR_VVARIO "Vario "
|
#define TR_VVARIO "Vario "
|
||||||
#else
|
#else
|
||||||
#define TR_VVARIO
|
#define TR_VVARIO "[Vario] "
|
||||||
#endif
|
#endif
|
||||||
#ifdef SDCARD
|
#if defined(AUDIO)
|
||||||
#define TR_SDCLOGGS "SDCARD Logs "
|
#define TR_SOUND "[Play Sound]\0"
|
||||||
#else
|
|
||||||
#define TR_SDCLOGGS
|
|
||||||
#endif
|
|
||||||
#ifdef SOMO
|
|
||||||
#define TR_SOMO "Jouer fichier"
|
|
||||||
#else
|
|
||||||
#define TR_SOMO
|
|
||||||
#endif
|
|
||||||
#ifdef AUDIO
|
|
||||||
#define TR_SOUND "Jouer son\0 "
|
|
||||||
#else
|
#else
|
||||||
#define TR_SOUND "Beep\0 "
|
#define TR_SOUND "Beep\0 "
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAPTIC
|
#if defined(HAPTIC)
|
||||||
#define TR_HAPTIC "Haptic\0 "
|
#define TR_HAPTIC "Haptic\0 "
|
||||||
#else
|
#else
|
||||||
#define TR_HAPTIC
|
#define TR_HAPTIC "[Haptic]\0 "
|
||||||
|
#endif
|
||||||
|
#if defined(PCBV4)
|
||||||
|
#if defined(SDCARD)
|
||||||
|
#define TR_SDCLOGS "SDCARD Logs "
|
||||||
|
#else
|
||||||
|
#define TR_SDCLOGS "[SDCARD Logs]"
|
||||||
|
#endif
|
||||||
|
#if defined(SOMO)
|
||||||
|
#define TR_SOMO "Jouer fichier"
|
||||||
|
#else
|
||||||
|
#define TR_SOMO "[Jouer fich.]"
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define TR_SDCLOGS
|
||||||
|
#define TR_SOMO
|
||||||
#endif
|
#endif
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
#define TR_TEST "Test\0 "
|
#define TR_TEST "Test\0 "
|
||||||
#else
|
#else
|
||||||
#define TR_TEST
|
#define TR_TEST
|
||||||
#endif
|
#endif
|
||||||
#define TR_VFSWFUNC "Securite \0 ""Ecolage \0 ""Trim instant " TR_SOUND TR_HAPTIC TR_SOMO "Reset\0 " TR_VVARIO TR_SDCLOGGS TR_TEST
|
#define TR_VFSWFUNC "Securite \0 ""Ecolage \0 ""Trim instant " TR_SOUND TR_HAPTIC TR_SOMO "Reset\0 " TR_VVARIO TR_SDCLOGS TR_TEST
|
||||||
|
|
||||||
#define LEN_VFSWRESET "\006"
|
#define LEN_VFSWRESET "\006"
|
||||||
#define TR_VFSWRESET "Timer1""Timer2""All ""Telem."
|
#define TR_VFSWRESET "Timer1""Timer2""All ""Telem."
|
||||||
|
|
|
@ -50,12 +50,12 @@
|
||||||
#ifdef PXX
|
#ifdef PXX
|
||||||
#define TR_PXX "PXX\0 "
|
#define TR_PXX "PXX\0 "
|
||||||
#else
|
#else
|
||||||
#define TR_PXX
|
#define TR_PXX "[PXX]\0"
|
||||||
#endif
|
#endif
|
||||||
#ifdef DSM2
|
#ifdef DSM2
|
||||||
#define TR_DSM2 "DSM2\0 "
|
#define TR_DSM2 "DSM2\0 "
|
||||||
#else
|
#else
|
||||||
#define TR_DSM2
|
#define TR_DSM2 "[DSM2]"
|
||||||
#endif
|
#endif
|
||||||
#define TR_VPROTOS "PPM\0 ""PPM16\0""PPMsim" TR_PXX TR_DSM2
|
#define TR_VPROTOS "PPM\0 ""PPM16\0""PPMsim" TR_PXX TR_DSM2
|
||||||
|
|
||||||
|
@ -89,37 +89,42 @@
|
||||||
#define TR_VCSWFUNC "----\0 ""v>ofs ""v<ofs ""(v)>ofs""(v)<ofs""AND ""OR ""XOR ""v1==v2 ""v1!=v2 ""v1>v2 ""v1<v2 ""v1>=v2 ""v1<=v2 "
|
#define TR_VCSWFUNC "----\0 ""v>ofs ""v<ofs ""(v)>ofs""(v)<ofs""AND ""OR ""XOR ""v1==v2 ""v1!=v2 ""v1>v2 ""v1<v2 ""v1>=v2 ""v1<=v2 "
|
||||||
|
|
||||||
#define LEN_VFSWFUNC "\015"
|
#define LEN_VFSWFUNC "\015"
|
||||||
#if defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
|
#if defined(VARIO)
|
||||||
#define TR_VVARIO "Vario "
|
#define TR_VVARIO "Vario "
|
||||||
#else
|
#else
|
||||||
#define TR_VVARIO
|
#define TR_VVARIO "[Vario] "
|
||||||
#endif
|
#endif
|
||||||
#ifdef SDCARD
|
#if defined(AUDIO)
|
||||||
#define TR_SDCLOGGS "SDCARD Logs "
|
#define TR_SOUND "[Play Sound]\0"
|
||||||
#else
|
#else
|
||||||
#define TR_SDCLOGGS
|
#define TR_SOUND "Beep\0 "
|
||||||
#endif
|
#endif
|
||||||
#ifdef SOMO
|
#if defined(HAPTIC)
|
||||||
#define TR_SOMO "Spela Sp\200r\0 "
|
|
||||||
#else
|
|
||||||
#define TR_SOMO
|
|
||||||
#endif
|
|
||||||
#ifdef AUDIO
|
|
||||||
#define TR_SOUND "Spela Ljud\0 "
|
|
||||||
#else
|
|
||||||
#define TR_SOUND "Pip \0 "
|
|
||||||
#endif
|
|
||||||
#ifdef HAPTIC
|
|
||||||
#define TR_HAPTIC "Haptic\0 "
|
#define TR_HAPTIC "Haptic\0 "
|
||||||
#else
|
#else
|
||||||
#define TR_HAPTIC
|
#define TR_HAPTIC "[Haptic]\0 "
|
||||||
|
#endif
|
||||||
|
#if defined(PCBV4)
|
||||||
|
#if defined(SDCARD)
|
||||||
|
#define TR_SDCLOGS "SDCARD Logs "
|
||||||
|
#else
|
||||||
|
#define TR_SDCLOGS "[SDCARD Logs]"
|
||||||
|
#endif
|
||||||
|
#if defined(SOMO)
|
||||||
|
#define TR_SOMO "Spela Sp\200r\0 "
|
||||||
|
#else
|
||||||
|
#define TR_SOMO "[Spela Sp\200r]\0"
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define TR_SDCLOGS
|
||||||
|
#define TR_SOMO
|
||||||
#endif
|
#endif
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
#define TR_TEST "Test\0 "
|
#define TR_TEST "Test\0 "
|
||||||
#else
|
#else
|
||||||
#define TR_TEST
|
#define TR_TEST
|
||||||
#endif
|
#endif
|
||||||
#define TR_VFSWFUNC "S\201kerhet \0 ""Trainer \0 ""Instant Trim " TR_SOUND TR_HAPTIC TR_SOMO "Reset\0 " TR_VVARIO TR_SDCLOGGS TR_TEST
|
#define TR_VFSWFUNC "S\201kerhet \0 ""Trainer \0 ""Instant Trim " TR_SOUND TR_HAPTIC TR_SOMO "Reset\0 " TR_VVARIO TR_SDCLOGS TR_TEST
|
||||||
|
|
||||||
#define LEN_VFSWRESET "\006"
|
#define LEN_VFSWRESET "\006"
|
||||||
#define TR_VFSWRESET "Timer1""Timer2""All ""Telem."
|
#define TR_VFSWRESET "Timer1""Timer2""All ""Telem."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue