removed unity, hal and cmsis stuff
This commit is contained in:
parent
ff3c54963b
commit
f98fb7dc2e
7
notes.md
7
notes.md
|
@ -22,7 +22,8 @@ build an flashable binary that blinks an led correctly on my
|
||||||
development board.
|
development board.
|
||||||
|
|
||||||
- [X] Remove RTOS stuff
|
- [X] Remove RTOS stuff
|
||||||
- [ ] Remove CMSIS stuff
|
- [X] Remove CMSIS stuff
|
||||||
- [ ] Remove Unity test framework stuff.
|
- [X] Remove Unity test framework stuff.
|
||||||
- [ ] Remove HAL stuff.
|
- [X] Remove HAL stuff.
|
||||||
|
- [ ] Check through debuging flags in toolchain file.
|
||||||
|
|
||||||
|
|
|
@ -50,22 +50,6 @@ set(LINKER_SCRIPT linker.ld)
|
||||||
#set(PROGRAMMER serialupdi)
|
#set(PROGRAMMER serialupdi)
|
||||||
#set(PORT /dev/ttyU0)
|
#set(PORT /dev/ttyU0)
|
||||||
|
|
||||||
#-------------------
|
|
||||||
# HAL Setup
|
|
||||||
#-------------------
|
|
||||||
# Select 1 if STM32 HAL library is to be used. This will add -DUSE_HAL_DRIVER=1 to the CFLAGS
|
|
||||||
# If enabled then set the correct path of the HAL Driver folder
|
|
||||||
#set(USE_HAL = 1
|
|
||||||
#ifeq (1,$(USE_HAL))
|
|
||||||
set(HAL_DIR components/STM32F4xx_HAL_Driver)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#-------------------
|
|
||||||
# CMSIS Setup
|
|
||||||
#-------------------
|
|
||||||
# Set the path to the CMSIS folder
|
|
||||||
#set(CMSIS_DIR components/CMSIS/CMSIS)
|
|
||||||
|
|
||||||
##################################################
|
##################################################
|
||||||
# Advanced Section
|
# Advanced Section
|
||||||
##################################################
|
##################################################
|
||||||
|
@ -105,6 +89,10 @@ set(CMAKE_EXE_LINKER_FLAGS " \
|
||||||
#------------------
|
#------------------
|
||||||
# Debug Flags
|
# Debug Flags
|
||||||
#------------------
|
#------------------
|
||||||
|
|
||||||
|
# "-Og":: Optimizes for debugging expirence.
|
||||||
|
# "-g":: Debugging options
|
||||||
|
# "-gdwarf-3"::
|
||||||
set(CMAKE_C_FLAGS_DEBUG "-Og -g -gdwarf-3 -gstrict-dwarf " CACHE INTERNAL "C Compiler options for debug build type")
|
set(CMAKE_C_FLAGS_DEBUG "-Og -g -gdwarf-3 -gstrict-dwarf " CACHE INTERNAL "C Compiler options for debug build type")
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "-Og -g -gdwarf-3 -gstrict-dwarf " CACHE INTERNAL "C++ Compiler options for debug build type")
|
set(CMAKE_CXX_FLAGS_DEBUG "-Og -g -gdwarf-3 -gstrict-dwarf " CACHE INTERNAL "C++ Compiler options for debug build type")
|
||||||
set(CMAKE_ASM_FLAGS_DEBUG "-Og -g -gdwarf-3 -gstrict-dwarf " CACHE INTERNAL "ASM Compiler options for debug build type")
|
set(CMAKE_ASM_FLAGS_DEBUG "-Og -g -gdwarf-3 -gstrict-dwarf " CACHE INTERNAL "ASM Compiler options for debug build type")
|
||||||
|
@ -225,29 +213,6 @@ if(TARGET_GROUP STREQUAL production)
|
||||||
# @Brief: Build the actual elf file of the project
|
# @Brief: Build the actual elf file of the project
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
#-------------------
|
|
||||||
# HAL library
|
|
||||||
#-------------------
|
|
||||||
file(GLOB HAL_SRC
|
|
||||||
"${HAL_DIR}/Src/*.c"
|
|
||||||
)
|
|
||||||
add_library(hal STATIC
|
|
||||||
${HAL_SRC}
|
|
||||||
)
|
|
||||||
target_include_directories(hal
|
|
||||||
PUBLIC
|
|
||||||
${HAL_DIR}/Inc
|
|
||||||
${MCU_DIR}/Include
|
|
||||||
#${CMSIS_DIR}/Core/Include
|
|
||||||
PRIVATE
|
|
||||||
${PROJECT_SOURCE_DIR}/include
|
|
||||||
)
|
|
||||||
target_compile_definitions(hal
|
|
||||||
PUBLIC
|
|
||||||
${MCU}
|
|
||||||
HSE_VALUE=${HSE_VAL}
|
|
||||||
)
|
|
||||||
|
|
||||||
#-------------------
|
#-------------------
|
||||||
# Main elf
|
# Main elf
|
||||||
#-------------------
|
#-------------------
|
||||||
|
@ -332,29 +297,6 @@ if(TARGET_GROUP STREQUAL production)
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/html"
|
"${CMAKE_CURRENT_BINARY_DIR}/html"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/latex"
|
"${CMAKE_CURRENT_BINARY_DIR}/latex"
|
||||||
)
|
)
|
||||||
|
|
||||||
elseif(TARGET_GROUP STREQUAL test)
|
|
||||||
|
|
||||||
add_library(unity STATIC
|
|
||||||
components/unity/unity.c
|
|
||||||
)
|
|
||||||
|
|
||||||
target_include_directories(unity PUBLIC
|
|
||||||
components/unity/
|
|
||||||
)
|
|
||||||
|
|
||||||
enable_testing()
|
|
||||||
include(CTest)
|
|
||||||
add_subdirectory(test)
|
|
||||||
|
|
||||||
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
|
|
||||||
include(CodeCoverage)
|
|
||||||
setup_target_for_coverage_lcov(
|
|
||||||
NAME coverage
|
|
||||||
EXCLUDE "/usr/include/x86_64-linux-gnu/*" "components/unity/*"
|
|
||||||
EXECUTABLE ctest -V
|
|
||||||
DEPENDENCIES simple_module
|
|
||||||
)
|
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "Given TARGET_GROUP unknown")
|
message(FATAL_ERROR "Given TARGET_GROUP unknown")
|
||||||
endif()
|
endif()
|
||||||
|
|
Loading…
Reference in New Issue