mirror of
https://github.com/opentx/opentx.git
synced 2025-07-21 15:25: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;
|
||||
case 1:
|
||||
{
|
||||
CHECK_INCDEC_MODELVAR(event, cs.v1, v1_min, v1_max);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
CHECK_INCDEC_MODELVAR(event, cs.v2, v2_min, v2_max);
|
||||
break;
|
||||
|
|
|
@ -100,34 +100,6 @@ enum BeeperMode {
|
|||
#define EXTRA_ARM_FIELDS
|
||||
#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
|
||||
PACK(typedef struct t_EEGeneral {
|
||||
uint8_t myVers;
|
||||
|
@ -173,8 +145,6 @@ PACK(typedef struct t_EEGeneral {
|
|||
|
||||
EXTRA_ARM_FIELDS
|
||||
|
||||
uint8_t fwOptions;
|
||||
|
||||
}) EEGeneral;
|
||||
|
||||
// eeprom modelspec
|
||||
|
@ -316,21 +286,17 @@ enum Functions {
|
|||
FUNC_TRAINER_AIL,
|
||||
FUNC_INSTANT_TRIM,
|
||||
FUNC_PLAY_SOUND,
|
||||
#ifdef HAPTIC
|
||||
FUNC_HAPTIC,
|
||||
#endif
|
||||
#ifdef SOMO
|
||||
#if defined(PCBV4)
|
||||
FUNC_PLAY_SOMO,
|
||||
#endif
|
||||
FUNC_RESET,
|
||||
#if defined(FRSKY)
|
||||
FUNC_VARIO,
|
||||
#endif
|
||||
#ifdef SDCARD
|
||||
#if defined(PCBV4)
|
||||
FUNC_LOGS,
|
||||
#endif
|
||||
#ifdef DEBUG
|
||||
FUNC_TEST,
|
||||
#if defined(DEBUG)
|
||||
FUNC_TEST, // should remain the last before MAX as not added in companion9x
|
||||
#endif
|
||||
FUNC_MAX
|
||||
};
|
||||
|
@ -408,7 +374,7 @@ enum TelemetrySource {
|
|||
};
|
||||
|
||||
enum VarioSource {
|
||||
VARIO_SOURCE_FIRST = 0,
|
||||
VARIO_SOURCE_FIRST = 0,
|
||||
VARIO_SOURCE_BARO_V1 = 0,
|
||||
VARIO_SOURCE_BARO_V2,
|
||||
VARIO_SOURCE_A1,
|
||||
|
@ -542,12 +508,8 @@ enum Protocols {
|
|||
PROTO_PPM,
|
||||
PROTO_PPM16,
|
||||
PROTO_PPMSIM,
|
||||
#if defined(PXX)
|
||||
PROTO_PXX,
|
||||
#endif
|
||||
#if defined(DSM2)
|
||||
PROTO_DSM2,
|
||||
#endif
|
||||
PROTO_MAX
|
||||
};
|
||||
|
||||
|
|
|
@ -135,7 +135,6 @@ void generalDefault()
|
|||
memset(&g_eeGeneral, 0, sizeof(g_eeGeneral));
|
||||
g_eeGeneral.lightSw = SWITCH_ON;
|
||||
g_eeGeneral.myVers = EEPROM_VER;
|
||||
g_eeGeneral.fwOptions = FW_OPTIONS;
|
||||
g_eeGeneral.contrast = 25;
|
||||
g_eeGeneral.vBatWarn = 90;
|
||||
for (int i = 0; i < 7; ++i) {
|
||||
|
|
|
@ -48,14 +48,14 @@
|
|||
|
||||
#define LEN_VPROTOS "\006"
|
||||
#ifdef PXX
|
||||
#define TR_PXX "PXX\0 "
|
||||
#define TR_PXX "PXX\0 "
|
||||
#else
|
||||
#define TR_PXX
|
||||
#define TR_PXX "[PXX]\0"
|
||||
#endif
|
||||
#ifdef DSM2
|
||||
#define TR_DSM2 "DSM2\0 "
|
||||
#else
|
||||
#define TR_DSM2
|
||||
#define TR_DSM2 "[DSM2]"
|
||||
#endif
|
||||
#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 LEN_VFSWFUNC "\015"
|
||||
#if defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
|
||||
#if defined(VARIO)
|
||||
#define TR_VVARIO "Vario "
|
||||
#else
|
||||
#define TR_VVARIO
|
||||
#define TR_VVARIO "[Vario] "
|
||||
#endif
|
||||
#ifdef SDCARD
|
||||
#define TR_SDCLOGGS "SDCARD Logs "
|
||||
#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 "
|
||||
#if defined(AUDIO)
|
||||
#define TR_SOUND "[Play Sound]\0"
|
||||
#else
|
||||
#define TR_SOUND "Beep\0 "
|
||||
#endif
|
||||
#ifdef HAPTIC
|
||||
#if defined(HAPTIC)
|
||||
#define TR_HAPTIC "Haptic\0 "
|
||||
#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
|
||||
#ifdef DEBUG
|
||||
#define TR_TEST "Test\0 "
|
||||
#else
|
||||
#define TR_TEST
|
||||
#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 TR_VFSWRESET "Timer1""Timer2""All ""Telem."
|
||||
|
|
|
@ -48,14 +48,14 @@
|
|||
|
||||
#define LEN_VPROTOS "\006"
|
||||
#ifdef PXX
|
||||
#define TR_PXX "PXX\0 "
|
||||
#define TR_PXX "PXX\0 "
|
||||
#else
|
||||
#define TR_PXX
|
||||
#define TR_PXX "[PXX]\0"
|
||||
#endif
|
||||
#ifdef DSM2
|
||||
#define TR_DSM2 "DSM2\0 "
|
||||
#else
|
||||
#define TR_DSM2
|
||||
#define TR_DSM2 "[DSM2]"
|
||||
#endif
|
||||
#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 LEN_VFSWFUNC "\015"
|
||||
#if defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
|
||||
#if defined(VARIO)
|
||||
#define TR_VVARIO "Vario "
|
||||
#else
|
||||
#define TR_VVARIO
|
||||
#define TR_VVARIO "[Vario] "
|
||||
#endif
|
||||
#ifdef SDCARD
|
||||
#define TR_SDCLOGGS "SDCARD Logs "
|
||||
#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 "
|
||||
#if defined(AUDIO)
|
||||
#define TR_SOUND "[Play Sound]\0"
|
||||
#else
|
||||
#define TR_SOUND "Beep\0 "
|
||||
#endif
|
||||
#ifdef HAPTIC
|
||||
#if defined(HAPTIC)
|
||||
#define TR_HAPTIC "Haptic\0 "
|
||||
#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
|
||||
#ifdef DEBUG
|
||||
#define TR_TEST "Test\0 "
|
||||
#else
|
||||
#define TR_TEST
|
||||
#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 TR_VFSWRESET "Timer1""Timer2""All ""Telem."
|
||||
|
|
|
@ -48,14 +48,14 @@
|
|||
|
||||
#define LEN_VPROTOS "\006"
|
||||
#ifdef PXX
|
||||
#define TR_PXX "PXX\0 "
|
||||
#define TR_PXX "PXX\0 "
|
||||
#else
|
||||
#define TR_PXX
|
||||
#define TR_PXX "[PXX]\0"
|
||||
#endif
|
||||
#ifdef DSM2
|
||||
#define TR_DSM2 "DSM2\0 "
|
||||
#else
|
||||
#define TR_DSM2
|
||||
#define TR_DSM2 "[DSM2]"
|
||||
#endif
|
||||
#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 LEN_VFSWFUNC "\015"
|
||||
#if defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
|
||||
#if defined(VARIO)
|
||||
#define TR_VVARIO "Vario "
|
||||
#else
|
||||
#define TR_VVARIO
|
||||
#define TR_VVARIO "[Vario] "
|
||||
#endif
|
||||
#ifdef SDCARD
|
||||
#define TR_SDCLOGGS "SDCARD Logs "
|
||||
#if defined(AUDIO)
|
||||
#define TR_SOUND "[Play Sound]\0"
|
||||
#else
|
||||
#define TR_SDCLOGGS
|
||||
#define TR_SOUND "Beep\0 "
|
||||
#endif
|
||||
#ifdef SOMO
|
||||
#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
|
||||
#if defined(HAPTIC)
|
||||
#define TR_HAPTIC "Haptic\0 "
|
||||
#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
|
||||
#ifdef DEBUG
|
||||
#define TR_TEST "Test\0 "
|
||||
#else
|
||||
#define TR_TEST
|
||||
#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 TR_VFSWRESET "Timer1""Timer2""All ""Telem."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue