From e07b0e42b3f3ec0af76cc30f4627c02dcad614ba Mon Sep 17 00:00:00 2001 From: Roland Praml Date: Mon, 27 May 2024 13:11:54 +0200 Subject: [PATCH] SML: Fix compile error when median-filter is disabled (#21495) Co-authored-by: Roland Praml --- tasmota/tasmota_xsns_sensor/xsns_53_sml.ino | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tasmota/tasmota_xsns_sensor/xsns_53_sml.ino b/tasmota/tasmota_xsns_sensor/xsns_53_sml.ino index fb8b6698c..e33c324d0 100755 --- a/tasmota/tasmota_xsns_sensor/xsns_53_sml.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_53_sml.ino @@ -3633,7 +3633,11 @@ next_line: sml_globs.sml_mf = (struct SML_MEDIAN_FILTER*)calloc(sml_globs.maxvars, sizeof(struct SML_MEDIAN_FILTER)); #endif - if (!sml_globs.maxvars || !sml_globs.meter_vars || !sml_globs.dvalid || !sml_globs.sml_mf) { + if (!sml_globs.maxvars || !sml_globs.meter_vars || !sml_globs.dvalid +#ifdef USE_SML_MEDIAN_FILTER + || !sml_globs.sml_mf +#endif + ) { AddLog(LOG_LEVEL_INFO, PSTR("sml memory error!")); return; }