Skip to content

Commit

Permalink
fix: Regenerate yaml, carryTrim => trimSource cleanup (#3121)
Browse files Browse the repository at this point in the history
PR #2995 didn't take into account the data model storage actually does change when you change a variable name. 
Boxer yaml generation was missed in earlier PR. 

* chore: Run `generate-yaml.sh`

* chore(cpn): carryTrim -> trimSource

* fix(build): Boxer missing from `generate-yaml`

* dodgy attempt to read old carryTrim

* fix: Don't break the byte boundary + reorder

* fix(yaml): indentation for attributes that should not be output

* chore: Regenerate YAML after rebase

---------

Co-authored-by: raphaelcoeffic <[email protected]>
  • Loading branch information
pfeerick and raphaelcoeffic authored Feb 5, 2023
1 parent 4e09bd7 commit 46cc979
Show file tree
Hide file tree
Showing 24 changed files with 764 additions and 726 deletions.
6 changes: 5 additions & 1 deletion companion/src/firmwares/edgetx/yaml_expodata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Node convert<ExpoData>::encode(const ExpoData& rhs)
node["weight"] = YamlWriteMixWeight(rhs.weight);
node["offset"] = rhs.offset; // YamlWriteMixWeight
node["curve"] = rhs.curve;
node["carryTrim"] = rhs.carryTrim;
node["trimSource"] = rhs.carryTrim; // temporary for 2.8.1, trimSource in 2.9
node["name"] = rhs.name;
return node;
}
Expand All @@ -60,7 +60,11 @@ bool convert<ExpoData>::decode(const Node& node, ExpoData& rhs)
rhs.offset = YamlReadMixWeight(node["offset"]);
}
node["curve"] >> rhs.curve;
if (node["carryTrim"]) { // 2.9 - change bugged carryTrim to trimSource
node["carryTrim"] >> rhs.carryTrim;
} else {
node["trimSource"] >> rhs.carryTrim;
}
node["name"] >> rhs.name;
return true;
}
Expand Down
3 changes: 2 additions & 1 deletion radio/src/datastructs_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ PACK(struct MixData {
PACK(struct ExpoData {
uint16_t mode:2;
uint16_t scale:14;
uint16_t srcRaw:10 ENUM(MixSources) CUST(r_mixSrcRaw,w_mixSrcRaw);
CUST_ATTR(carryTrim, r_carryTrim, nullptr); //pre 2.9
int16_t trimSource:6;
uint16_t srcRaw:10 ENUM(MixSources) CUST(r_mixSrcRaw,w_mixSrcRaw);
uint32_t chn:5;
int32_t swtch:9 CUST(r_swtchSrc,w_swtchSrc);
uint32_t flightModes:9 CUST(r_flightModes, w_flightModes);
Expand Down
Loading

0 comments on commit 46cc979

Please sign in to comment.