diff --git a/ports/esp-idf/CMakeLists.txt b/ports/esp-idf/CMakeLists.txt new file mode 100644 index 0000000..9a7257d --- /dev/null +++ b/ports/esp-idf/CMakeLists.txt @@ -0,0 +1,13 @@ +file(GLOB_RECURSE COMPONENT_SRC "src/*.c") +set(COMPONENT_ADD_INCLUDEDIRS "src") +set(COMPONENT_DEFINES "PS_SYNC_CUSTOM;PS_SYNC_FREERTOS;PS_DEPRECATE_NO_PREFIX") +idf_component_register( + SRCS ${COMPONENT_SRC} + INCLUDE_DIRS ${COMPONENT_ADD_INCLUDEDIRS} +) + +if(PUBSUB_NO_PREFIX) +list(REMOVE_ITEM COMPONENT_DEFINES "PS_DEPRECATE_NO_PREFIX") +endif() + +target_compile_definitions(${COMPONENT_LIB} INTERFACE ${COMPONENT_DEFINES}) diff --git a/ports/esp-idf/Kconfig b/ports/esp-idf/Kconfig new file mode 100644 index 0000000..1a467b9 --- /dev/null +++ b/ports/esp-idf/Kconfig @@ -0,0 +1,7 @@ +menu "pubsub-c" + config PUBSUB_NO_PREFIX + bool "allow naked macro and function names." + default n + help + "Generate naked macro and function names without a prefix." +endmenu diff --git a/ports/esp-idf/README.md b/ports/esp-idf/README.md new file mode 100644 index 0000000..d660aae --- /dev/null +++ b/ports/esp-idf/README.md @@ -0,0 +1,22 @@ +# ESP-IDF component + +In your ESP-IDF project, edit your `idf_component.yml`: + +```yaml +dependencies: + pubsub-c: + git: https://github.com/jaracil/pubsub-c + version: "*" + path: ports/esp-idf +``` + +and add `pubsub-c` to your main `CMakeLists.txt`: + +```cmake +idf_component_register( + SRCS ${SRC} + REQUIRES pubsub-c +) +``` + +The [Component Manager](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-component-manager.html) will automatically download pubsub-c, and make it available to your project. \ No newline at end of file diff --git a/ports/esp-idf/idf_component.yml b/ports/esp-idf/idf_component.yml new file mode 100644 index 0000000..5658c45 --- /dev/null +++ b/ports/esp-idf/idf_component.yml @@ -0,0 +1,10 @@ +dependencies: + cmake_utilities: '*' + idf: '>=5.0' +description: Publish and Subscribe bus +documentation: https://github.com/jaracil/pubsub-c +issues: https://github.com/jaracil/pubsub-c/issues +repository: git://://github.com/jaracil/pubsub-c.git +repository_info: + path: "ports/esp-idf" +url: https://github.com/jaracil/pubsub-c diff --git a/ports/esp-idf/src b/ports/esp-idf/src new file mode 120000 index 0000000..929cb3d --- /dev/null +++ b/ports/esp-idf/src @@ -0,0 +1 @@ +../../src \ No newline at end of file