diff --git a/examples/send_recv/.gitignore b/examples/send_recv/.gitignore new file mode 100644 index 0000000..89cc49c --- /dev/null +++ b/examples/send_recv/.gitignore @@ -0,0 +1,5 @@ +.pio +.vscode/.browse.c_cpp.db* +.vscode/c_cpp_properties.json +.vscode/launch.json +.vscode/ipch diff --git a/examples/send_recv/CMakeLists.txt b/examples/send_recv/CMakeLists.txt index b6b2f10..49aac14 100644 --- a/examples/send_recv/CMakeLists.txt +++ b/examples/send_recv/CMakeLists.txt @@ -1,9 +1,8 @@ -# The following lines of boilerplate have to be in your project's -# CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) - -get_filename_component(TTN_DIR ../.. ABSOLUTE) -set(EXTRA_COMPONENT_DIRS "${TTN_DIR}") - include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +# Update the below line to match the path to the ttn-esp32 library, +# e.g. list(APPEND EXTRA_COMPONENT_DIRS "/Users/me/Documents/ttn-esp32") +list(APPEND EXTRA_COMPONENT_DIRS "../..") + project(send_recv) diff --git a/examples/send_recv/main/CMakeLists.txt b/examples/send_recv/main/CMakeLists.txt index e931882..8aa291e 100644 --- a/examples/send_recv/main/CMakeLists.txt +++ b/examples/send_recv/main/CMakeLists.txt @@ -1,4 +1,4 @@ -set(COMPONENT_SRCS "main.cpp") -set(COMPONENT_ADD_INCLUDEDIRS "") - -register_component() +idf_component_register( + SRCS "main.cpp" + INCLUDE_DIRS "." + REQUIRES ttn-esp32) diff --git a/examples/send_recv/platformio.ini b/examples/send_recv/platformio.ini new file mode 100644 index 0000000..9d18874 --- /dev/null +++ b/examples/send_recv/platformio.ini @@ -0,0 +1,10 @@ +[platformio] +src_dir = main + +[env:esp32dev] +platform = espressif32 +board = esp32dev +framework = espidf +build_flags = -Wno-expansion-to-defined +upload_port = /dev/cu.usb* +monitor_speed = 115200 diff --git a/library.json b/library.json index 810d1a7..7500830 100644 --- a/library.json +++ b/library.json @@ -18,8 +18,7 @@ "export": { "include": [ "include", - "src", - "esp_idf_lmic_config.h" + "src" ] }, "frameworks": "espidf",