Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions companion/src/firmwares/edgetx/yaml_moduledata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,13 @@ static const YamlLookupTable moduleAntennaModeLut = {
{ GeneralSettings::ANTENNA_MODE_EXTERNAL, "MODE_EXTERNAL" },
};

// Firmware built before the field was made unconditional emitted antennaMode on
// boards without an external antenna, where it aliased the top bits of subType.
static bool hasModuleAntennaMode()
{
return Boards::getCapability(getCurrentBoard(), Board::HasExternalAntenna);
}

static int exportPpmDelay(int delay) { return (delay - 300) / 50; }
static int importPpmDelay(int delay) { return 300 + 50 * delay; }

Expand Down Expand Up @@ -204,7 +211,7 @@ Node convert<ModuleData>::encode(const ModuleData& rhs)
node["channelsStart"] = rhs.channelsStart;
node["channelsCount"] = rhs.channelsCount;
node["failsafeMode"] = LookupValue(failsafeLut, rhs.failsafeMode);
if (rhs.antennaMode)
if (rhs.antennaMode && hasModuleAntennaMode())
node["antennaMode"] = LookupValue(moduleAntennaModeLut, rhs.antennaMode);

Node mod;
Expand Down Expand Up @@ -370,7 +377,7 @@ bool convert<ModuleData>::decode(const Node& node, ModuleData& rhs)
node["channelsStart"] >> rhs.channelsStart;
node["channelsCount"] >> rhs.channelsCount;
node["failsafeMode"] >> failsafeLut >> rhs.failsafeMode;
if (node["antennaMode"])
if (node["antennaMode"] && hasModuleAntennaMode())
node["antennaMode"] >> moduleAntennaModeLut >> rhs.antennaMode;

