feat: Model level ADC Jitter filter option (#1363)
* ADC Filter - On/off state configurable at the model level * Updated YAML configuration to match change from ADC Filter feature commit * Companion changes to support ADC jitter filter to be a model configuration item. * Renamed jitterFilter field to noJitterFilter. This better describes the semantic, which is inverted. * Updated after review * Re-run generate-yaml * Changed ADC Jitter filter control on Model to be tri state. Off, On or use the radio setting * Adde NOBACKUP() to the added field * Re-generate yaml_datastructs * Making the default state to use radio setting/Global value * Updated after review: Changing to more consistent naming across firmware and companion. * Reverted files that was accidently added to the commit. Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
co-authored by
Peter Feerick
parent
09980bf640
commit
c3c8a2e3f1
@@ -71,6 +71,12 @@ static const YamlLookupTable potsWarningModeLut = {
|
||||
{ 2, "WARN_AUTO" },
|
||||
};
|
||||
|
||||
static const YamlLookupTable jitterFilterLut = {
|
||||
{ 0, "GLOBAL" },
|
||||
{ 1, "OFF" },
|
||||
{ 2, "ON" },
|
||||
};
|
||||
|
||||
struct YamlTrim {
|
||||
int mode = 0;
|
||||
int ref = 0;
|
||||
@@ -236,7 +242,7 @@ struct YamlSwitchWarningState {
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
states |= ((uint64_t)value << (index * MASK_LEN));
|
||||
enabled |= (1 << index);
|
||||
}
|
||||
@@ -811,6 +817,7 @@ Node convert<ModelData>::encode(const ModelData& rhs)
|
||||
|
||||
node["thrTrimSw"] = rhs.thrTrimSwitch;
|
||||
node["potsWarnMode"] = potsWarningModeLut << rhs.potsWarningMode;
|
||||
node["jitterFilter"] = jitterFilterLut << rhs.jitterFilter;
|
||||
|
||||
YamlPotsWarnEnabled potsWarnEnabled(&rhs.potsWarnEnabled[CPN_MAX_POTS + CPN_MAX_SLIDERS]);
|
||||
node["potsWarnEnabled"] = potsWarnEnabled.value;
|
||||
@@ -990,6 +997,7 @@ bool convert<ModelData>::decode(const Node& node, ModelData& rhs)
|
||||
|
||||
node["thrTrimSw"] >> rhs.thrTrimSwitch;
|
||||
node["potsWarnMode"] >> potsWarningModeLut >> rhs.potsWarningMode;
|
||||
node["jitterFilter"] >> jitterFilterLut >> rhs.jitterFilter;
|
||||
|
||||
YamlPotsWarnEnabled potsWarnEnabled;
|
||||
node["potsWarnEnabled"] >> potsWarnEnabled.value;
|
||||
|
||||
Reference in New Issue
Block a user