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:
co-authored by
elecpower
parent
1177891750
commit
50bbea48bd
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user