feat: option to disable power on/off haptic (#5017)

This commit is contained in:
Peter Feerick
2024-06-09 11:13:26 +10:00
committed by GitHub
parent 2c800c0f3c
commit 42153fbb84
41 changed files with 1182 additions and 1046 deletions
@@ -279,6 +279,7 @@ Node convert<GeneralSettings>::encode(const GeneralSettings& rhs)
node["antennaMode"] = antennaModeLut << rhs.antennaMode;
node["pwrOnSpeed"] = rhs.pwrOnSpeed;
node["pwrOffSpeed"] = rhs.pwrOffSpeed;
node["disablePwrOnOffHaptic"] = (int)rhs.disablePwrOnOffHaptic;
for (int i = 0; i < CPN_MAX_SPECIAL_FUNCTIONS; i++) {
const CustomFunctionData& fn = rhs.customFn[i];
@@ -557,6 +558,7 @@ bool convert<GeneralSettings>::decode(const Node& node, GeneralSettings& rhs)
node["backlightColor"] >> rhs.backlightColor;
node["pwrOnSpeed"] >> rhs.pwrOnSpeed;
node["pwrOffSpeed"] >> rhs.pwrOffSpeed;
node["disablePwrOnOffHaptic"] >> rhs.disablePwrOnOffHaptic;
if (node["customFn"]) {
// decode common for radio GF and model SF and conversion test assumes decoding a model