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

R1.7.3 #69

Merged
merged 10 commits into from
Aug 1, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .ci-local/asyn-tirpc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

echo "TIRPC=YES" > configure/CONFIG_SITE.Common.linux-x86_64
10 changes: 10 additions & 0 deletions .ci-local/deps.set
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
MODULES="asyn modbus"

ASYN=master
MODBUS=master

# FIXME: Motor module build fails in mingw/windows. Only needed for motor support though
#MOTOR=master

# Enable libtirpc for Linux builds
ASYN_HOOK=.ci-local/asyn-tirpc.sh
31 changes: 30 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
---
Checks: 'clang-diagnostic-*,clang-analyzer-*,cert-*,performance-*'
# See: https://clang.llvm.org/extra/clang-tidy/checks/list.html
Checks:
- 'clang-diagnostic-*'
- 'clang-analyzer-*'
# All CERT checks that clang-tidy supports are relevant
- 'cert-*'
- 'performance-*'
# Validate return value checks for POSIX functions
- 'bugprone-posix-return'
- 'bugprone-sizeof-*'
- 'bugprone-too-small-loop-variable'
- 'bugprone-swapped-arguments'
# Common mistakes due to reversed parameters, bad sizeof's and such
- 'bugprone-suspicious-*'
# Avoid RAII misuse (i.e. forgetting to name mutex guard)
- 'bugprone-unused-raii'
# Flag possible ODR violations
- 'misc-definitions-in-headers'
- 'bugprone-use-after-move'
- 'bugprone-unused-local-non-trivial-variable'
- 'bugprone-not-null-terminated-result'
- 'bugprone-branch-clone'
# Flag potentially bad copy constructors
- 'bugprone-copy-constructor-init'
- 'bugprone-dangling-handle'
- 'bugprone-chained-comparison'
# Avoid cyclic includes
- 'misc-header-include-cycle'
# Get rid of deprecated smart pointer types
- 'modernize-replace-auto-ptr'
WarningsAsErrors: '*'
3 changes: 3 additions & 0 deletions .clang-tidy-exclude
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Defines patterns to exclude from the clang-tidy run
Exclude:
- '\S+registerRecordDeviceDriver.cpp'
3 changes: 0 additions & 3 deletions .clang-tidy-exclude.json

This file was deleted.

4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ indent_style = space
[*.yml]
indent_size = 2
indent_style = space

[.clang-*]
indent_size = 2
indent_style = space
67 changes: 42 additions & 25 deletions .github/workflows/ci-scripts-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

name: EK9000

# Trigger on pushes and PRs to any branch
# Trigger on pushes and PRs to any branch, but ignore docs
on:
push:
paths-ignore:
- 'documentation/*'
- 'docs/*'
- '**/*.html'
- '**/*.md'
pull_request:
Expand All @@ -22,18 +22,15 @@ env:
APT: re2c
CHOCO: re2c
BREW: re2c
MODULES: "asyn modbus"
ASYN: master
MODBUS: master
# FIXME: Motor module build fails in mingw/windows. Only needed for motor support though
#MOTOR: master
# This is where we define our dependencies in CI
SET: deps

jobs:
format:
name: clang-format formatting check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: clang-format check
uses: jidicula/[email protected]
with:
Expand All @@ -42,10 +39,12 @@ jobs:
exclude-regex: 'terminals.h'

scripts-check:
# Run basic checks on the Python scripts bundled here.
# Checks the terminals.json against the schema as well.
name: Scripts Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.10'
Expand All @@ -71,51 +70,54 @@ jobs:
fail-fast: false
matrix:
# Job names also name artifacts, character limitations apply
# Ubuntu 22.04:
# clang, clang-13, clang-14, clang-15 (clang=clang-14)
# gcc, gcc-9, gcc-10, gcc-12, gcc-13 (gcc=gcc-11)
include:
- os: ubuntu-20.04
- os: ubuntu-22.04
cmp: gcc
configuration: default
wine: "64"
name: "Ub-20 gcc-9 + MinGW"
name: "Ub-22 gcc-11 + MinGW"

- os: ubuntu-20.04
- os: ubuntu-22.04
cmp: gcc
configuration: static
extra: "CMD_CXXFLAGS=-std=c++14"
name: "clang-tidy checks"
clang-tidy: true

- os: ubuntu-20.04
- os: ubuntu-22.04
cmp: gcc
configuration: static
extra: "CMD_CXXFLAGS=-std=c++14"
name: "Ub-20 gcc-9 C++14, static"
name: "Ub-22 gcc-11 C++14, static"

