Skip to content

Commit

Permalink
move NUM_OF_CAN_BUSES from toolchain to the root cmake file
Browse files Browse the repository at this point in the history
  • Loading branch information
PonomarevDA committed Dec 19, 2024
1 parent 45f12a5 commit 7cbd75c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ elseif(USE_PLATFORM_NODE_V3)
set(APP_PLATFORM stm32g0b1)
set(PLATFORM_NAME v3)
include(${CMAKE_DIR}/stm32g0b1.cmake)
add_compile_definitions(CYPHAL_NUM_OF_CAN_BUSES=2)
else()
message(SEND_ERROR "Platform Error: Either v2 (stm32f103), v3 (stm32g0) or SITL (Linux) should be specified.")
endif()

# Option 2. Choose the protocol
if(CAN_PROTOCOL STREQUAL "dronecan" OR CAN_PROTOCOL STREQUAL "cyphal" OR CAN_PROTOCOL STREQUAL "both")
set(APPLICATION_DIR ${ROOT_DIR}/Src/applications/${CAN_PROTOCOL})
else()
message(SEND_ERROR "CAN_PROTOCOL is unknown.")
set(APPLICATION_DIR ${ROOT_DIR}/Src/applications/${CAN_PROTOCOL})
if(NOT (EXISTS ${APPLICATION_DIR} AND IS_DIRECTORY ${APPLICATION_DIR}))
message(FATAL_ERROR "CAN_PROTOCOL '${CAN_PROTOCOL}' is unknown.")
endif()

# Set build dir based on hardware version and protocol
Expand Down
2 changes: 0 additions & 2 deletions cmake/Toolchain-arm-none-eabi.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,4 @@ set(CMAKE_EXE_LINKER_FLAGS "-mcpu=${TARGET_ARCHITECTURE} -mthumb -lc -lm -lnosys
add_compile_definitions(
USE_HAL_DRIVER
${CPU}
CYPHAL_NUM_OF_CAN_BUSES=2
NUM_OF_CAN_BUSES=2
)

0 comments on commit 7cbd75c

Please sign in to comment.