Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

clean up #95

Merged
merged 2 commits into from
Dec 19, 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
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
8 changes: 8 additions & 0 deletions Src/drivers/mpu9250/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Copyright (C) 2023 Dmitry Ponomarev <ponomarevda96@gmail.com>
# Distributed under the terms of the GPL v3 license, available in the file LICENSE.

# Include guard
if(SRC_DRIVERS_MPU9250_DIR)
return()
endif()
set(SRC_DRIVERS_MPU9250_DIR ${CMAKE_CURRENT_LIST_DIR})

list(APPEND APPLICATION_SOURCES
${CMAKE_CURRENT_LIST_DIR}/mpu9250.cpp
)

include(${ROOT_DIR}/Src/peripheral/spi/CMakeLists.txt)
1 change: 0 additions & 1 deletion Src/platform/stm32g0b1/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ cmake_path(GET CMAKE_CURRENT_LIST_DIR PARENT_PATH PLATFORM_DIR)
cmake_path(GET PLATFORM_DIR PARENT_PATH SRC_DIR)
cmake_path(GET SRC_DIR PARENT_PATH ROOT_DIR)

include(${ROOT_DIR}/Src/peripheral/spi/CMakeLists.txt)
include(${ROOT_DIR}/Src/peripheral/adc/CMakeLists.txt)

set(EXECUTABLE ${PROJECT_NAME}.out)
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
)