some learning code trying to use libopencm3 to read values from dht11 temperature sensor
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

37 lines
910 B

cmake_minimum_required(VERSION 3.19)
project(dht_test LANGUAGES C)
set(LIBOPENCM3_DIR ${CMAKE_SOURCE_DIR}/libopencm3)
set(CMAKE_C_STANDARD 99)
add_compile_options(
-Wall
-Wextra -Wshadow -Wno-unused-variable -Wimplicit-function-declaration
-Wredundant-decls -Wstrict-prototypes -Wmissing-prototypes
-ggdb3
-O0
)
add_link_options(
)
add_compile_definitions(
STM32F1
STM32F103C8T6
DEBUG
)
add_executable(dht_test main.c)
set_target_properties(dht_test PROPERTIES SUFFIX .elf)
add_custom_target(libopencm3 make TARGETS=stm32/f1 -j8 WORKING_DIRECTORY ${LIBOPENCM3_DIR})
#link_directories(${LIBOPENCM3_DIR}/lib)
target_link_libraries(dht_test PUBLIC ${LIBOPENCM3_DIR}/lib/libopencm3_stm32f1.a)
add_subdirectory(RTT)
target_link_libraries(dht_test PUBLIC RTT)
target_include_directories(dht_test PUBLIC
RTT ${LIBOPENCM3_DIR}/include
)