fix(cpn): Radio settings yaml for adc refactor (#3862)

* Remove commented lines

* Restrict calibration to sticks, pots and sliders

* Fix pots and sliders config to support pre and post adc refactor

* fix: pfeerick sucks at rebases

* chore: Add more bits missed during rebase

* chore(cpn): use adc version constant

* fix(cpn): calibration encode mapping

---------

Co-authored-by: elecpower <neilh713@tpg.com.au>
This commit is contained in:
Peter Feerick
2023-08-16 10:11:31 +10:00
committed by GitHub
co-authored by elecpower
parent 1177891750
commit 50bbea48bd
15 changed files with 421 additions and 136 deletions
+23
View File
@@ -91,3 +91,26 @@ std::string DataHelpers::getStringTagMappingTag(const StringTagMappingTable& lut
return std::string();
}
int DataHelpers::getStringTagMappingSeq(const StringTagMappingTable& lut, unsigned int index)
{
if (index < lut.size())
return lut[index].seq;
return -1;
}
std::string DataHelpers::getStringSeqMappingTag(const StringTagMappingTable& lut, unsigned int seq)
{
const auto it =
find_if(lut.begin(), lut.end(), [=](const StringTagMapping& elmt) {
if (elmt.seq == seq) return true;
return false;
});
if (it != lut.end()) {
return it->tag;
}
return std::string();
}