Skip to content

Commit ac25775

Browse files
Merge branch 'main' into use-etl
Signed-off-by: rolandreichweinbmw <[email protected]>
2 parents 1e53406 + 8b7f122 commit ac25775

File tree

78 files changed

+3407
-20
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+3407
-20
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
platform: [posix, s32k148]
10+
platform: [posix-gcc, posix-clang, s32k148]
1111
cpp-standard: [14, 17, 20]
1212

1313
steps:
@@ -36,8 +36,15 @@ jobs:
3636
with:
3737
release: '10.3-2021.10'
3838

39+
- name: Install LLVM and Clang
40+
if: ${{ matrix.platform == 'posix-clang' }}
41+
uses: KyleMayes/install-llvm-action@v2
42+
with:
43+
version: "17"
44+
env: true
45+
3946
- name: Configure CMake for POSIX
40-
if: ${{ matrix.platform == 'posix' && steps.cache-cmake.outputs.cache-hit != 'true' }}
47+
if: ${{ startsWith(matrix.platform, 'posix') && steps.cache-cmake.outputs.cache-hit != 'true' }}
4148
run: |
4249
cmake \
4350
-B cmake-build-posix \
@@ -56,4 +63,4 @@ jobs:
5663
5764
- name: Build for ${{ matrix.platform }}
5865
if: steps.cache-cmake.outputs.cache-hit != 'true'
59-
run: cmake --build cmake-build-${{ matrix.platform }} --target app.referenceApp -j
66+
run: cmake --build cmake-build-${{ startsWith(matrix.platform, 'posix') && 'posix' || matrix.platform }} --target app.referenceApp -j

doc/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ WARN_LOGFILE = "DoxygenWarningLog.txt"
864864
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
865865
# Note: If this tag is empty the current directory is searched.
866866

867-
INPUT = DoxygenMainPage.md ../libs/bsw ../libs/bsp
867+
INPUT = DoxygenMainPage.md ../libs/bsw ../libs/bsp ../libs/safety
868868

869869
# This tag can be used to specify the character encoding of the source files
870870
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses

doc/DoxygenMainPage.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ This documentation was generated by doxygen from the code in the subdirectories.
55

66
* `libs/bsp`
77
* `libs/bsw`
8+
* `libs/safety`

doc/index.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,14 @@ Eclipse OpenBSW is a trademark of the Eclipse Foundation.
163163

164164
../libs/bsw/**/doc/index
165165

166+
.. toctree::
167+
:maxdepth: 1
168+
:caption: Safety Modules
169+
:glob:
170+
:hidden:
171+
172+
../libs/safety/**/doc/index
173+
166174
.. toctree::
167175
:maxdepth: 1
168176
:caption: BSP Modules

