Skip to content

Commit

Permalink
feat(radio): increase length of sound/script file name to 8 for SF/GF (
Browse files Browse the repository at this point in the history
  • Loading branch information
philmoz authored Jun 6, 2024
1 parent 97f9884 commit 253783d
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 63 deletions.
2 changes: 1 addition & 1 deletion companion/src/firmwares/opentx/opentxinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions radio/src/dataconstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
14 changes: 7 additions & 7 deletions radio/src/datastructs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down
11 changes: 2 additions & 9 deletions radio/src/datastructs_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand All @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions radio/src/gui/128x64/model_special_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions radio/src/storage/yaml/yaml_datastructs_128x64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = {
Expand All @@ -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
Expand Down
18 changes: 9 additions & 9 deletions radio/src/storage/yaml/yaml_datastructs_nv14.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,33 +248,33 @@ 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[] = {
YAML_IDX,
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
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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 ),
Expand Down
18 changes: 9 additions & 9 deletions radio/src/storage/yaml/yaml_datastructs_pl18.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,33 +248,33 @@ 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[] = {
YAML_IDX,
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
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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 ),
Expand Down
4 changes: 2 additions & 2 deletions radio/src/storage/yaml/yaml_datastructs_t20.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = {
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions radio/src/storage/yaml/yaml_datastructs_tpro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = {
Expand All @@ -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
Expand Down
18 changes: 9 additions & 9 deletions radio/src/storage/yaml/yaml_datastructs_x10.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,33 +249,33 @@ 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[] = {
YAML_IDX,
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
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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 ),
Expand Down
18 changes: 9 additions & 9 deletions radio/src/storage/yaml/yaml_datastructs_x12s.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,33 +249,33 @@ 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[] = {
YAML_IDX,
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
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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 ),
Expand Down
Loading

0 comments on commit 253783d

Please sign in to comment.