Skip to content

Commit

Permalink
update:
Browse files Browse the repository at this point in the history
- CMakeLists.txt
- Libs/libparams
- Libs/Cyphal
- update dronecan parameters to the new style
- fix dronecan workflow
  • Loading branch information
PonomarevDA committed Nov 14, 2023
1 parent 8a0834b commit e99920f
Show file tree
Hide file tree
Showing 14 changed files with 49 additions and 72 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.ACCESS_TOKEN }}
submodules: recursive
fetch-depth: 0

Expand All @@ -47,7 +46,7 @@ jobs:
fetch-depth: 0

- name: Checkout libsqcan
run: cd Libs/libsqcan && git checkout dd10256
run: cd Libs/libsqcan && git checkout f0ecb09

- name: Install dependencies
run: ./scripts/tools/install_for_ubuntu.sh --yes
Expand Down
28 changes: 17 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,26 @@ else()
Libs/Cyphal/Libs/o1heap/o1heap
build/nunavut_out
)
set(cyphalRegisters ${CMAKE_CURRENT_LIST_DIR}/Libs/Cyphal/Cyphal/params.yaml)
set(libparamsParameters ${CMAKE_CURRENT_LIST_DIR}/Libs/Cyphal/Cyphal/params.yaml)
include(Src/cyphal_application/CMakeLists.txt)
list(APPEND applicationSourceCode
build/src/params.cpp
build/src/string_params.cpp
)
endif()

execute_process(
COMMAND mkdir -p ${CMAKE_CURRENT_LIST_DIR}/build/src
COMMAND_ERROR_IS_FATAL ANY
)
execute_process(
COMMAND ${CMAKE_CURRENT_LIST_DIR}/Libs/libparams/scripts/generate_params.py --out-dir ${CMAKE_CURRENT_LIST_DIR}/build/src -f ${libparamsParameters}
COMMAND_ERROR_IS_FATAL ANY
)
execute_process(
COMMAND ${CMAKE_CURRENT_LIST_DIR}/Libs/libparams/scripts/generate_docs.py ${libparamsParameters}
COMMAND_ERROR_IS_FATAL ANY
)

list(APPEND applicationSourceCode
build/src/params.cpp
)

set(TOOLCHAIN_PREFIX arm-none-eabi-)
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}gcc)
Expand Down Expand Up @@ -115,12 +127,6 @@ target_link_options(${EXECUTABLE} PRIVATE
-Wl,--gc-sections
)

if(NOT USE_DRONECAN)
execute_process(
COMMAND ${CMAKE_CURRENT_LIST_DIR}/scripts/prebuild_cyphal.sh ${cyphalRegisters}
)
endif()