if (node["mod"]) {
Expand All @@ -397,7 +404,7 @@ bool convert<ModuleData>::decode(const Node& node, ModuleData& rhs)
// pxx["receiverTelemetryOff"] >> rhs.pxx.receiverTelemetryOff;
// pxx["receiverHigherChannels"] >> rhs.pxx.receiverHigherChannels;
// Migration: legacy raw-int antennaMode, only if not already set
if (!node["antennaMode"] && pxx["antennaMode"]) {
if (!node["antennaMode"] && pxx["antennaMode"] && hasModuleAntennaMode()) {
pxx["antennaMode"] >> rhs.antennaMode;
}
} else if (mod["sbus"]) {
Expand Down
52 changes: 52 additions & 0 deletions companion/src/tests/model_yaml_roundtrip_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

#include "firmwares/eeprominterface.h"
#include "firmwares/edgetx/edgetxinterface.h"
#include "firmwares/edgetx/yaml_moduledata.h"

namespace {

Expand Down Expand Up @@ -124,3 +125,54 @@ TEST_F(ModelYamlRoundTrip, OverlongNameTruncatesAndRoundTrips)
ModelData m3 = roundTrip(m2, y2);
EXPECT_EQ(m2.name.str(), m3.name.str());
}

// A module written by a radio that emitted antennaMode must decode. The field is
// a string enum firmware side; read as a raw int, yaml-cpp throws
// TypedBadConversion and the whole model fails to open.
TEST_F(ModelYamlRoundTrip, RadioWrittenAntennaModeDecodes)
{
YAML::Node node = YAML::Load(
"type: TYPE_MULTIMODULE\n"
"subType: 6,7\n"
"channelsStart: 0\n"
"channelsCount: 16\n"
"failsafeMode: NOT_SET\n"
"antennaMode: MODE_PER_MODEL\n");

ModuleData md;
bool threw = false;
std::string err;
try {
node >> md;
} catch (const std::exception& e) {
threw = true;
err = e.what();
} catch (...) {
threw = true;
err = "non-std exception";
}

ASSERT_FALSE(threw) << "decoding threw: " << err;
EXPECT_EQ(md.subType, 7u) << "subType lost alongside antennaMode";
}

// The fixture selects tx16s, which has no external antenna. Such radios parse
// antennaMode over the top two bits of subType, so writing the key back would
// change the sub-protocol on load.
TEST_F(ModelYamlRoundTrip, AntennaModeNotWrittenWithoutExternalAntenna)
{
ASSERT_FALSE(Boards::getCapability(getCurrentBoard(), Board::HasExternalAntenna))
<< "fixture board is expected to have no external antenna";

ModelData m;
m.clear();
m.used = true;
// only modules with a protocol are serialised at all
m.moduleData[1].protocol = PULSES_MULTIMODULE;
m.moduleData[1].antennaMode = GeneralSettings::ANTENNA_MODE_EXTERNAL;

QByteArray y;
writeModelToYaml(m, y);
ASSERT_TRUE(y.contains("moduleData")) << "module was not serialised";
EXPECT_FALSE(y.contains("antennaMode"));
}
14 changes: 6 additions & 8 deletions radio/src/datastructs_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ PACK(struct TimerData {
uint32_t minuteBeep:1;
uint32_t persistent:2;
int32_t countdownStart:2;
uint8_t showElapsed:1;
uint8_t showElapsed:1;
uint8_t extraHaptic:1;
uint8_t spare:6 SKIP;
NOBACKUP(char name[LEN_TIMER_NAME]);
Expand Down Expand Up @@ -499,17 +499,15 @@ PACK(struct PpmModule {
});

PACK(struct ModuleData {
uint8_t type ENUM(ModuleType) CUST(r_moduleType, w_moduleType);
// antennaMode stays unconditional as boards differing on EXTERNAL_ANTENNA share
// generated YAML descriptors.
uint8_t type:6 ENUM(ModuleType) CUST(r_moduleType, w_moduleType);
int8_t antennaMode:2 ENUM(AntennaModes);
CUST_ATTR(subType,r_modSubtype,w_modSubtype);
uint8_t channelsStart;
int8_t channelsCount CUST(r_channelsCount,w_channelsCount); // 0=8 channels
uint8_t failsafeMode:4 ENUM(FailsafeModes); // only 3 bits used
#if defined(EXTERNAL_ANTENNA)
uint8_t subType:2 SKIP;
int8_t antennaMode:2 ENUM(AntennaModes);
#else
uint8_t subType:4 SKIP;
#endif

union {
uint8_t raw[PXX2_MAX_RECEIVERS_PER_MODULE * PXX2_LEN_RX_NAME + 1];
Expand Down Expand Up @@ -888,7 +886,7 @@ PACK(struct ModelData {
NOBACKUP(uint8_t usbJoystickIfMode:3 ENUM(USBJoystickIfMode));
NOBACKUP(uint8_t usbJoystickCircularCut:4);
NOBACKUP(USBJoystickChData usbJoystickCh[USBJ_MAX_JOYSTICK_CHANNELS]);

// Radio level tabs control (model settings)
#if defined(COLORLCD)
uint8_t radioThemesDisabled:2 ENUM(ModelOverridableEnable);
Expand Down
3 changes: 2 additions & 1 deletion radio/src/storage/yaml/yaml_datastructs_128x64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,8 @@ static const struct YamlNode union_anonymous_4_elmts[] = {
};
static const struct YamlNode struct_ModuleData[] = {
YAML_IDX,
YAML_UNSIGNED_CUST( "type", 8, r_moduleType, w_moduleType ),
YAML_UNSIGNED_CUST( "type", 6, r_moduleType, w_moduleType ),
YAML_ENUM("antennaMode", 2, enum_AntennaModes, NULL),
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
YAML_UNSIGNED( "channelsStart", 8 ),
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
Expand Down
3 changes: 2 additions & 1 deletion radio/src/storage/yaml/yaml_datastructs_c14.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,8 @@ static const struct YamlNode union_anonymous_4_elmts[] = {
};
static const struct YamlNode struct_ModuleData[] = {
YAML_IDX,
YAML_UNSIGNED_CUST( "type", 8, r_moduleType, w_moduleType ),
YAML_UNSIGNED_CUST( "type", 6, r_moduleType, w_moduleType ),
YAML_ENUM("antennaMode", 2, enum_AntennaModes, NULL),
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
YAML_UNSIGNED( "channelsStart", 8 ),
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
Expand Down
3 changes: 2 additions & 1 deletion radio/src/storage/yaml/yaml_datastructs_f16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,8 @@ static const struct YamlNode union_anonymous_4_elmts[] = {
};
static const struct YamlNode struct_ModuleData[] = {
YAML_IDX,
YAML_UNSIGNED_CUST( "type", 8, r_moduleType, w_moduleType ),
YAML_UNSIGNED_CUST( "type", 6, r_moduleType, w_moduleType ),
YAML_ENUM("antennaMode", 2, enum_AntennaModes, NULL),
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
YAML_UNSIGNED( "channelsStart", 8 ),
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
Expand Down
3 changes: 2 additions & 1 deletion radio/src/storage/yaml/yaml_datastructs_gx12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,8 @@ static const struct YamlNode union_anonymous_4_elmts[] = {
};
static const struct YamlNode struct_ModuleData[] = {
YAML_IDX,
YAML_UNSIGNED_CUST( "type", 8, r_moduleType, w_moduleType ),
YAML_UNSIGNED_CUST( "type", 6, r_moduleType, w_moduleType ),
YAML_ENUM("antennaMode", 2, enum_AntennaModes, NULL),
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
YAML_UNSIGNED( "channelsStart", 8 ),
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
Expand Down
3 changes: 2 additions & 1 deletion radio/src/storage/yaml/yaml_datastructs_gx15.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,8 @@ static const struct YamlNode union_anonymous_4_elmts[] = {
};
static const struct YamlNode struct_ModuleData[] = {
YAML_IDX,
YAML_UNSIGNED_CUST( "type", 8, r_moduleType, w_moduleType ),
YAML_UNSIGNED_CUST( "type", 6, r_moduleType, w_moduleType ),
YAML_ENUM("antennaMode", 2, enum_AntennaModes, NULL),
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
YAML_UNSIGNED( "channelsStart", 8 ),
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
Expand Down
3 changes: 2 additions & 1 deletion radio/src/storage/yaml/yaml_datastructs_nb4p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,8 @@ static const struct YamlNode union_anonymous_4_elmts[] = {
};
static const struct YamlNode struct_ModuleData[] = {
YAML_IDX,
YAML_UNSIGNED_CUST( "type", 8, r_moduleType, w_moduleType ),
YAML_UNSIGNED_CUST( "type", 6, r_moduleType, w_moduleType ),
YAML_ENUM("antennaMode", 2, enum_AntennaModes, NULL),
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
YAML_UNSIGNED( "channelsStart", 8 ),
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
Expand Down
3 changes: 2 additions & 1 deletion radio/src/storage/yaml/yaml_datastructs_nv14.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,8 @@ static const struct YamlNode union_anonymous_4_elmts[] = {
};
static const struct YamlNode struct_ModuleData[] = {
YAML_IDX,
YAML_UNSIGNED_CUST( "type", 8, r_moduleType, w_moduleType ),
YAML_UNSIGNED_CUST( "type", 6, r_moduleType, w_moduleType ),
YAML_ENUM("antennaMode", 2, enum_AntennaModes, NULL),
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
YAML_UNSIGNED( "channelsStart", 8 ),
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
Expand Down
3 changes: 2 additions & 1 deletion radio/src/storage/yaml/yaml_datastructs_pa01.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,8 @@ static const struct YamlNode union_anonymous_4_elmts[] = {
};
static const struct YamlNode struct_ModuleData[] = {
YAML_IDX,
YAML_UNSIGNED_CUST( "type", 8, r_moduleType, w_moduleType ),
YAML_UNSIGNED_CUST( "type", 6, r_moduleType, w_moduleType ),
YAML_ENUM("antennaMode", 2, enum_AntennaModes, NULL),
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
YAML_UNSIGNED( "channelsStart", 8 ),
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
Expand Down
3 changes: 2 additions & 1 deletion radio/src/storage/yaml/yaml_datastructs_pl18.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,8 @@ static const struct YamlNode union_anonymous_4_elmts[] = {
};
static const struct YamlNode struct_ModuleData[] = {
YAML_IDX,
YAML_UNSIGNED_CUST( "type", 8, r_moduleType, w_moduleType ),
YAML_UNSIGNED_CUST( "type", 6, r_moduleType, w_moduleType ),
YAML_ENUM("antennaMode", 2, enum_AntennaModes, NULL),
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
YAML_UNSIGNED( "channelsStart", 8 ),
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
Expand Down
3 changes: 2 additions & 1 deletion radio/src/storage/yaml/yaml_datastructs_pl18u.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,8 @@ static const struct YamlNode union_anonymous_4_elmts[] = {
};
static const struct YamlNode struct_ModuleData[] = {
YAML_IDX,
YAML_UNSIGNED_CUST( "type", 8, r_moduleType, w_moduleType ),
YAML_UNSIGNED_CUST( "type", 6, r_moduleType, w_moduleType ),
YAML_ENUM("antennaMode", 2, enum_AntennaModes, NULL),
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
YAML_UNSIGNED( "channelsStart", 8 ),
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
Expand Down
3 changes: 2 additions & 1 deletion radio/src/storage/yaml/yaml_datastructs_st16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,8 @@ static const struct YamlNode union_anonymous_4_elmts[] = {
};
static const struct YamlNode struct_ModuleData[] = {
YAML_IDX,
YAML_UNSIGNED_CUST( "type", 8, r_moduleType, w_moduleType ),
YAML_UNSIGNED_CUST( "type", 6, r_moduleType, w_moduleType ),
YAML_ENUM("antennaMode", 2, enum_AntennaModes, NULL),
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
YAML_UNSIGNED( "channelsStart", 8 ),
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
Expand Down
3 changes: 2 additions & 1 deletion radio/src/storage/yaml/yaml_datastructs_t15.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,8 @@ static const struct YamlNode union_anonymous_4_elmts[] = {
};
static const struct YamlNode struct_ModuleData[] = {
YAML_IDX,
YAML_UNSIGNED_CUST( "type", 8, r_moduleType, w_moduleType ),
YAML_UNSIGNED_CUST( "type", 6, r_moduleType, w_moduleType ),
YAML_ENUM("antennaMode", 2, enum_AntennaModes, NULL),
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
YAML_UNSIGNED( "channelsStart", 8 ),
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
Expand Down
3 changes: 2 additions & 1 deletion radio/src/storage/yaml/yaml_datastructs_t15pro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,8 @@ static const struct YamlNode union_anonymous_4_elmts[] = {
};
static const struct YamlNode struct_ModuleData[] = {
YAML_IDX,
YAML_UNSIGNED_CUST( "type", 8, r_moduleType, w_moduleType ),
YAML_UNSIGNED_CUST( "type", 6, r_moduleType, w_moduleType ),
YAML_ENUM("antennaMode", 2, enum_AntennaModes, NULL),
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
YAML_UNSIGNED( "channelsStart", 8 ),
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
Expand Down
3 changes: 2 additions & 1 deletion radio/src/storage/yaml/yaml_datastructs_t20.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,8 @@ static const struct YamlNode union_anonymous_4_elmts[] = {
};
static const struct YamlNode struct_ModuleData[] = {
YAML_IDX,
YAML_UNSIGNED_CUST( "type", 8, r_moduleType, w_moduleType ),
YAML_UNSIGNED_CUST( "type", 6, r_moduleType, w_moduleType ),
YAML_ENUM("antennaMode", 2, enum_AntennaModes, NULL),
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
YAML_UNSIGNED( "channelsStart", 8 ),
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
Expand Down
3 changes: 2 additions & 1 deletion radio/src/storage/yaml/yaml_datastructs_t22.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,8 @@ static const struct YamlNode union_anonymous_4_elmts[] = {
};
static const struct YamlNode struct_ModuleData[] = {
YAML_IDX,
YAML_UNSIGNED_CUST( "type", 8, r_moduleType, w_moduleType ),
YAML_UNSIGNED_CUST( "type", 6, r_moduleType, w_moduleType ),
YAML_ENUM("antennaMode", 2, enum_AntennaModes, NULL),
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
YAML_UNSIGNED( "channelsStart", 8 ),
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
Expand Down
3 changes: 2 additions & 1 deletion radio/src/storage/yaml/yaml_datastructs_tpro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,8 @@ static const struct YamlNode union_anonymous_4_elmts[] = {
};
static const struct YamlNode struct_ModuleData[] = {
YAML_IDX,
YAML_UNSIGNED_CUST( "type", 8, r_moduleType, w_moduleType ),
YAML_UNSIGNED_CUST( "type", 6, r_moduleType, w_moduleType ),
YAML_ENUM("antennaMode", 2, enum_AntennaModes, NULL),
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
YAML_UNSIGNED( "channelsStart", 8 ),
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
Expand Down
3 changes: 2 additions & 1 deletion radio/src/storage/yaml/yaml_datastructs_tx15.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,8 @@ static const struct YamlNode union_anonymous_4_elmts[] = {
};
static const struct YamlNode struct_ModuleData[] = {
YAML_IDX,
YAML_UNSIGNED_CUST( "type", 8, r_moduleType, w_moduleType ),
YAML_UNSIGNED_CUST( "type", 6, r_moduleType, w_moduleType ),
YAML_ENUM("antennaMode", 2, enum_AntennaModes, NULL),
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
YAML_UNSIGNED( "channelsStart", 8 ),
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
Expand Down
3 changes: 2 additions & 1 deletion radio/src/storage/yaml/yaml_datastructs_tx16smk3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,8 @@ static const struct YamlNode union_anonymous_4_elmts[] = {
};
static const struct YamlNode struct_ModuleData[] = {
YAML_IDX,
YAML_UNSIGNED_CUST( "type", 8, r_moduleType, w_moduleType ),
YAML_UNSIGNED_CUST( "type", 6, r_moduleType, w_moduleType ),
YAML_ENUM("antennaMode", 2, enum_AntennaModes, NULL),
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
YAML_UNSIGNED( "channelsStart", 8 ),
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
Expand Down
6 changes: 3 additions & 3 deletions radio/src/storage/yaml/yaml_datastructs_v12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -750,13 +750,13 @@ static const struct YamlNode union_anonymous_4_elmts[] = {
};
static const struct YamlNode struct_ModuleData[] = {
YAML_IDX,
YAML_UNSIGNED_CUST( "type", 8, r_moduleType, w_moduleType ),
YAML_UNSIGNED_CUST( "type", 6, r_moduleType, w_moduleType ),
YAML_ENUM("antennaMode", 2, enum_AntennaModes, NULL),
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
YAML_UNSIGNED( "channelsStart", 8 ),
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
YAML_ENUM("failsafeMode", 4, enum_FailsafeModes, NULL),
YAML_PADDING( 2 ),
YAML_ENUM("antennaMode", 2, enum_AntennaModes, NULL),
YAML_PADDING( 4 ),
YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type),
YAML_END
};
Expand Down
6 changes: 3 additions & 3 deletions radio/src/storage/yaml/yaml_datastructs_x10.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -731,13 +731,13 @@ static const struct YamlNode union_anonymous_4_elmts[] = {
};
static const struct YamlNode struct_ModuleData[] = {
YAML_IDX,
YAML_UNSIGNED_CUST( "type", 8, r_moduleType, w_moduleType ),
YAML_UNSIGNED_CUST( "type", 6, r_moduleType, w_moduleType ),
YAML_ENUM("antennaMode", 2, enum_AntennaModes, NULL),
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
YAML_UNSIGNED( "channelsStart", 8 ),
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
YAML_ENUM("failsafeMode", 4, enum_FailsafeModes, NULL),
YAML_PADDING( 2 ),
YAML_ENUM("antennaMode", 2, enum_AntennaModes, NULL),
YAML_PADDING( 4 ),
YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type),
YAML_END
};
Expand Down
3 changes: 2 additions & 1 deletion radio/src/storage/yaml/yaml_datastructs_x9d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,8 @@ static const struct YamlNode union_anonymous_4_elmts[] = {
};
static const struct YamlNode struct_ModuleData[] = {
YAML_IDX,
YAML_UNSIGNED_CUST( "type", 8, r_moduleType, w_moduleType ),
YAML_UNSIGNED_CUST( "type", 6, r_moduleType, w_moduleType ),
YAML_ENUM("antennaMode", 2, enum_AntennaModes, NULL),
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
YAML_UNSIGNED( "channelsStart", 8 ),
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
Expand Down
3 changes: 2 additions & 1 deletion radio/src/storage/yaml/yaml_datastructs_x9dp2019.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,8 @@ static const struct YamlNode union_anonymous_4_elmts[] = {
};
static const struct YamlNode struct_ModuleData[] = {
YAML_IDX,
YAML_UNSIGNED_CUST( "type", 8, r_moduleType, w_moduleType ),
YAML_UNSIGNED_CUST( "type", 6, r_moduleType, w_moduleType ),
YAML_ENUM("antennaMode", 2, enum_AntennaModes, NULL),
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
YAML_UNSIGNED( "channelsStart", 8 ),
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
Expand Down
3 changes: 2 additions & 1 deletion radio/src/storage/yaml/yaml_datastructs_x9e.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,8 @@ static const struct YamlNode union_anonymous_4_elmts[] = {
};
static const struct YamlNode struct_ModuleData[] = {
YAML_IDX,
YAML_UNSIGNED_CUST( "type", 8, r_moduleType, w_moduleType ),
YAML_UNSIGNED_CUST( "type", 6, r_moduleType, w_moduleType ),
YAML_ENUM("antennaMode", 2, enum_AntennaModes, NULL),
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
YAML_UNSIGNED( "channelsStart", 8 ),
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
Expand Down
Loading