From 7a526a17860fbe6a75bce29f8217608f8123e02a Mon Sep 17 00:00:00 2001 From: elecpower Date: Thu, 23 Dec 2021 06:33:28 +1100 Subject: [PATCH] Fix custom func decode play_x --- .../src/firmwares/edgetx/yaml_customfunctiondata.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/companion/src/firmwares/edgetx/yaml_customfunctiondata.cpp b/companion/src/firmwares/edgetx/yaml_customfunctiondata.cpp index 654a00201..73da42dcc 100644 --- a/companion/src/firmwares/edgetx/yaml_customfunctiondata.cpp +++ b/companion/src/firmwares/edgetx/yaml_customfunctiondata.cpp @@ -253,9 +253,11 @@ bool convert::decode(const Node& node, break; case FuncPlayPrompt: case FuncPlayScript: - case FuncBackgroundMusic: - strncpy(rhs.paramarm, def.str().c_str(), sizeof(rhs.paramarm)-1); // TODO fix eg def: engarm,1x - break; + case FuncBackgroundMusic: { + std::string file_str; + getline(def, file_str, ','); + strncpy(rhs.paramarm, file_str.c_str(), sizeof(rhs.paramarm)-1); + } break; case FuncReset: { try { def >> rhs.param;