feat(radio): increase length of sound/script file name to 8 for SF/GF (#5046)

This commit is contained in:
philmoz
2024-06-06 20:08:37 +10:00
committed by GitHub
parent 97f9884639
commit 253783df6a
13 changed files with 58 additions and 63 deletions
@@ -589,7 +589,7 @@ int OpenTxFirmware::getCapability(::Capability capability)
case VoicesAsNumbers:
return 0;
case VoicesMaxLength:
return (IS_TARANIS_X9(board) ? 8 : 6);
return 8;
case MultiLangVoice:
return 1;
case SoundPitch:
+2 -2
View File
@@ -106,7 +106,7 @@ enum CurveType {
#define LEN_CHANNEL_NAME 6
#define LEN_INPUT_NAME 4
#define LEN_CURVE_NAME 3
#define LEN_FUNCTION_NAME 6
#define LEN_FUNCTION_NAME 8
#define MAX_CURVES 32
#define MAX_CURVE_POINTS 512
#elif LCD_W == 212
@@ -130,7 +130,7 @@ enum CurveType {
#define LEN_CHANNEL_NAME 4
#define LEN_INPUT_NAME 3
#define LEN_CURVE_NAME 3
#define LEN_FUNCTION_NAME 6
#define LEN_FUNCTION_NAME 8
#define MAX_CURVES 32
#define MAX_CURVE_POINTS 512
#endif
+7 -7
View File
@@ -79,7 +79,7 @@ static inline void check_struct()
CHKSIZE(MixData, 20);
CHKSIZE(ExpoData, 17);
CHKSIZE(LimitData, 13);
CHKSIZE(CustomFunctionData, 9);
CHKSIZE(CustomFunctionData, 11);
CHKSIZE(FlightModeData, 44);
CHKSIZE(TimerData, 17);
CHKSIZE(SwashRingData, 8);
@@ -154,15 +154,15 @@ static inline void check_struct()
CHKSIZE(ModelData, 6706);
#elif defined(PCBHORUS)
#if defined(PCBX10)
CHKSIZE(RadioData, 837);
CHKSIZE(ModelData, 15607);
CHKSIZE(RadioData, 965);
CHKSIZE(ModelData, 15735);
#else
CHKSIZE(RadioData, 837);
CHKSIZE(ModelData, 15607);
CHKSIZE(RadioData, 965);
CHKSIZE(ModelData, 15735);
#endif
#elif defined(PCBNV14)
CHKSIZE(RadioData, 837);
CHKSIZE(ModelData, 15463);
CHKSIZE(RadioData, 965);
CHKSIZE(ModelData, 15591);
#endif
#undef CHKSIZE
+2 -9
View File
@@ -146,13 +146,6 @@ PACK(struct LogicalSwitchData {
* SpecialFunction structure
*/
#if defined(PCBTARANIS)
#define CFN_SPARE_TYPE int32_t
#else
#define CFN_SPARE_TYPE int16_t
#endif
PACK(struct CustomFunctionData {
int16_t swtch:10 CUST(r_swtchSrc,w_swtchSrc);
uint16_t func:6 ENUM(Functions); // TODO: 6 bits for Functions?
@@ -166,12 +159,12 @@ PACK(struct CustomFunctionData {
int16_t val;
uint8_t mode;
uint8_t param;
NOBACKUP(CFN_SPARE_TYPE spare);
NOBACKUP(int32_t spare);
}) all;
NOBACKUP(PACK(struct {
int32_t val1;
NOBACKUP(CFN_SPARE_TYPE val2);
NOBACKUP(int32_t val2);
}) clear);
}) NAME(fp) SKIP;
uint8_t active : 1 SKIP;
@@ -313,6 +313,8 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
if (func == FUNC_PLAY_SCRIPT)
x = x - 5 * FW;
else if (func == FUNC_PLAY_TRACK)
x = x - 3 * FW;
else if (func == FUNC_BACKGND_MUSIC)
x = x - 2 * FW;
if (ZEXIST(cfn->play.name))
lcdDrawSizedText(x, y, cfn->play.name, sizeof(cfn->play.name), attr);
@@ -230,7 +230,7 @@ static const struct YamlNode struct_TrainerData[] = {
YAML_END
};
static const struct YamlNode struct_anonymous_1[] = {
YAML_STRING("name", 6),
YAML_STRING("name", 8),
YAML_END
};
static const struct YamlNode struct_anonymous_2[] = {
@@ -246,7 +246,7 @@ static const struct YamlNode struct_anonymous_3[] = {
YAML_END
};
static const struct YamlNode union_anonymous_0_elmts[] = {
YAML_STRUCT("play", 48, struct_anonymous_1, NULL),
YAML_STRUCT("play", 64, struct_anonymous_1, NULL),
YAML_STRUCT("all", 64, struct_anonymous_2, NULL),
YAML_STRUCT("clear", 64, struct_anonymous_3, NULL),
YAML_END
@@ -248,25 +248,25 @@ static const struct YamlNode struct_TrainerData[] = {
YAML_END
};
static const struct YamlNode struct_anonymous_1[] = {
YAML_STRING("name", 6),
YAML_STRING("name", 8),
YAML_END
};
static const struct YamlNode struct_anonymous_2[] = {
YAML_SIGNED( "val", 16 ),
YAML_UNSIGNED( "mode", 8 ),
YAML_UNSIGNED( "param", 8 ),
YAML_SIGNED( "spare", 16 ),
YAML_SIGNED( "spare", 32 ),
YAML_END
};
static const struct YamlNode struct_anonymous_3[] = {
YAML_SIGNED( "val1", 32 ),
YAML_SIGNED( "val2", 16 ),
YAML_SIGNED( "val2", 32 ),
YAML_END
};
static const struct YamlNode union_anonymous_0_elmts[] = {
YAML_STRUCT("play", 48, struct_anonymous_1, NULL),
YAML_STRUCT("all", 48, struct_anonymous_2, NULL),
YAML_STRUCT("clear", 48, struct_anonymous_3, NULL),
YAML_STRUCT("play", 64, struct_anonymous_1, NULL),
YAML_STRUCT("all", 64, struct_anonymous_2, NULL),
YAML_STRUCT("clear", 64, struct_anonymous_3, NULL),
YAML_END
};
static const struct YamlNode struct_CustomFunctionData[] = {
@@ -274,7 +274,7 @@ static const struct YamlNode struct_CustomFunctionData[] = {
YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ),
YAML_ENUM("func", 6, enum_Functions),
YAML_CUSTOM("def",r_customFn,w_customFn),
YAML_PADDING( 48 ),
YAML_PADDING( 64 ),
YAML_PADDING( 1 ),
YAML_PADDING( 7 ),
YAML_END
@@ -349,7 +349,7 @@ static const struct YamlNode struct_RadioData[] = {
YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ),
YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ),
YAML_SIGNED( "varioRepeat", 8 ),
YAML_ARRAY("customFn", 72, 64, struct_CustomFunctionData, cfn_is_active),
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
YAML_CUSTOM("auxSerialMode",r_serialMode,nullptr),
YAML_CUSTOM("aux2SerialMode",r_serialMode,nullptr),
YAML_ARRAY("serialPort", 8, 4, struct_serialConfig, nullptr),
@@ -834,7 +834,7 @@ static const struct YamlNode struct_ModelData[] = {
YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL),
YAML_ARRAY("points", 8, 512, struct_signed_8, NULL),
YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL),
YAML_ARRAY("customFn", 72, 64, struct_CustomFunctionData, cfn_is_active),
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active),
YAML_ARRAY("flightModeData", 352, 9, struct_FlightModeData, fmd_is_active),
YAML_UNSIGNED_CUST( "thrTraceSrc", 8, r_thrSrc, w_thrSrc ),
@@ -248,25 +248,25 @@ static const struct YamlNode struct_TrainerData[] = {
YAML_END
};
static const struct YamlNode struct_anonymous_1[] = {
YAML_STRING("name", 6),
YAML_STRING("name", 8),
YAML_END
};
static const struct YamlNode struct_anonymous_2[] = {
YAML_SIGNED( "val", 16 ),
YAML_UNSIGNED( "mode", 8 ),
YAML_UNSIGNED( "param", 8 ),
YAML_SIGNED( "spare", 16 ),
YAML_SIGNED( "spare", 32 ),
YAML_END
};
static const struct YamlNode struct_anonymous_3[] = {
YAML_SIGNED( "val1", 32 ),
YAML_SIGNED( "val2", 16 ),
YAML_SIGNED( "val2", 32 ),
YAML_END
};
static const struct YamlNode union_anonymous_0_elmts[] = {
YAML_STRUCT("play", 48, struct_anonymous_1, NULL),
YAML_STRUCT("all", 48, struct_anonymous_2, NULL),
YAML_STRUCT("clear", 48, struct_anonymous_3, NULL),
YAML_STRUCT("play", 64, struct_anonymous_1, NULL),
YAML_STRUCT("all", 64, struct_anonymous_2, NULL),
YAML_STRUCT("clear", 64, struct_anonymous_3, NULL),
YAML_END
};
static const struct YamlNode struct_CustomFunctionData[] = {
@@ -274,7 +274,7 @@ static const struct YamlNode struct_CustomFunctionData[] = {
YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ),
YAML_ENUM("func", 6, enum_Functions),
YAML_CUSTOM("def",r_customFn,w_customFn),
YAML_PADDING( 48 ),
YAML_PADDING( 64 ),
YAML_PADDING( 1 ),
YAML_PADDING( 7 ),
YAML_END
@@ -349,7 +349,7 @@ static const struct YamlNode struct_RadioData[] = {
YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ),
YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ),
YAML_SIGNED( "varioRepeat", 8 ),
YAML_ARRAY("customFn", 72, 64, struct_CustomFunctionData, cfn_is_active),
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
YAML_CUSTOM("auxSerialMode",r_serialMode,nullptr),
YAML_CUSTOM("aux2SerialMode",r_serialMode,nullptr),
YAML_ARRAY("serialPort", 8, 4, struct_serialConfig, nullptr),
@@ -834,7 +834,7 @@ static const struct YamlNode struct_ModelData[] = {
YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL),
YAML_ARRAY("points", 8, 512, struct_signed_8, NULL),
YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL),
YAML_ARRAY("customFn", 72, 64, struct_CustomFunctionData, cfn_is_active),
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active),
YAML_ARRAY("flightModeData", 384, 9, struct_FlightModeData, fmd_is_active),
YAML_UNSIGNED_CUST( "thrTraceSrc", 8, r_thrSrc, w_thrSrc ),
@@ -230,7 +230,7 @@ static const struct YamlNode struct_TrainerData[] = {
YAML_END
};
static const struct YamlNode struct_anonymous_1[] = {
YAML_STRING("name", 6),
YAML_STRING("name", 8),
YAML_END
};
static const struct YamlNode struct_anonymous_2[] = {
@@ -246,7 +246,7 @@ static const struct YamlNode struct_anonymous_3[] = {
YAML_END
};
static const struct YamlNode union_anonymous_0_elmts[] = {
YAML_STRUCT("play", 48, struct_anonymous_1, NULL),
YAML_STRUCT("play", 64, struct_anonymous_1, NULL),
YAML_STRUCT("all", 64, struct_anonymous_2, NULL),
YAML_STRUCT("clear", 64, struct_anonymous_3, NULL),
YAML_END
@@ -230,7 +230,7 @@ static const struct YamlNode struct_TrainerData[] = {
YAML_END
};
static const struct YamlNode struct_anonymous_1[] = {
YAML_STRING("name", 6),
YAML_STRING("name", 8),
YAML_END
};
static const struct YamlNode struct_anonymous_2[] = {
@@ -246,7 +246,7 @@ static const struct YamlNode struct_anonymous_3[] = {
YAML_END
};
static const struct YamlNode union_anonymous_0_elmts[] = {
YAML_STRUCT("play", 48, struct_anonymous_1, NULL),
YAML_STRUCT("play", 64, struct_anonymous_1, NULL),
YAML_STRUCT("all", 64, struct_anonymous_2, NULL),
YAML_STRUCT("clear", 64, struct_anonymous_3, NULL),
YAML_END
@@ -249,25 +249,25 @@ static const struct YamlNode struct_TrainerData[] = {
YAML_END
};
static const struct YamlNode struct_anonymous_1[] = {
YAML_STRING("name", 6),
YAML_STRING("name", 8),
YAML_END
};
static const struct YamlNode struct_anonymous_2[] = {
YAML_SIGNED( "val", 16 ),
YAML_UNSIGNED( "mode", 8 ),
YAML_UNSIGNED( "param", 8 ),
YAML_SIGNED( "spare", 16 ),
YAML_SIGNED( "spare", 32 ),
YAML_END
};
static const struct YamlNode struct_anonymous_3[] = {
YAML_SIGNED( "val1", 32 ),
YAML_SIGNED( "val2", 16 ),
YAML_SIGNED( "val2", 32 ),
YAML_END
};
static const struct YamlNode union_anonymous_0_elmts[] = {
YAML_STRUCT("play", 48, struct_anonymous_1, NULL),
YAML_STRUCT("all", 48, struct_anonymous_2, NULL),
YAML_STRUCT("clear", 48, struct_anonymous_3, NULL),
YAML_STRUCT("play", 64, struct_anonymous_1, NULL),
YAML_STRUCT("all", 64, struct_anonymous_2, NULL),
YAML_STRUCT("clear", 64, struct_anonymous_3, NULL),
YAML_END
};
static const struct YamlNode struct_CustomFunctionData[] = {
@@ -275,7 +275,7 @@ static const struct YamlNode struct_CustomFunctionData[] = {
YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ),
YAML_ENUM("func", 6, enum_Functions),
YAML_CUSTOM("def",r_customFn,w_customFn),
YAML_PADDING( 48 ),
YAML_PADDING( 64 ),
YAML_PADDING( 1 ),
YAML_PADDING( 7 ),
YAML_END
@@ -348,7 +348,7 @@ static const struct YamlNode struct_RadioData[] = {
YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ),
YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ),
YAML_SIGNED( "varioRepeat", 8 ),
YAML_ARRAY("customFn", 72, 64, struct_CustomFunctionData, cfn_is_active),
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
YAML_CUSTOM("auxSerialMode",r_serialMode,nullptr),
YAML_CUSTOM("aux2SerialMode",r_serialMode,nullptr),
YAML_ARRAY("serialPort", 8, 4, struct_serialConfig, nullptr),
@@ -835,7 +835,7 @@ static const struct YamlNode struct_ModelData[] = {
YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL),
YAML_ARRAY("points", 8, 512, struct_signed_8, NULL),
YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL),
YAML_ARRAY("customFn", 72, 64, struct_CustomFunctionData, cfn_is_active),
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active),
YAML_ARRAY("flightModeData", 352, 9, struct_FlightModeData, fmd_is_active),
YAML_UNSIGNED_CUST( "thrTraceSrc", 8, r_thrSrc, w_thrSrc ),
@@ -249,25 +249,25 @@ static const struct YamlNode struct_TrainerData[] = {
YAML_END
};
static const struct YamlNode struct_anonymous_1[] = {
YAML_STRING("name", 6),
YAML_STRING("name", 8),
YAML_END
};
static const struct YamlNode struct_anonymous_2[] = {
YAML_SIGNED( "val", 16 ),
YAML_UNSIGNED( "mode", 8 ),
YAML_UNSIGNED( "param", 8 ),
YAML_SIGNED( "spare", 16 ),
YAML_SIGNED( "spare", 32 ),
YAML_END
};
static const struct YamlNode struct_anonymous_3[] = {
YAML_SIGNED( "val1", 32 ),
YAML_SIGNED( "val2", 16 ),
YAML_SIGNED( "val2", 32 ),
YAML_END
};
static const struct YamlNode union_anonymous_0_elmts[] = {
YAML_STRUCT("play", 48, struct_anonymous_1, NULL),
YAML_STRUCT("all", 48, struct_anonymous_2, NULL),
YAML_STRUCT("clear", 48, struct_anonymous_3, NULL),
YAML_STRUCT("play", 64, struct_anonymous_1, NULL),
YAML_STRUCT("all", 64, struct_anonymous_2, NULL),
YAML_STRUCT("clear", 64, struct_anonymous_3, NULL),
YAML_END
};
static const struct YamlNode struct_CustomFunctionData[] = {
@@ -275,7 +275,7 @@ static const struct YamlNode struct_CustomFunctionData[] = {
YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ),
YAML_ENUM("func", 6, enum_Functions),
YAML_CUSTOM("def",r_customFn,w_customFn),
YAML_PADDING( 48 ),
YAML_PADDING( 64 ),
YAML_PADDING( 1 ),
YAML_PADDING( 7 ),
YAML_END
@@ -348,7 +348,7 @@ static const struct YamlNode struct_RadioData[] = {
YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ),
YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ),
YAML_SIGNED( "varioRepeat", 8 ),
YAML_ARRAY("customFn", 72, 64, struct_CustomFunctionData, cfn_is_active),
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
YAML_CUSTOM("auxSerialMode",r_serialMode,nullptr),
YAML_CUSTOM("aux2SerialMode",r_serialMode,nullptr),
YAML_ARRAY("serialPort", 8, 4, struct_serialConfig, nullptr),
@@ -835,7 +835,7 @@ static const struct YamlNode struct_ModelData[] = {
YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL),
YAML_ARRAY("points", 8, 512, struct_signed_8, NULL),
YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL),
YAML_ARRAY("customFn", 72, 64, struct_CustomFunctionData, cfn_is_active),
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active),
YAML_ARRAY("flightModeData", 352, 9, struct_FlightModeData, fmd_is_active),
YAML_UNSIGNED_CUST( "thrTraceSrc", 8, r_thrSrc, w_thrSrc ),
@@ -232,7 +232,7 @@ static const struct YamlNode struct_TrainerData[] = {
YAML_END
};
static const struct YamlNode struct_anonymous_1[] = {
YAML_STRING("name", 6),
YAML_STRING("name", 8),
YAML_END
};
static const struct YamlNode struct_anonymous_2[] = {
@@ -248,7 +248,7 @@ static const struct YamlNode struct_anonymous_3[] = {
YAML_END
};
static const struct YamlNode union_anonymous_0_elmts[] = {
YAML_STRUCT("play", 48, struct_anonymous_1, NULL),
YAML_STRUCT("play", 64, struct_anonymous_1, NULL),
YAML_STRUCT("all", 64, struct_anonymous_2, NULL),
YAML_STRUCT("clear", 64, struct_anonymous_3, NULL),
YAML_END