From 01c2c0d819d4a82373bb5d6660a3aced43cf5e23 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Thu, 5 Jan 2023 01:51:59 +0200 Subject: [PATCH] lorawan conditional build --- CMakeLists.txt | 16 +++++++++++----- src/SystemConfiguration.c | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 57d9e77..a92a8a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,11 +1,18 @@ include(${CMAKE_CURRENT_LIST_DIR}/extlibs/jReadWrite/include.cmake) include(${CMAKE_CURRENT_LIST_DIR}/extlibs/libespfs/cmake/include.cmake) +if(CONFIG_WEBGUIAPP_LORAWAN_ENABLE) + set(lora_SRCS "src/LoRaWAN.c") + set(lora_REQUIRES ttn-esp32) +endif() + idf_component_register( SRCS ${jreadwrite_SRCS} INCLUDE_DIRS ${jreadwrite_INCLUDE_DIRS} + SRCS ${lora_SRCS} + SRCS ${libespfs_SRCS} INCLUDE_DIRS ${libespfs_INCLUDE_DIRS} PRIV_INCLUDE_DIRS ${libespfs_PRIV_INCLUDE_DIRS} @@ -23,12 +30,12 @@ idf_component_register( "src/WiFiTransport.c" "src/GSMTransport.c" "src/ETHTransport.c" - "src/LoRaWAN.c" "src/SNTP.c" "src/MQTT.c" "src/MQTTSysHandler.c" "src/OTA.c" - + + INCLUDE_DIRS "." "include" "src" @@ -37,7 +44,6 @@ idf_component_register( EMBED_FILES "upload_script.html" REQUIRES nvs_flash - #libespfs spiffs esp_http_server mbedtls @@ -46,6 +52,6 @@ idf_component_register( esp_modem esp_https_ota app_update - #jReadWrite - ttn-esp32 + REQUIRES ${lora_REQUIRES} + ) \ No newline at end of file diff --git a/src/SystemConfiguration.c b/src/SystemConfiguration.c index 939638d..f08bf39 100644 --- a/src/SystemConfiguration.c +++ b/src/SystemConfiguration.c @@ -129,7 +129,7 @@ esp_err_t WebGuiAppInit(void) #endif /*LoRaWAN start if enabled*/ -#if !CONFIG_TTN_LORA_FREQ_DISABLED +#if CONFIG_WEBGUIAPP_LORAWAN_ENABLE if (GetSysConf()->lorawanSettings.Flags1.bIsLoRaWANEnabled) { LoRaWANStart();