aboutsummaryrefslogtreecommitdiff
path: root/apps/cpp1/CMakeLists.txt
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2016-01-04 23:53:44 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2016-01-04 23:53:44 +0100
commitec96951943921b57ef9c1e9dacb63e34716fe5b7 (patch)
treec85d1c0a063712459ad12144900eb522b39ef7a0 /apps/cpp1/CMakeLists.txt
parentbaedda497d16c5096971eee83a0c467fe663fe6d (diff)
downloadstm32f103-playground-ec96951943921b57ef9c1e9dacb63e34716fe5b7.tar.gz
stm32f103-playground-ec96951943921b57ef9c1e9dacb63e34716fe5b7.tar.bz2
stm32f103-playground-ec96951943921b57ef9c1e9dacb63e34716fe5b7.tar.xz
stm32f103-playground-ec96951943921b57ef9c1e9dacb63e34716fe5b7.zip
o Actually working implementation of context switching.
It is important to remember to update the stack to the task descriptor on every switch!
Diffstat (limited to 'apps/cpp1/CMakeLists.txt')
-rw-r--r--apps/cpp1/CMakeLists.txt19
1 files changed, 19 insertions, 0 deletions
diff --git a/apps/cpp1/CMakeLists.txt b/apps/cpp1/CMakeLists.txt
new file mode 100644
index 0000000..2580535
--- /dev/null
+++ b/apps/cpp1/CMakeLists.txt
@@ -0,0 +1,19 @@
+add_executable(cpp1.elf cpp1.cpp
+ ${STM32F10X_STDPERIPH_LIB}/Libraries/CMSIS/CM3/CoreSupport/core_cm3.c
+ ${STM32F10X_STDPERIPH_LIB}/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x/system_stm32f10x.c
+ ${STM32F10X_STDPERIPH_LIB}/Libraries/STM32F10x_StdPeriph_Driver/src/misc.c
+ ${STM32F10X_STDPERIPH_LIB}/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_rcc.c
+ ${STM32F10X_STDPERIPH_LIB}/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_spi.c
+ ${STM32F10X_STDPERIPH_LIB}/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_gpio.c
+ ${STM32F10X_STDPERIPH_LIB}/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_dma.c
+ $<TARGET_OBJECTS:playground>
+ )
+
+target_include_directories(cpp1.elf PUBLIC
+ $<TARGET_PROPERTY:playground,INTERFACE_INCLUDE_DIRECTORIES>
+ )
+target_compile_definitions(cpp1.elf PUBLIC ${STM32F10X_STDPERIPH_DEFINES})
+target_link_libraries(cpp1.elf tinyprintf)
+
+set_target_properties(cpp1.elf PROPERTIES LINK_FLAGS "-nostartfiles -T${CMAKE_SOURCE_DIR}/cmake/stm32.ld")
+add_extra_commands(cpp1.elf)