mirror of
https://git.aixiao.me/aixiao/Danger-alarm.git
synced 2025-07-29 19:13:39 +08:00
initial
This commit is contained in:
79
SOFTWARE-FreeRTOS/CMakeLists.txt
Normal file
79
SOFTWARE-FreeRTOS/CMakeLists.txt
Normal file
@@ -0,0 +1,79 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
# Check if the environment variable PICO_SDK_PATH is set
|
||||
if(DEFINED ENV{PICO_SDK_PATH})
|
||||
set(PICO_SDK_PATH $ENV{PICO_SDK_PATH})
|
||||
else()
|
||||
message(FATAL_ERROR "Environment variable PICO_SDK_PATH is not set. Please set it to the path of the pico-sdk.")
|
||||
endif()
|
||||
|
||||
# Include the Pico SDK
|
||||
include(pico_sdk_import.cmake)
|
||||
|
||||
# Pull in FreeRTOS
|
||||
set( FREERTOS_KERNEL_PATH "../FreeRTOS-Kernel" )
|
||||
include(FreeRTOS_Kernel_import.cmake)
|
||||
|
||||
project(main CXX C ASM)
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
pico_sdk_init()
|
||||
|
||||
|
||||
add_subdirectory(
|
||||
../SOFTWARE/Lib/pico-onewire
|
||||
${CMAKE_BINARY_DIR}/pico-onewire
|
||||
)
|
||||
|
||||
|
||||
add_executable(
|
||||
main
|
||||
)
|
||||
|
||||
pico_generate_pio_header(main ${CMAKE_CURRENT_LIST_DIR}/Source/uart_tx.pio)
|
||||
pico_generate_pio_header(main ${CMAKE_CURRENT_LIST_DIR}/Source/uart_rx.pio)
|
||||
|
||||
target_Sources(main PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}/Source/common.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/Source/main.c
|
||||
|
||||
)
|
||||
|
||||
target_include_directories(main PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
${CMAKE_CURRENT_LIST_DIR}/Source
|
||||
${CMAKE_CURRENT_LIST_DIR}/Common/include
|
||||
)
|
||||
|
||||
target_compile_options(main PUBLIC
|
||||
### Gnu/Clang C Options
|
||||
$<$<COMPILE_LANG_AND_ID:C,GNU>:-fdiagnostics-color=always>
|
||||
$<$<COMPILE_LANG_AND_ID:C,Clang>:-fcolor-diagnostics>
|
||||
|
||||
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wall>
|
||||
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wextra>
|
||||
#$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Werror>
|
||||
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Weverything>
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
main
|
||||
pico_one_wire
|
||||
FreeRTOS-Kernel
|
||||
FreeRTOS-Kernel-Heap4
|
||||
pico_stdlib
|
||||
pico_util
|
||||
pico_runtime
|
||||
pico_multicore
|
||||
hardware_rtc
|
||||
hardware_i2c
|
||||
hardware_uart
|
||||
hardware_pwm
|
||||
hardware_adc
|
||||
hardware_pio
|
||||
)
|
||||
|
||||
pico_enable_stdio_uart(main 1)
|
||||
pico_enable_stdio_usb(main 1)
|
||||
pico_add_extra_outputs(main)
|
||||
Reference in New Issue
Block a user