Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions ports/esp-idf/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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})
7 changes: 7 additions & 0 deletions ports/esp-idf/Kconfig
Original file line number Diff line number Diff line change
@@ -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
22 changes: 22 additions & 0 deletions ports/esp-idf/README.md
Original file line number Diff line number Diff line change
@@ -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.
10 changes: 10 additions & 0 deletions ports/esp-idf/idf_component.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions ports/esp-idf/src