From 62028ffccec1f89fcf66ddf43076afb9e33f9563 Mon Sep 17 00:00:00 2001 From: elecpower Date: Thu, 23 Dec 2021 08:52:13 +1100 Subject: [PATCH] Fix custom func reset --- .../src/firmwares/edgetx/yaml_customfunctiondata.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/companion/src/firmwares/edgetx/yaml_customfunctiondata.cpp b/companion/src/firmwares/edgetx/yaml_customfunctiondata.cpp index 226e6abb7..2153f8803 100644 --- a/companion/src/firmwares/edgetx/yaml_customfunctiondata.cpp +++ b/companion/src/firmwares/edgetx/yaml_customfunctiondata.cpp @@ -97,7 +97,7 @@ static const YamlLookupTable resetLut = { { 1, "Tmr2" }, { 2, "Tmr3" }, { 3, "All" }, - { 5, "Tele" }, + { 4, "Tele" }, }; static const YamlLookupTable gvarModeLut = { @@ -262,12 +262,13 @@ bool convert::decode(const Node& node, strncpy(rhs.paramarm, file_str.c_str(), sizeof(rhs.paramarm)-1); } break; case FuncReset: { + std::string rst_str; + getline(def, rst_str, ','); try { - def >> rhs.param; - rhs.param += 5; // + FUNC_RESET_PARAM_FIRST_TELEM + rhs.param = std::stoi(rst_str); // TODO: check this works for radio generated if not then encode and here will need fixing break; } catch(...) {} - Node(def.str()) >> resetLut >> rhs.param; + Node(rst_str.c_str()) >> resetLut >> rhs.param; } break; case FuncSetTimer1: { // + timer #