add_custom_command(TARGET ${EXECUTABLE}
POST_BUILD
COMMAND arm-none-eabi-size ${EXECUTABLE}
Expand Down
2 changes: 1 addition & 1 deletion Libs/Cyphal
2 changes: 1 addition & 1 deletion Libs/libparams
Submodule libparams updated 51 files
+11 −7 .github/workflows/build.yml
+1 −1 .github/workflows/sonarcloud.yml
+43 −4 Makefile
+77 −22 README.md
+1 −3 libparams/rom.c
+4 −4 libparams/storage.c
+4 −4 libparams/storage.h
+7 −0 platform_specific/README.md
+1 −1 platform_specific/stm32f103/README.md
+14 −1 platform_specific/stm32f103/flash_driver.c
+5 −1 platform_specific/stm32f103/flash_driver.h
+13 −1 platform_specific/stm32g0b1/flash_driver.c
+5 −1 platform_specific/stm32g0b1/flash_driver.h
+10 −5 platform_specific/ubuntu/README.md
+42 −13 platform_specific/ubuntu/flash_driver.cpp
+5 −1 platform_specific/ubuntu/flash_driver.h
+2 −0 scripts/_constants.py
+113 −0 scripts/generate_params.py
+2 −1 scripts/params.py
+2 −2 scripts/params_generate_array_from_yaml.py
+0 −5 tests/baro.yaml
+0 −9 tests/install_gtest.sh
+0 −2 tests/mag.yaml
+29 −0 tests/params_generator/CMakeLists.txt
+5 −0 tests/params_generator/c/baro.yaml
+2 −0 tests/params_generator/c/mag.yaml
+9 −0 tests/params_generator/cpp/baro.yaml
+4 −0 tests/params_generator/cpp/mag.yaml
+2 −3 tests/params_generator/test.cpp
+0 −26 tests/params_generator_c/CMakeLists.txt
+0 −20 tests/params_generator_c/test.sh
+0 −26 tests/params_generator_cpp/CMakeLists.txt
+0 −76 tests/params_generator_cpp/test.cpp
+0 −18 tests/params_generator_cpp/test.sh
+9 −8 tests/platform_specific/stm32f103/Makefile
+0 −0 tests/platform_specific/stm32f103/application.c
+0 −0 tests/platform_specific/stm32f103/main.c
+0 −0 tests/platform_specific/stm32f103/main.h
+11 −10 tests/platform_specific/stm32g0b1/Makefile
+0 −0 tests/platform_specific/stm32g0b1/application.c
+0 −0 tests/platform_specific/stm32g0b1/main.c
+0 −0 tests/platform_specific/stm32g0b1/main.h
+42 −0 tests/platform_specific/ubuntu/CMakeLists.txt
+10 −0 tests/platform_specific/ubuntu/default_params.yaml
+40 −0 tests/platform_specific/ubuntu/main.cpp
+36 −0 tests/platform_specific/ubuntu/params.yaml
+0 −0 tests/unit_tests/Makefile
+0 −0 tests/unit_tests/README.md
+0 −0 tests/unit_tests/test_flash_driver.cpp
+0 −0 tests/unit_tests/test_rom.cpp
+0 −0 tests/unit_tests/test_storage.cpp
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ cyphal: clean autogenerate_git_related_headers
mkdir -p ${BUILD_OBJ_DIR}
cd ${BUILD_OBJ_DIR} && cmake ../.. && make

dronecan: clean autogenerate_git_related_headers
dronecan: clean
mkdir -p ${BUILD_OBJ_DIR}
cd ${BUILD_OBJ_DIR} && cmake -DUSE_DRONECAN=1 ../.. && make

Expand Down
2 changes: 1 addition & 1 deletion Src/cyphal_application/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set(applicationHeaders
Src/cyphal_application
)

list(APPEND cyphalRegisters
list(APPEND libparamsParameters
${CMAKE_CURRENT_LIST_DIR}/params.yaml
${CMAKE_CURRENT_LIST_DIR}/setpoint/params.yaml
${CMAKE_CURRENT_LIST_DIR}/feedback/params.yaml
Expand Down
1 change: 0 additions & 1 deletion Src/cyphal_application/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "cyphal.hpp"
#include "cyphal_registers.hpp"
#include "main.h"
#include "string_params.hpp"
#include "params.hpp"
#include "setpoint/setpoint.hpp"
#include "feedback/feedback.hpp"
Expand Down
15 changes: 14 additions & 1 deletion Src/dronecan_application/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,22 @@ set(applicationSourceCode
Src/periphery/led/led.cpp

Src/dronecan_application/application.cpp
Src/dronecan_application/params.cpp
)
set(applicationHeaders
Src
Src/dronecan_application
)

list(APPEND libparamsParameters
${CMAKE_CURRENT_LIST_DIR}/params.yaml
)

execute_process(
COMMAND git rev-parse --short=8 HEAD
OUTPUT_VARIABLE ret
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message("GIT_HASH=0x${ret}")
add_definitions(-DGIT_HASH=0x${ret})
add_definitions(-DAPP_VERSION_MAJOR=0)
add_definitions(-DAPP_VERSION_MINOR=2)
1 change: 0 additions & 1 deletion Src/dronecan_application/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "uavcan_application.h"
#include "main.h"
#include "params.hpp"
#include "string_params.hpp"
#include "storage.h"

void application_entry_point() {
Expand Down
17 changes: 0 additions & 17 deletions Src/dronecan_application/params.cpp

This file was deleted.

16 changes: 0 additions & 16 deletions Src/dronecan_application/params.hpp

This file was deleted.

13 changes: 13 additions & 0 deletions Src/dronecan_application/params.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
uavcan.node.id:
type: Integer
enum: PARAM_UAVCAN_NODE_ID
flags: mutable
default: 50
min: 0
max: 127

uavcan.node.name:
type: String
enum: PARAM_UAVCAN_NODE_NAME
flags: mutable
default: ""
6 changes: 0 additions & 6 deletions Src/dronecan_application/string_params.hpp

This file was deleted.

13 changes: 0 additions & 13 deletions scripts/prebuild_cyphal.sh

This file was deleted.

0 comments on commit e99920f

Please sign in to comment.