Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idf component manager #1

Merged
merged 4 commits into from
Jun 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: git fetch --unshallow --tags
- run: cmake -Bbuild
- run: cmake --build build
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: git fetch --unshallow --tags
- run: cmake -Bbuild
- run: cmake --build build --target DCCTests
- run: ctest --test-dir build --schedule-random
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ if(NOT CMAKE_BUILD_EARLY_EXPANSION)
FetchContent_Declare(
CMakeModules
GIT_REPOSITORY https://github.com/ZIMO-Elektronik/CMakeModules
GIT_TAG v0.0.5
GIT_TAG v0.0.7
SOURCE_DIR ${CMAKE_BINARY_DIR}/CMakeModules)
FetchContent_MakeAvailable(CMakeModules)

version_from_git()
project(
DCC
VERSION 0.27.0
VERSION ${VERSION_FROM_GIT}
LANGUAGES C CXX)
endif()

Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,14 @@ FetchContent_Declare(
target_link_libraries(YourTarget PRIVATE DCC::DCC)
```

For the ESP32 there is also the possibility to integrate the library via the [IDF Component Manager](https://docs.espressif.com/projects/idf-component-manager/en/latest/) by adding it to a `idf_component.yml` file.
```yaml
dependencies:
dcc:
version: v0.27.0
git: https://github.com/ZIMO-Elektronik/DCC.git
```

A number of [options](CMakeLists.txt) are provided to configure various sizes such as the receiver queue length or the maximum packet length. When RAM becomes scarce, queue lengths can be reduced. On the other hand, if the processing of the commands is too slow and cannot be done every few milliseconds, it can make sense to lengthen the queues and batch process several commands at once. Otherwise, we recommend sticking with the defaults.
```cmake
set(DCC_RX_QUEUE_SIZE
Expand All @@ -132,7 +140,7 @@ set(DCC_RX_QUEUE_SIZE
```

### Build
If the library is built locally then the tests and a REPL example will be generated.
If the build is running as a top-level CMake project then tests and a REPL example will be generated.
```sh
cmake -Bbuild
cmake --build build --target DCCReplExample
Expand Down