- os: ubuntu-20.04
- os: ubuntu-22.04
cmp: gcc
configuration: static
extra: "CMD_CXXFLAGS=-std=c++03"
name: "Ub-20 gcc-9 C++03, static"
name: "Ub-22 gcc-11 C++03, static"

- os: ubuntu-20.04
- os: ubuntu-22.04
cmp: clang
configuration: default
extra: "CMD_CXXFLAGS=-std=c++14"
name: "Ub-20 clang-10 C++14"
name: "Ub-22 clang-14 C++14"

- os: ubuntu-20.04
- os: ubuntu-22.04
cmp: gcc
configuration: default
rtems: "5"
rtems_target: RTEMS-beatnik
test: NO
name: "Ub-20 gcc-9 + RT-5.1 beatnik"
name: "Ub-22 gcc-11 + RT-5.1 beatnik"

- os: ubuntu-20.04
- os: ubuntu-22.04
cmp: clang
configuration: default
extra: "CMD_CXXFLAGS=-std=c++03"
name: "Ub-20 clang-10 C++03"
name: "Ub-22 clang-14 C++03"

- os: macos-latest
cmp: clang
Expand All @@ -128,39 +130,54 @@ jobs:
name: "Win2019 MinGW"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true

- name: Automatic core dumper analysis
uses: mdavidsaver/ci-core-dumper@master

# Install dependencies. Qemu for RTEMS, mingw GCC for Windows cross builds and bear to generate compile_commands.json for clang-tidy
- name: "apt-get install"
run: |
sudo apt-get update
sudo apt-get -y install qemu-system-x86 g++-mingw-w64-x86-64 gdb bear clang-tidy
if: runner.os == 'Linux'

# Install required cross toolchain for RTEMS
- name: "apt-get install ${{ matrix.cmp }}"
run: |
sudo apt-get -y install software-properties-common
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get -y install ${{ matrix.cmp }}
if: matrix.utoolchain

- name: Prepare and compile dependencies
run: python .ci/cue.py prepare

- name: Build main module
run: python .ci/cue.py build

# Run clang-tidy on our code. To do this, we need compile_commands.json, which we generate using 'bear'
# To get a complete compile_commands.json, we need to re-run the entire compile with bear. For now, we'll only do this on Linux native builds.
- name: Run clang-tidy
run: |
python3 -m pip install -r scripts/requirements.txt
make clean
bear make -j$(nproc)
python3 clang-tidy.py
bear -- make -j$(nproc)
python3 scripts/clang-tidy.py
if: matrix.clang-tidy

- name: Run main module tests
run: python .ci/cue.py test

# Resulting test files will be uploaded and attached to this run
- name: Upload tapfiles Artifact
uses: actions/upload-artifact@v2
with:
name: tapfiles ${{ matrix.name }}
path: '**/O.*/*.tap'

- name: Collect and show test results
run: python .ci/cue.py test-results
32 changes: 0 additions & 32 deletions clang-tidy.py

This file was deleted.

4 changes: 2 additions & 2 deletions configure/RELEASE
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
# Don't set your version to anything such as "test" that
# could match a directory name.
# ==========================================================
ASYN_MODULE_VERSION=R4.39-1.0.1
MODBUS_MODULE_VERSION=R3.2-1.0.1
ASYN_MODULE_VERSION=R4.39-1.0.2
MODBUS_MODULE_VERSION=R3.2-1.0.2

# ==========================================================
# Define module paths using pattern
Expand Down
7 changes: 4 additions & 3 deletions ek9000App/src/devEL3XXX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ struct EL30XXStandardInputPDO_t {
uint8_t _r2 : 6; // Last bit in this align is Sync error for EL31XX
uint8_t txpdo_state : 1;
uint8_t txpdo_toggle : 1;
uint16_t value;
int16_t value; // Must be signed to accommodate bipolar terminals. Unsigned representation still defines range as
// 0-32767, so this is safe.
};
#pragma pack()

Expand Down Expand Up @@ -339,7 +340,7 @@ struct EL331XInputPDO_t {
uint8_t error : 1;
uint8_t txpdo_state : 1;
uint8_t txpdo_toggle : 1;
uint16_t value;
int16_t value;
};

struct EL3314_0010_InputPDO_t {
Expand All @@ -351,7 +352,7 @@ struct EL3314_0010_InputPDO_t {
uint8_t txpdo_state : 1;
uint8_t txpdo_toggle : 1;
uint8_t padding1 : 7; // Pad it out to byte boundary
uint16_t value;
int16_t value;
};
#pragma pack()

Expand Down
Loading
Loading