Skip to content

Commit

Permalink
Merge pull request #1 from ZIMO-Elektronik/idf_component_manager
Browse files Browse the repository at this point in the history
Idf component manager
  • Loading branch information
higaski committed Jun 23, 2023
2 parents effd27a + d14ead0 commit 9af889d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
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

0 comments on commit 9af889d

Please sign in to comment.