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
+5 -2
View File
@@ -20,6 +20,9 @@
#include "yaml_ops.h"
SemanticVersion radioSettingsVersion;
SemanticVersion modelSettingsVersion;
YAML::Node operator >> (const YAML::Node& node, const YamlLookupTable& lut)
{
if (node && node.IsScalar()) {
@@ -32,7 +35,7 @@ YAML::Node operator >> (const YAML::Node& node, const YamlLookupTable& lut)
if (it != lut.end()) {
return YAML::Node(it->first);
}
}
return YAML::Node();
}
@@ -63,7 +66,7 @@ std::string LookupValue(const YamlLookupTable& lut, const int& value)
if (elmt.first == value) return true;
return false;
});
if (it != lut.end()) {
return it->second;
}