From b9b510e36705a92d8120db627338d8576c21f2f3 Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Mon, 18 Oct 2021 11:39:45 +0200 Subject: [PATCH] custom functions: output "play" for functions with string, "all" for the others --- .../conversions/yaml/yaml_datastructs_funcs.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/radio/src/storage/conversions/yaml/yaml_datastructs_funcs.cpp b/radio/src/storage/conversions/yaml/yaml_datastructs_funcs.cpp index 8e62f8285..df913e9c2 100644 --- a/radio/src/storage/conversions/yaml/yaml_datastructs_funcs.cpp +++ b/radio/src/storage/conversions/yaml/yaml_datastructs_funcs.cpp @@ -138,8 +138,19 @@ static uint8_t select_mod_type(uint8_t* data, uint32_t bitoffs) static uint8_t select_custom_fn(uint8_t* data, uint32_t bitoffs) { - // always use 'all' - //TODO + data += bitoffs >> 3UL; + data -= offsetof(CustomFunctionData, all); + + auto cf = reinterpret_cast(data); + switch(cf->func) { + case FUNC_PLAY_TRACK: + case FUNC_BACKGND_MUSIC: + case FUNC_PLAY_SCRIPT: + // play: 0 + return 0; + } + + // all: 1 return 1; }