d56254d190
- Remove RC_ctrl_t and RemoteControlInit from robot_cmd.c - Delete GIMBAL_ZERO_FORCE, gimbal_mode_e, Robot_Status_e from robot_def.h - Remove EmergencyHandler and robot_state from robot_cmd.c - Remove emergency commands from master_machine.h - Remove remote_control and can_comm from CMakeLists.txt
166 lines
4.1 KiB
CMake
166 lines
4.1 KiB
CMake
cmake_minimum_required(VERSION 3.22)
|
|
|
|
#
|
|
# This file is generated only once,
|
|
# and is not re-generated if converter is called multiple times.
|
|
#
|
|
# User is free to modify the file as much as necessary
|
|
#
|
|
|
|
# Setup compiler settings
|
|
set(CMAKE_C_STANDARD 11)
|
|
set(CMAKE_C_STANDARD_REQUIRED ON)
|
|
set(CMAKE_C_EXTENSIONS ON)
|
|
|
|
|
|
# Define the build type
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
set(CMAKE_BUILD_TYPE "Debug")
|
|
endif()
|
|
|
|
# Set the project name
|
|
set(CMAKE_PROJECT_NAME Basic_Framework_MC02)
|
|
|
|
# Enable compile command to ease indexing with e.g. clangd
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
|
|
|
|
# Core project settings
|
|
project(${CMAKE_PROJECT_NAME})
|
|
message("Build type: " ${CMAKE_BUILD_TYPE})
|
|
|
|
# Enable CMake support for ASM and C languages
|
|
enable_language(C ASM)
|
|
|
|
# Create an executable object type
|
|
add_executable(${CMAKE_PROJECT_NAME})
|
|
|
|
# Add STM32CubeMX generated sources
|
|
add_subdirectory(cmake/stm32cubemx)
|
|
|
|
# Link directories setup
|
|
target_link_directories(${CMAKE_PROJECT_NAME} PRIVATE
|
|
Drivers/CMSIS/DSP/Lib/GCC
|
|
)
|
|
|
|
# Add sources to executable
|
|
target_sources(${CMAKE_PROJECT_NAME} PRIVATE
|
|
# FreeRTOS
|
|
Middlewares/Third_Party/FreeRTOS/Source/croutine.c
|
|
Middlewares/Third_Party/FreeRTOS/Source/event_groups.c
|
|
Middlewares/Third_Party/FreeRTOS/Source/list.c
|
|
Middlewares/Third_Party/FreeRTOS/Source/queue.c
|
|
Middlewares/Third_Party/FreeRTOS/Source/stream_buffer.c
|
|
Middlewares/Third_Party/FreeRTOS/Source/tasks.c
|
|
Middlewares/Third_Party/FreeRTOS/Source/timers.c
|
|
Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.c
|
|
Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c
|
|
Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c
|
|
|
|
# SEGGER RTT
|
|
Middlewares/Third_Party/SEGGER/RTT/SEGGER_RTT_printf.c
|
|
Middlewares/Third_Party/SEGGER/RTT/SEGGER_RTT.c
|
|
Middlewares/Third_Party/SEGGER/RTT/SEGGER_RTT_ASM_ARMv7M.s
|
|
|
|
# Core (CubeMX generated but not in stm32cubemx)
|
|
Core/Src/freertos.c
|
|
|
|
# bsp
|
|
bsp/dwt/bsp_dwt.c
|
|
bsp/pwm/bsp_pwm.c
|
|
bsp/gpio/bsp_gpio.c
|
|
bsp/spi/bsp_spi.c
|
|
bsp/iic/bsp_iic.c
|
|
bsp/can/bsp_can.c
|
|
bsp/usart/bsp_usart.c
|
|
bsp/log/bsp_log.c
|
|
bsp/bsp_tools.c
|
|
|
|
# modules - algorithm
|
|
modules/algorithm/controller.c
|
|
modules/algorithm/kalman_filter.c
|
|
modules/algorithm/QuaternionEKF.c
|
|
modules/algorithm/crc8.c
|
|
modules/algorithm/crc16.c
|
|
modules/algorithm/user_lib.c
|
|
# modules - sensors
|
|
modules/BMI088/bmi088.c
|
|
modules/imu/BMI088driver.c
|
|
modules/imu/BMI088Middleware.c
|
|
modules/imu/ins_task.c
|
|
# modules - communication
|
|
modules/master_machine/master_machine.c
|
|
modules/timachine/board_comm.c
|
|
# modules - motor
|
|
modules/motor/DMmotor/dmmotor.c
|
|
modules/motor/motor_task.c
|
|
# modules - system
|
|
modules/message_center/message_center.c
|
|
modules/daemon/daemon.c
|
|
modules/alarm/buzzer.c
|
|
modules/vofa/vofa.c
|
|
|
|
# application
|
|
application/gimbal/gimbal.c
|
|
application/cmd/robot_cmd.c
|
|
application/robot.c
|
|
)
|
|
|
|
# Add include paths
|
|
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE
|
|
# FreeRTOS
|
|
Middlewares/Third_Party/FreeRTOS/Source/include
|
|
Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS
|
|
Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F
|
|
|
|
# SEGGER RTT
|
|
Middlewares/Third_Party/SEGGER/RTT
|
|
Middlewares/Third_Party/SEGGER/Config
|
|
|
|
# bsp
|
|
bsp/dwt
|
|
bsp/can
|
|
bsp/usart
|
|
bsp/gpio
|
|
bsp/spi
|
|
bsp/iic
|
|
bsp/log
|
|
bsp/pwm
|
|
bsp
|
|
|
|
# modules
|
|
modules/algorithm
|
|
modules/BMI088
|
|
modules/imu
|
|
modules/master_machine
|
|
modules/motor/DMmotor
|
|
modules/motor
|
|
modules/message_center
|
|
modules/daemon
|
|
modules/alarm
|
|
modules/vofa
|
|
modules/timachine
|
|
modules
|
|
|
|
# application
|
|
application/gimbal
|
|
application/cmd
|
|
application
|
|
)
|
|
|
|
# Add project symbols (macros)
|
|
target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE
|
|
ARM_MATH_CM7
|
|
)
|
|
|
|
# Remove wrong libob.a library dependency when using cpp files
|
|
list(REMOVE_ITEM CMAKE_C_IMPLICIT_LINK_LIBRARIES ob)
|
|
|
|
# Add linked libraries
|
|
target_link_libraries(${CMAKE_PROJECT_NAME}
|
|
stm32cubemx
|
|
c
|
|
m
|
|
nosys
|
|
arm_cortexM7lfdp_math
|
|
)
|