xlsw_3dp_ultrasonic_300K/CMakeLists.txt
yelvlab 485122c6df 用gd32e230的stdlib重写wbh的参考代码,并因为stm的stdlib和gd32的stdlib有很大差异,超时机制与flag验证差异较大,通过对比重新编写。
数据计算方式重新书写,两个8位数据的合并方式修改为位移,并且整体放大100倍(标准数据为((Data[1] << 8) | Data[0]) * 0.02 - 273.15)
2024-10-08 16:28:47 +08:00

34 lines
977 B
CMake

cmake_minimum_required(VERSION 3.28)
include(cmake/toolchain.cmake)
project(xlsw_3dp_ultrasonic_300K)
enable_language(C)
enable_language(CXX)
enable_language(ASM)
# Use custom startup.S
set(TARGET_STARTUP_ASM ${CMAKE_SOURCE_DIR}/startup/startup_gd32e23x.S)
# Use custom linker script
set(TARGET_LD_SCRIPT ${CMAKE_SOURCE_DIR}/ld/gd32e23x_gcc.ld)
# Add GD SDK
add_subdirectory(sdk)
set(TARGET_C_SRC
${CMAKE_SOURCE_DIR}/src/main.c
${CMAKE_SOURCE_DIR}/src/gd32e23x_it.c
${CMAKE_SOURCE_DIR}/src/systick.c
${CMAKE_SOURCE_DIR}/src/ultrasonic_driver.c
${CMAKE_SOURCE_DIR}/src/mlx90614.c
# ${CMAKE_SOURCE_DIR}/src/gd32e23x_hw_i2c.c
)
add_executable(xlsw_3dp_ultrasonic_300K ${TARGET_C_SRC})
target_link_libraries(xlsw_3dp_ultrasonic_300K GD32E23X_SDK)
target_include_directories(xlsw_3dp_ultrasonic_300K PUBLIC inc)
# Generate .bin and .hex
generate_binary_file(xlsw_3dp_ultrasonic_300K)
generate_hex_file(xlsw_3dp_ultrasonic_300K)