Skip to content

Commit

Permalink
Add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
higaski committed Jun 15, 2023
1 parent a3ee074 commit effd27a
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: build

on:
push:
branches: [master]

jobs:
x86_64-pc-linux-gnu-gcc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: cmake -Bbuild
- run: cmake --build build
15 changes: 15 additions & 0 deletions .github/workflows/license.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: license

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
check-license:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check license
uses: kt3k/license_checker@v1.0.6
16 changes: 16 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: tests

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
x86_64-pc-linux-gnu-gcc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: cmake -Bbuild
- run: cmake --build build --target DCCTests
- run: ctest --test-dir build --schedule-random
7 changes: 7 additions & 0 deletions .licenserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"{include,src}/**/*.{c,cpp,h,hpp}": [
"// This Source Code Form is subject to the terms of the Mozilla Public",
"// License, v. 2.0. If a copy of the MPL was not distributed with this",
"// file, You can obtain one at https://mozilla.org/MPL/2.0/."
]
}
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# DCC

[![build](https://github.com/ZIMO-Elektronik/DCC/actions/workflows/build.yml/badge.svg)](https://github.com/ZIMO-Elektronik/DCC/actions/workflows/build.yml) [![tests](https://github.com/ZIMO-Elektronik/DCC/actions/workflows/tests.yml/badge.svg)](https://github.com/ZIMO-Elektronik/DCC/actions/workflows/tests.yml)

<img src="data/images/logo.gif" align="right"/>

DCC is an acronym for [Digital Command Control](https://en.wikipedia.org/wiki/Digital_Command_Control), a standardized protocol for controlling digital model railways. This C++ library of the same name contains platform-independent code to either decode (decoder) or generate (command station) a DCC signal on the track. For both cases, a typical microcontroller timer with microsecond precision is sufficient for implementing a receiver or transmitter class. Also included, but not platform-independent, is an encoder for the [ESP32 RMT](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/rmt.html) peripherals.
Expand Down Expand Up @@ -29,7 +31,7 @@ The implementation provided here is used in the following products:
</details>

## Protocol
The DCC protocol is defined by various standards published by the [National Model Railroad Association (NMRA)](https://www.nmra.org/) and the [RailCommunity](https://www.vhdm.at/). The standards are mostly consistent and I have tried to match the English and German standards in the table below, but if you can read German I would recommend sticking to the RCN standards as these are updated more frequently.
The DCC protocol is defined by various standards published by the [National Model Railroad Association (NMRA)](https://www.nmra.org/) and the [RailCommunity](https://www.vhdm.at/). The standards are mostly consistent and we have attempted to match the English and German standards in the table below. However, if you can read German, we recommend that you stick to the RCN standards as they are updated more frequently.

| NMRA (English) | RailCommunity (German) |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
Expand Down Expand Up @@ -122,7 +124,7 @@ FetchContent_Declare(
target_link_libraries(YourTarget PRIVATE DCC::DCC)
```

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, I would recommend sticking with the defaults.
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
8
Expand Down

0 comments on commit effd27a

Please sign in to comment.