From 340e7627d53b2764d16551d7a2c0f238cd6406a4 Mon Sep 17 00:00:00 2001 From: elecpower Date: Thu, 23 Dec 2021 07:09:05 +1100 Subject: [PATCH] Fix custom func logs and sounds list --- .../edgetx/yaml_customfunctiondata.cpp | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/companion/src/firmwares/edgetx/yaml_customfunctiondata.cpp b/companion/src/firmwares/edgetx/yaml_customfunctiondata.cpp index 73da42dcc..226e6abb7 100644 --- a/companion/src/firmwares/edgetx/yaml_customfunctiondata.cpp +++ b/companion/src/firmwares/edgetx/yaml_customfunctiondata.cpp @@ -78,18 +78,18 @@ static const YamlLookupTable soundLut = { { 1, "Bp2" }, { 2, "Bp3" }, { 3, "Wrn1" }, - { 5, "Wrn2" }, - { 6, "Chee" }, - { 7, "Rata" }, - { 8, "Tick" }, - { 9, "Sirn" }, - { 10, "Ring" }, - { 11, "SciF" }, - { 12, "Robt" }, - { 13, "Chrp" }, - { 14, "Tada" }, - { 15, "Crck" }, - { 16, "Alrm" }, + { 4, "Wrn2" }, + { 5, "Chee" }, + { 6, "Rata" }, + { 7, "Tick" }, + { 8, "Sirn" }, + { 9, "Ring" }, + { 10, "SciF" }, + { 11, "Robt" }, + { 12, "Chrp" }, + { 13, "Tada" }, + { 14, "Crck" }, + { 15, "Alrm" }, }; static const YamlLookupTable resetLut = { @@ -193,6 +193,9 @@ Node convert::encode(const CustomFunctionData& rhs) case FuncBindInternalModule: { def += LookupValue(moduleLut, p1); } break; + case FuncLogs: + def += std::to_string(rhs.param); + break; default: break; } @@ -310,6 +313,11 @@ bool convert::decode(const Node& node, Node(mod) >> moduleLut >> module; rhs.func = (AssignFunc)((int)rhs.func + module); } break; + case FuncLogs: { + int param = 0; + def >> param; + rhs.param = param; + } break; default: break; }