From f317123c2666c8b0bf998796da54e419ab4a2608 Mon Sep 17 00:00:00 2001 From: proddy Date: Sun, 15 Feb 2026 15:27:11 +0100 Subject: [PATCH] fix standalone --- Makefile | 7 ++++++- lib/espMqttClient/src/Transport/ClientSecureSync.cpp | 3 +++ lib/espMqttClient/src/Transport/ClientSecureSync.h | 5 ++++- lib_standalone/Arduino.cpp | 1 + lib_standalone/Arduino.h | 1 + platformio.ini | 6 ++++++ 6 files changed, 21 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c1ca05b90..ba1d304d8 100644 --- a/Makefile +++ b/Makefile @@ -63,8 +63,9 @@ CXX_STANDARD := -std=gnu++17 #---------------------------------------------------------------------- # Defined Symbols #---------------------------------------------------------------------- -DEFINES += -DARDUINOJSON_ENABLE -DARDUINOJSON_ENABLE_ARDUINO_STRING -DARDUINOJSON_USE_DOUBLE=0 +DEFINES += -DARDUINOJSON_ENABLE -DARDUINOJSON_ENABLE_ARDUINO_STRING -DARDUINOJSON_USE_DOUBLE=0 DEFINES += -DEMSESP_STANDALONE -DEMSESP_TEST -DEMSESP_DEBUG -DEMC_RX_BUFFER_SIZE=1500 +DEFINES += -DNO_TLS_SUPPORT DEFINES += $(ARGS) DEFAULTS = -DEMSESP_DEFAULT_LOCALE=\"en\" -DEMSESP_DEFAULT_BOARD_PROFILE=\"S32S3\" @@ -79,6 +80,10 @@ SYMBOLS := $(CURDIR)/$(BUILD)/$(TARGET).out CSOURCES := $(shell find $(SOURCES) -name "*.c" 2>/dev/null) CXXSOURCES := $(shell find $(SOURCES) -name "*.cpp" 2>/dev/null) +# Exclude files not needed for standalone build, if they exist +CSOURCES := $(filter-out src/core/ModuleLibrary.c,$(CSOURCES)) +CXXSOURCES := $(filter-out src/core/ModuleLibrary.cpp,$(CXXSOURCES)) + OBJS := $(patsubst %,$(BUILD)/%.o,$(basename $(CSOURCES)) $(basename $(CXXSOURCES))) DEPS := $(patsubst %,$(BUILD)/%.d,$(basename $(CSOURCES)) $(basename $(CXXSOURCES))) diff --git a/lib/espMqttClient/src/Transport/ClientSecureSync.cpp b/lib/espMqttClient/src/Transport/ClientSecureSync.cpp index 18931d6e0..f0a9d0fc7 100644 --- a/lib/espMqttClient/src/Transport/ClientSecureSync.cpp +++ b/lib/espMqttClient/src/Transport/ClientSecureSync.cpp @@ -6,6 +6,8 @@ For a copy, see or the LICENSE file. */ +#ifndef NO_TLS_SUPPORT + #include "ClientSecureSync.h" #include "mbedtls_ssl.h" // triggers compilation of mbedtls SSL module (stripped from Tasmota libmbedtls.a) @@ -157,3 +159,4 @@ void ClientSecureSync::setInsecure() { } // namespace espMqttClientInternals +#endif \ No newline at end of file diff --git a/lib/espMqttClient/src/Transport/ClientSecureSync.h b/lib/espMqttClient/src/Transport/ClientSecureSync.h index d31f0079c..a9f366e13 100644 --- a/lib/espMqttClient/src/Transport/ClientSecureSync.h +++ b/lib/espMqttClient/src/Transport/ClientSecureSync.h @@ -8,7 +8,8 @@ the LICENSE file. #pragma once -#include +#ifndef NO_TLS_SUPPORT + #include "esp_tls.h" #include "Transport.h" @@ -44,3 +45,5 @@ class ClientSecureSync : public Transport { }; } // namespace espMqttClientInternals + +#endif \ No newline at end of file diff --git a/lib_standalone/Arduino.cpp b/lib_standalone/Arduino.cpp index 16b286985..cf7651354 100644 --- a/lib_standalone/Arduino.cpp +++ b/lib_standalone/Arduino.cpp @@ -145,6 +145,7 @@ double ledcSetup(uint8_t chan, double freq, uint8_t bit_num) { return 0; }; void ledcAttachPin(uint8_t pin, uint8_t chan) {}; +void ledcAttach(uint8_t pin, uint8_t chan, uint8_t bit_num) {}; void ledcWrite(uint8_t chan, uint32_t duty) {}; void neopixelWrite(uint8_t pin, uint8_t red_val, uint8_t green_val, uint8_t blue_val) {}; void rgbLedWrite(uint8_t pin, uint8_t red_val, uint8_t green_val, uint8_t blue_val) {}; diff --git a/lib_standalone/Arduino.h b/lib_standalone/Arduino.h index d13411c24..e521fa40b 100644 --- a/lib_standalone/Arduino.h +++ b/lib_standalone/Arduino.h @@ -72,6 +72,7 @@ void analogSetAttenuation(adc_attenuation_t attenuation); void dacWrite(uint8_t pin, uint8_t value); double ledcSetup(uint8_t chan, double freq, uint8_t bit_num); void ledcAttachPin(uint8_t pin, uint8_t chan); +void ledcAttach(uint8_t pin, uint8_t chan, uint8_t bit_num); void ledcWrite(uint8_t chan, uint32_t duty); void neopixelWrite(uint8_t pin, uint8_t red_val, uint8_t green_val, uint8_t blue_val); void rgbLedWrite(uint8_t pin, uint8_t red_val, uint8_t green_val, uint8_t blue_val); diff --git a/platformio.ini b/platformio.ini index e6a04b43b..0d4756fde 100644 --- a/platformio.ini +++ b/platformio.ini @@ -172,6 +172,7 @@ build_flags = build_src_flags = -DEMSESP_STANDALONE -DEMSESP_TEST -DARDUINOJSON_ENABLE_ARDUINO_STRING=1 + -DNO_TLS_SUPPORT -std=gnu++17 -Og -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-missing-braces @@ -194,6 +195,8 @@ build_src_filter = -<../lib/uuid-syslog> -<../lib/eModbus> -<../lib/OneWire> + -<../lib/mbedtls_ssl/src> + -<../src/core/ModuleLibrary.cpp> lib_ldf_mode = off lib_deps = @@ -210,6 +213,7 @@ build_src_flags = -DEMSESP_STANDALONE -DEMSESP_TEST -DEMSESP_UNITY -DARDUINOJSON_ENABLE_ARDUINO_STRING=1 + -DNO_TLS_SUPPORT -DEMSESP_DEFAULT_LOCALE=\"en\" -DEMSESP_DEFAULT_BOARD_PROFILE=\"S32\" -std=gnu++17 -Og -ggdb -Wall -Wextra @@ -236,6 +240,8 @@ build_src_filter = -<../lib/uuid-syslog> -<../lib/eModbus> -<../lib/OneWire> + -<../lib/mbedtls_ssl/src> + -<../src/core/ModuleLibrary.cpp> lib_ldf_mode = off lib_deps = Unity test_testing_command =