docker/Dockerfile.dev

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
FROM ubuntu:22.04
2+
3+
RUN apt-get update && apt-get install -y \
4+
python3.10 \
5+
python3-pip \
6+
bzip2\
7+
tar \
8+
clang-tidy \
9+
wget \
10+
curl \
11+
git \
12+
gcc-11 \
13+
g++-11\
14+
lcov\
15+
&& rm -rf /var/lib/apt/lists/*
16+
17+
RUN wget https://github.com/Kitware/CMake/releases/download/v3.22.5/cmake-3.22.5-linux-x86_64.sh \
18+
&& chmod +x cmake-3.22.5-linux-x86_64.sh \
19+
&& ./cmake-3.22.5-linux-x86_64.sh --skip-license --prefix=/usr/local \
20+
&& rm cmake-3.22.5-linux-x86_64.sh
21+
22+
RUN wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 \
23+
&& tar -xjf gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 -C /usr/local \
24+
&& rm gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 \
25+
&& ln -s /usr/local/gcc-arm-none-eabi-10.3-2021.10/bin/* /usr/local/bin/
26+
27+
RUN mkdir -p /root/.local/bin
28+
29+
RUN curl -L https://github.com/numtide/treefmt/releases/download/v2.1.0/treefmt_2.1.0_linux_amd64.tar.gz -o treefmt.tar.gz \
30+
&& tar -xvzf treefmt.tar.gz \
31+
&& install -m 755 treefmt /root/.local/bin/treefmt \
32+
&& rm LICENSE README.md treefmt treefmt.tar.gz
33+
34+
RUN curl -L https://github.com/muttleyxd/clang-tools-static-binaries/releases/download/master-32d3ac78/clang-format-17_linux-amd64 -o /root/.local/bin/clang-format && \
35+
chmod +x /root/.local/bin/clang-format
36+
37+
ENV PATH="/root/.local/bin:$PATH"
38+
39+
RUN pip3 install cmakelang
40+
41+
RUN echo 'export HISTFILE=/root/.bash_history/history' >> /root/.bashrc

docker/Dockerfile.docs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM ubuntu:22.04
2+
3+
RUN apt-get update && apt-get install -y python3.10 python3-pip openjdk-11-jdk graphviz \
4+
doxygen\
5+
wget \
6+
&& rm -rf /var/lib/apt/lists/*
7+
8+
COPY ../doc/requirements.txt .
9+
10+
RUN pip3 install --no-cache-dir -r requirements.txt
11+
12+
RUN wget https://sourceforge.net/projects/plantuml/files/plantuml.jar/download -O /usr/local/bin/plantuml.jar \
13+
&& echo '#!/bin/sh\njava -jar /usr/local/bin/plantuml.jar "$@"' > /usr/local/bin/plantuml && \
14+
chmod +x /usr/local/bin/plantuml
15+
16+
RUN pip3 install coverxygen
17+
18+
RUN echo 'export HISTFILE=/root/.bash_history/history' >> /root/.bashrc

docker/README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Docker Information
2+
3+
Developer Dockerfile can be used to set up the development environment.
4+
It includes all the necessary tools, libraries, and dependencies required
5+
for development. This ensures that all developers work in a consistent
6+
environment, reducing the "it works on my machine" problem.
7+
Documentation Dockerfile is used to build project's documentation.
8+
9+
Project uses Docker Compose to manage both the Developer Dockerfile and the
10+
Documentation Dockerfile. Docker Compose simplifies the process of building
11+
and running multiple Docker containers, ensuring that both the development
12+
environment and the documentation container are consistently set up and managed.
13+
14+
## Build the docker image
15+
16+
If you have docker compose installed, you can use this command
17+
18+
docker-compose -f docker/docker-compose.yaml build
19+
20+
If you do not want to use docker compose, you can use this command instead
21+
22+
docker build -f docker/<dockerfile_name> -t <image_name> .
23+
24+
This will build the image from the Dockerfile in the current directory (the `.`).
25+
26+
## Run the docker container
27+
28+
If you have docker compose installed, the easiest way is to call
29+
30+
docker compose -f docker/docker-compose.yaml run <service_name>
31+
32+
If you do not want to use docker compose, you can use this command instead
33+
34+
docker run -it --rm -v $PWD:$PWD --workdir $PWD <image_name>
35+
36+
This command creates the docker container and enters it (`-it` for interactive).
37+
The container will be removed when you leave it again (`--rm`).
38+
Your current directory is mounted into the container. This is set up as the working
39+
directory in the container (`-v $PWD:$PWD --workdir $PWD`).

docker/docker-compose.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
version: '3'
2+
services:
3+
dev:
4+
build:
5+
context: ..
6+
dockerfile: docker/Dockerfile.dev
7+
working_dir:
8+
/usr/src
9+
volumes:
10+
- ..:/usr/src
11+
- ../.docker_history:/root/.bash_history
12+
command: /bin/bash
13+
tty: true
14+
15+
docs:
16+
build:
17+
context: ..
18+
dockerfile: docker/Dockerfile.docs
19+
working_dir:
20+
/usr/src
21+
volumes:
22+
- ..:/usr/src
23+
- ../.docker_history:/root/.bash_history
24+
command: /bin/bash
25+
tty: true

executables/referenceApp/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ endif ()
2525

2626
message(STATUS "Target platform: <${BUILD_TARGET_PLATFORM}>")
2727

28-
if (BUILD_TARGET_PLATFORM STREQUAL "POSIX")
28+
if (BUILD_TARGET_PLATFORM STREQUAL "POSIX" AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
2929
set(PLATFORM_SUPPORT_CAN
3030
ON
3131
CACHE BOOL "Turn CAN support on or off" FORCE)
@@ -59,6 +59,10 @@ if (PLATFORM_SUPPORT_IO)
5959
add_compile_definitions(PLATFORM_SUPPORT_IO=1)
6060
endif ()
6161

62+
if (PLATFORM_SUPPORT_WATCHDOG)
63+
add_compile_definitions(PLATFORM_SUPPORT_WATCHDOG=1)
64+
endif ()
65+
6266
include(${OPENBSW_DIR}/Filelists.cmake)
6367

6468
# Configure async and freeRtos libs depending on build type.

executables/referenceApp/application/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ add_executable(
2222
src/systems/DemoSystem.cpp
2323
src/systems/RuntimeSystem.cpp
2424
src/systems/SysAdminSystem.cpp
25+
src/systems/SafetySystem.cpp
2526
${app.referenceAppExtraSources}
2627
src/main.cpp)
2728

@@ -55,6 +56,7 @@ target_link_libraries(
5556
util
5657
udsConfigurationImpl
5758
runtime
59+
safeLifecycle
5860
socBsp)
5961

6062
if (PLATFORM_SUPPORT_UDS)

0 commit comments

Comments
 (0)