diff --git a/.vscode/extensions.json b/.vscode/extensions.json index c661615..dcc196a 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -5,7 +5,10 @@ // List of extensions which should be recommended for users of this workspace. "recommendations": [ "ms-vscode.cpptools", - "EditorConfig.EditorConfig", + "cschlosser.doxdocgen", + "editorconfig.editorconfig", + "davidanson.vscode-markdownlint", + "zachflower.uncrustify", "marus25.Cortex-Debug", ], diff --git a/.vscode/settings.json b/.vscode/settings.json index 9ce9d02..19dae3b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -11,6 +11,7 @@ "[c]": { "editor.formatOnSave": true, + "editor.defaultFormatter": "zachflower.uncrustify", }, "[makefile]": { @@ -21,4 +22,21 @@ "files.trimTrailingWhitespace": false, "files.trimFinalNewlines": false, }, + + "doxdocgen.generic.dateFormat": "MM/YYYY", + "doxdocgen.file.copyrightTag": [ + "@copyright MIT License - Copyright (c) {year} ThundeRatz" + ], + "doxdocgen.generic.authorTag": "@author {author} <{email}>", + "doxdocgen.file.fileOrder": [ + "file", + "author", + "brief", + "date", + "empty", + "copyright", + "empty", + "custom" + ], + } diff --git a/LICENSE b/LICENSE index db91b1f..24fb286 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 ThundeRatz Robotics Team +Copyright (c) 2022 ThundeRatz Robotics Team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Makefile b/Makefile index 6adf682..abf3423 100644 --- a/Makefile +++ b/Makefile @@ -51,13 +51,25 @@ TESTS_BIN := $(shell find $(TEST_DIR)/bin -name "*.c") CURRENT_TEST_BIN := $(shell find $(TEST_DIR)/bin -name ${TEST_NAME}.c) -CONFIG_HEADERS := +ifneq ($(TEST_NAME),) +ifeq ($(CURRENT_TEST_BIN),) +$(error Invalid test name, $(TEST_NAME).c not found) +endif +endif -ifeq ($(TEST), 1) +ifneq ($(TEST_NAME),) C_SOURCES := $(filter-out $(shell find src -name "main.c"), $(C_SOURCES)) endif +CONFIG_HEADERS := +BOARD_CONFIG_HEADER := +GENERAL_CONFIG_HEADERS := + ifneq ($(CFG_DIR),) +BOARD_CONFIG_HEADER += $(shell find -wholename ./$(CFG_DIR)/board/$(TARGET_BOARD).h) + +GENERAL_CONFIG_HEADERS += $(shell find $(CFG_DIR) -name "*.h" -not -path "$(CFG_DIR)/board/*") + CONFIG_HEADERS += $(shell find $(CFG_DIR) -name "*.h") endif @@ -72,7 +84,10 @@ vpath %.c $(sort $(dir $(CUBE_SOURCES))) vpath %.c $(sort $(dir $(C_SOURCES))) vpath %.s $(sort $(dir $(ASM_SOURCES))) vpath %.c $(sort $(dir $(TESTS_SOURCES))) + +ifneq ($(TEST_NAME),) vpath %.c $(sort $(dir $(CURRENT_TEST_BIN))) +endif ############################################################################### ## Compiler settings @@ -105,9 +120,17 @@ C_INCLUDES := $(addprefix -I, \ ) C_TESTS_INCLUDES := $(addprefix -I, \ - $(sort $(dir $(TESTS_HEADERS))) \ + $(sort $(dir $(TESTS_HEADERS))) \ ) +C_GENERAL_CONFIG_INCLUDES := + +ifneq ($(CFG_DIR),) +C_CONFIG_INCLUDES += $(addprefix -include , \ + $(GENERAL_CONFIG_HEADERS) $(BOARD_CONFIG_HEADER) \ +) +endif + # Adds libs sources and include directories ifneq ($(wildcard $(LIB_DIR)/.*),) -include $(shell find -L $(LIB_DIR) -name "sources.mk") @@ -149,7 +172,7 @@ CFLAGS := \ $(OPT) -std=c11 -MMD -MP \ ifneq ($(CFG_DIR),) -CFLAGS += -include $(CFG_DIR)/board/$(TARGET_BOARD).h +CFLAGS += $(C_CONFIG_INCLUDES) endif ifeq ($(DEBUG),1) @@ -161,10 +184,10 @@ TEST_CFLAGS := \ $(CFLAGS) $(C_TESTS_INCLUDES) \ # Build target base name definition -ifeq ($(TEST), 1) -BUILD_TARGET_BASE_NAME := $(TEST_NAME)_$(PROJECT_NAME) +ifneq ($(TEST_NAME),) +BUILD_TARGET_BASE_NAME := $(TEST_NAME)_$(PROJECT_RELEASE) else -BUILD_TARGET_BASE_NAME := $(PROJECT_NAME) +BUILD_TARGET_BASE_NAME := $(PROJECT_RELEASE) endif # Linker Flags @@ -207,13 +230,13 @@ $(BUILD_DIR)/$(TEST_DIR)/%.o: %.c config.mk Makefile | $(BUILD_DIR) $(AT)$(CC) -c $(TEST_CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(TEST_DIR)/$(notdir $(<:.c=.lst)) -MF"$(@:.o=.d)" $< -o $@ # The .elf file depend on all object files and the Makefile -$(BUILD_DIR)/$(PROJECT_NAME).elf: $(OBJECTS) $(CUBE_OBJECTS) $(LIB_OBJECTS) config.mk Makefile | $(BUILD_DIR) +$(BUILD_DIR)/$(PROJECT_RELEASE).elf: $(OBJECTS) $(CUBE_OBJECTS) $(LIB_OBJECTS) config.mk Makefile | $(BUILD_DIR) @echo "CC $@" $(AT)$(CC) $(OBJECTS) $(CUBE_OBJECTS) $(LIB_OBJECTS) $(LDFLAGS) -o $@ $(AT)$(SIZE) $@ # The .elf file depend on all object files and the Makefile -$(BUILD_DIR)/$(TEST_NAME)_$(PROJECT_NAME).elf: $(OBJECTS) $(TESTS_OBJECTS) $(CUBE_OBJECTS) $(LIB_OBJECTS) config.mk Makefile | $(BUILD_DIR) +$(BUILD_DIR)/$(TEST_NAME)_$(PROJECT_RELEASE).elf: $(OBJECTS) $(TESTS_OBJECTS) $(CUBE_OBJECTS) $(LIB_OBJECTS) config.mk Makefile | $(BUILD_DIR) @echo "CC $@" $(AT)$(CC) $(OBJECTS) $(TESTS_OBJECTS) $(CUBE_OBJECTS) $(LIB_OBJECTS) $(LDFLAGS) -o $@ $(AT)$(SIZE) $@ @@ -262,7 +285,7 @@ endif # Create cube script .cube: config.mk Makefile @echo "Creating Cube script" - @echo "config load "$(CUBE_DIR)"/"$(PROJECT_NAME)".ioc" > $@ + @echo "config load "$(CUBE_DIR)"/"$(PROJECT_RELEASE)".ioc" > $@ @echo "project generate" >> $@ @echo "exit" >> $@ @@ -326,7 +349,7 @@ clean_cube: # Clean build files # - Ignores cube-related build files (ST and CMSIS libraries) clean: -ifeq ($(TEST), 0) +ifeq ($(TEST_NAME),) @echo "Cleaning build files" $(AT)-rm -rf $(OBJECTS) $(OBJECTS:.o=.d) $(OBJECTS:.o=.lst) else @@ -417,15 +440,19 @@ define VS_CPP_PROPERTIES "configurations": [ { "name": "STM32_TR", + "includePath": [ $(subst -I,$(NULL),$(subst $(SPACE),$(COMMA),$(strip $(foreach inc,$(C_INCLUDES) $(C_TESTS_INCLUDES),"$(inc)")))) ], + "forcedInclude": [ + $(subst $(SPACE),$(COMMA),$(strip $(foreach inc,$(BOARD_CONFIG_HEADER) $(GENERAL_CONFIG_HEADERS),"$(inc)"))) + ], "defines": [ $(subst -D,$(NULL),$(subst $(SPACE),$(COMMA),$(strip $(foreach def,$(C_DEFS),"$(def)")))) ], - "compilerPath": "$${env:ARM_GCC_PATH}/arm-none-eabi-gcc", + "compilerPath": "$(ARM_GCC_PATH)/arm-none-eabi-gcc", "cStandard": "c99", "cppStandard": "c++14", "intelliSenseMode": "clang-x64" @@ -438,13 +465,15 @@ endef export VS_LAUNCH export VS_CPP_PROPERTIES -vs_files: $(VS_LAUNCH_FILE) $(VS_C_CPP_PROPERTIES_FILE) +vs_files: vs_launch vs_c_cpp_properties -$(VS_LAUNCH_FILE): config.mk Makefile | $(VSCODE_FOLDER) - $(AT)echo "$$VS_LAUNCH" > $@ +vs_launch: config.mk Makefile | $(VSCODE_FOLDER) + $(AT)rm -f $(VS_LAUNCH_FILE) + $(AT)echo "$$VS_LAUNCH" > $(VS_LAUNCH_FILE) -$(VS_C_CPP_PROPERTIES_FILE): config.mk Makefile | $(VSCODE_FOLDER) - $(AT)echo "$$VS_CPP_PROPERTIES" > $@ +vs_c_cpp_properties: config.mk Makefile $(C_HEADERS) $(TESTS_HEADERS) $(BOARD_CONFIG_HEADER) $(GENERAL_CONFIG_HEADERS) | $(VSCODE_FOLDER) + $(AT)rm -f $(VS_C_CPP_PROPERTIES_FILE) + $(AT)echo "$$VS_CPP_PROPERTIES" > $(VS_C_CPP_PROPERTIES_FILE) $(VSCODE_FOLDER): $(AT)mkdir -p $@ @@ -454,8 +483,8 @@ $(VSCODE_FOLDER): # Include dependecy files for .h dependency detection -include $(wildcard $(BUILD_DIR)/**/*.d) -.PHONY: \ - all cube prepare flash load jflash info reset clean_cube \ - clean clean_all format help vs_files rtt +.PHONY: \ + all cube prepare flash load .jlink-flash jflash info reset clean_cube \ + clean clean_all format help vs_files rtt vs_launch vs_c_cpp_properties .DEFAULT_GOAL := all diff --git a/README.md b/README.md index 4f61c62..5ae6ad3 100644 --- a/README.md +++ b/README.md @@ -73,10 +73,9 @@ novamente para que eles sejam gerados do zero. O arquivo [config.mk](config.mk) deve ser alterado de acordo com o projeto. -Para isso é necessário mudar o nome do projeto, o qual deve ter o mesmo do arquivo do Cube (por exemplo, `stm32_project_template.ioc`), porém sem a extensão `.ioc`. +Para isso é necessário mudar o nome do projeto, o qual deve ter o mesmo do arquivo do Cube (por exemplo, `stm32_project_template.ioc`), porém sem a extensão `.ioc` (no caso de não se utilizar o versionamento dos arquivos do Cube). ```Makefile -# Cube file name without .ioc extension PROJECT_NAME = stm32_project_template ``` @@ -207,21 +206,19 @@ git submodule update --init ## Diretório de testes -O diretório definido pela variável `TEST_DIR` contém arquivos para testes de partes específicas do projeto, separando isso do código do projeto em si. Esses arquivos devem ser implementados de acordo com as necessidades dos desenvolvedores. +O diretório definido pela variável `TEST_DIR` contém arquivos para testes de partes específicas do projeto, separando isso do código do projeto em si. Esses arquivos devem ser implementados de acordo com as necessidades dos desenvolvedores. -Para se habilitar a compilação e gravação dos testes, deve-se definir o valor da variável `TEST` para 1, isso pode ser feito tanto no arquivo `config.mk`, quanto pela linha de comando ao rodar o `make` passando no comando `TEST=1`, por exemplo: +Para se habilitar a compilação e gravação dos testes, deve-se definir o valor da variável `TEST_NAME` para o nome do arquivo de teste que se quer utilizar, isso pode ser feito tanto no arquivo `config.mk`, quanto pela linha de comando ao rodar o `make`, como por exemplo: ```bash -make flash TEST=1 +make flash TEST_NAME=test_digital_sensors ``` -Uma observação é que o comando `make clean`, quando `TEST` for 1, irá apagar os arquivos de compilação referentes aos arquivos de teste. +Caso o valor da variável `TEST_NAME` seja vazio, não se utilizará o modo de teste. -Cada arquivo de teste no diretório de testes funciona de forma independente, ou seja, cada um deve ter uma função `main()`, sendo cada um compilado, gravado e executado separadamente. A escolha de qual teste será rodado é feita pela variável `TEST_NAME`, que assim como a variável `TEST`, pode ser definida no arquivo `config.mk` ou pela linha de comando, por exemplo: +Uma observação é que o comando `make clean`, quando `TEST_NAME` não for vazio, irá apagar os arquivos de compilação referentes aos arquivos de teste. -```bash -make TEST=1 TEST_NAME=test_sensors -``` +Cada arquivo de teste no diretório de testes funciona de forma independente, ou seja, cada um deve ter uma função `main()`, sendo cada um compilado, gravado e executado separadamente. Note que o nome do teste não inclui a extensão do arquivo. diff --git a/config.mk b/config.mk index 904c314..9995566 100644 --- a/config.mk +++ b/config.mk @@ -5,9 +5,11 @@ # Cube file name without .ioc extension PROJECT_NAME = stm32_project_template -VERSION := 1 +VERSION := v1 -TARGET_BOARD := target_$(PROJECT_NAME)_$(VERSION) +PROJECT_RELEASE := $(PROJECT_NAME)_$(VERSION) + +TARGET_BOARD := target_$(PROJECT_RELEASE) DEVICE_FAMILY := STM32F3xx DEVICE_TYPE := STM32F303xx @@ -33,6 +35,5 @@ TEST_DIR := tests # Default values, can be set on the command line or here DEBUG ?= 1 VERBOSE ?= 0 -TEST ?= 0 -TEST_NAME ?= test_main +TEST_NAME ?= diff --git a/cube/stm32_project_template.ioc b/cube/stm32_project_template_v1.ioc similarity index 91% rename from cube/stm32_project_template.ioc rename to cube/stm32_project_template_v1.ioc index 53eaca4..c1e85a8 100644 --- a/cube/stm32_project_template.ioc +++ b/cube/stm32_project_template_v1.ioc @@ -1,185 +1,178 @@ -#MicroXplorer Configuration settings - do not modify -File.Version=6 -KeepUserPlacement=true -Mcu.Family=STM32F3 -Mcu.IP0=NVIC -Mcu.IP1=RCC -Mcu.IP2=SYS -Mcu.IP3=USART1 -Mcu.IP4=USART2 -Mcu.IPNb=5 -Mcu.Name=STM32F303R(D-E)Tx -Mcu.Package=LQFP64 -Mcu.Pin0=PC13 -Mcu.Pin1=PC14-OSC32_IN -Mcu.Pin10=PA13 -Mcu.Pin11=PA14 -Mcu.Pin12=PB3 -Mcu.Pin13=VP_SYS_VS_Systick -Mcu.Pin2=PC15-OSC32_OUT -Mcu.Pin3=PF0-OSC_IN -Mcu.Pin4=PF1-OSC_OUT -Mcu.Pin5=PA2 -Mcu.Pin6=PA3 -Mcu.Pin7=PA5 -Mcu.Pin8=PA9 -Mcu.Pin9=PA10 -Mcu.PinsNb=14 -Mcu.ThirdPartyNb=0 -Mcu.UserConstants= -Mcu.UserName=STM32F303RETx -MxCube.Version=5.4.0 -MxDb.Version=DB.5.0.40 -NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:false\:true\:false -NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:false\:true\:false -NVIC.ForceEnableDMAVector=true -NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:false\:true\:false -NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:false\:true\:false -NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:false\:true\:false -NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:false\:false\:false -NVIC.PriorityGroup=NVIC_PRIORITYGROUP_0 -NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:false\:false\:false -NVIC.SysTick_IRQn=true\:0\:0\:true\:false\:true\:true\:true -NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:false\:true\:false -PA10.Locked=true -PA10.Mode=Asynchronous -PA10.Signal=USART1_RX -PA13.GPIOParameters=GPIO_Label -PA13.GPIO_Label=TMS -PA13.Locked=true -PA13.Mode=Serial_Wire -PA13.Signal=SYS_JTMS-SWDIO -PA14.GPIOParameters=GPIO_Label -PA14.GPIO_Label=TCK -PA14.Locked=true -PA14.Mode=Serial_Wire -PA14.Signal=SYS_JTCK-SWCLK -PA2.Mode=Asynchronous -PA2.Signal=USART2_TX -PA3.Mode=Asynchronous -PA3.Signal=USART2_RX -PA5.GPIOParameters=GPIO_Speed,GPIO_PuPd,GPIO_Label,GPIO_Mode -PA5.GPIO_Label=LD2 [Green Led] -PA5.GPIO_Mode=GPIO_MODE_OUTPUT_PP -PA5.GPIO_PuPd=GPIO_NOPULL -PA5.GPIO_Speed=GPIO_SPEED_FREQ_LOW -PA5.Locked=true -PA5.Signal=GPIO_Output -PA9.Locked=true -PA9.Mode=Asynchronous -PA9.Signal=USART1_TX -PB3.GPIOParameters=GPIO_Label -PB3.GPIO_Label=SWO -PB3.Locked=true -PB3.Signal=SYS_JTDO-TRACESWO -PC13.GPIOParameters=GPIO_Label,GPIO_ModeDefaultEXTI -PC13.GPIO_Label=B1 [Blue PushButton] -PC13.GPIO_ModeDefaultEXTI=GPIO_MODE_IT_FALLING -PC13.Locked=true -PC13.Signal=GPXTI13 -PC14-OSC32_IN.Locked=true -PC14-OSC32_IN.Mode=LSE-External-Oscillator -PC14-OSC32_IN.Signal=RCC_OSC32_IN -PC15-OSC32_OUT.Locked=true -PC15-OSC32_OUT.Mode=LSE-External-Oscillator -PC15-OSC32_OUT.Signal=RCC_OSC32_OUT -PCC.Checker=false -PCC.Line=STM32F303 -PCC.MCU=STM32F303R(D-E)Tx -PCC.PartNumber=STM32F303RETx -PCC.Seq0=0 -PCC.Series=STM32F3 -PCC.Temperature=25 -PCC.Vdd=3.6 -PF0-OSC_IN.Locked=true -PF0-OSC_IN.Mode=HSE-External-Clock-Source -PF0-OSC_IN.Signal=RCC_OSC_IN -PF1-OSC_OUT.Locked=true -PF1-OSC_OUT.Signal=RCC_OSC_OUT -PinOutPanel.RotationAngle=0 -ProjectManager.AskForMigrate=true -ProjectManager.BackupPrevious=false -ProjectManager.CompilerOptimize=6 -ProjectManager.ComputerToolchain=false -ProjectManager.CoupleFile=true -ProjectManager.CustomerFirmwarePackage= -ProjectManager.DefaultFWLocation=true -ProjectManager.DeletePrevious=true -ProjectManager.DeviceId=STM32F303RETx -ProjectManager.FirmwarePackage=STM32Cube FW_F3 V1.11.0 -ProjectManager.FreePins=false -ProjectManager.HalAssertFull=false -ProjectManager.HeapSize=0x200 -ProjectManager.KeepUserCode=true -ProjectManager.LastFirmware=true -ProjectManager.LibraryCopy=1 -ProjectManager.MainLocation=Src -ProjectManager.NoMain=true -ProjectManager.PreviousToolchain= -ProjectManager.ProjectBuild=false -ProjectManager.ProjectFileName=stm32_project_template.ioc -ProjectManager.ProjectName=stm32_project_template -ProjectManager.StackSize=0x400 -ProjectManager.TargetToolchain=Makefile -ProjectManager.ToolChainLocation= -ProjectManager.UnderRoot=false -ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_USART2_UART_Init-USART2-false-HAL-true,4-MX_USART1_UART_Init-USART1-false-HAL-true -RCC.ADC12outputFreq_Value=72000000 -RCC.ADC34outputFreq_Value=72000000 -RCC.AHBFreq_Value=72000000 -RCC.APB1CLKDivider=RCC_HCLK_DIV2 -RCC.APB1Freq_Value=36000000 -RCC.APB1TimFreq_Value=72000000 -RCC.APB2Freq_Value=72000000 -RCC.APB2TimFreq_Value=72000000 -RCC.CortexFreq_Value=72000000 -RCC.FCLKCortexFreq_Value=72000000 -RCC.FamilyName=M -RCC.HCLKFreq_Value=72000000 -RCC.HSE_VALUE=8000000 -RCC.HSI_VALUE=8000000 -RCC.I2C1Freq_Value=8000000 -RCC.I2C2Freq_Value=8000000 -RCC.I2C3Freq_Value=8000000 -RCC.I2SClocksFreq_Value=72000000 -RCC.IPParameters=ADC12outputFreq_Value,ADC34outputFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2C1Freq_Value,I2C2Freq_Value,I2C3Freq_Value,I2SClocksFreq_Value,LSI_VALUE,MCOFreq_Value,PLLCLKFreq_Value,PLLM,PLLMCOFreq_Value,PLLMUL,PLLN,PLLP,PLLQ,RCC_PLLsource_Clock_Source_FROM_HSE,RTCFreq_Value,RTCHSEDivFreq_Value,SYSCLKFreq_VALUE,SYSCLKSourceVirtual,TIM15Freq_Value,TIM16Freq_Value,TIM17Freq_Value,TIM1Freq_Value,TIM20Freq_Value,TIM2Freq_Value,TIM3Freq_Value,TIM8Freq_Value,UART4Freq_Value,UART5Freq_Value,USART1Freq_Value,USART2Freq_Value,USART3Freq_Value,USBFreq_Value,VCOOutput2Freq_Value -RCC.LSI_VALUE=40000 -RCC.MCOFreq_Value=72000000 -RCC.PLLCLKFreq_Value=72000000 -RCC.PLLM=8 -RCC.PLLMCOFreq_Value=72000000 -RCC.PLLMUL=RCC_PLL_MUL9 -RCC.PLLN=336 -RCC.PLLP=RCC_PLLP_DIV4 -RCC.PLLQ=7 -RCC.RCC_PLLsource_Clock_Source_FROM_HSE=RCC_HSE_PREDIV_DIV2 -RCC.RTCFreq_Value=40000 -RCC.RTCHSEDivFreq_Value=250000 -RCC.SYSCLKFreq_VALUE=72000000 -RCC.SYSCLKSourceVirtual=RCC_SYSCLKSOURCE_PLLCLK -RCC.TIM15Freq_Value=72000000 -RCC.TIM16Freq_Value=72000000 -RCC.TIM17Freq_Value=72000000 -RCC.TIM1Freq_Value=72000000 -RCC.TIM20Freq_Value=72000000 -RCC.TIM2Freq_Value=72000000 -RCC.TIM3Freq_Value=72000000 -RCC.TIM8Freq_Value=72000000 -RCC.UART4Freq_Value=36000000 -RCC.UART5Freq_Value=36000000 -RCC.USART1Freq_Value=72000000 -RCC.USART2Freq_Value=36000000 -RCC.USART3Freq_Value=36000000 -RCC.USBFreq_Value=72000000 -RCC.VCOOutput2Freq_Value=8000000 -SH.GPXTI13.0=GPIO_EXTI13 -SH.GPXTI13.ConfNb=1 -USART1.BaudRate=115200 -USART1.IPParameters=VirtualMode-Asynchronous,BaudRate -USART1.VirtualMode-Asynchronous=VM_ASYNC -USART2.BaudRate=115200 -USART2.IPParameters=VirtualMode-Asynchronous,BaudRate -USART2.VirtualMode-Asynchronous=VM_ASYNC -VP_SYS_VS_Systick.Mode=SysTick -VP_SYS_VS_Systick.Signal=SYS_VS_Systick -board=custom +#MicroXplorer Configuration settings - do not modify +File.Version=6 +KeepUserPlacement=true +Mcu.Family=STM32F3 +Mcu.IP0=NVIC +Mcu.IP1=RCC +Mcu.IP2=SYS +Mcu.IP3=USART1 +Mcu.IP4=USART2 +Mcu.IPNb=5 +Mcu.Name=STM32F303R(D-E)Tx +Mcu.Package=LQFP64 +Mcu.Pin0=PC13 +Mcu.Pin1=PC14-OSC32_IN +Mcu.Pin10=PA13 +Mcu.Pin11=PA14 +Mcu.Pin12=PB3 +Mcu.Pin13=VP_SYS_VS_Systick +Mcu.Pin2=PC15-OSC32_OUT +Mcu.Pin3=PF0-OSC_IN +Mcu.Pin4=PF1-OSC_OUT +Mcu.Pin5=PA2 +Mcu.Pin6=PA3 +Mcu.Pin7=PA5 +Mcu.Pin8=PA9 +Mcu.Pin9=PA10 +Mcu.PinsNb=14 +Mcu.ThirdPartyNb=0 +Mcu.UserConstants= +Mcu.UserName=STM32F303RETx +MxCube.Version=6.4.0 +MxDb.Version=DB.6.0.40 +NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:false\:true\:false +NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:false\:true\:false +NVIC.ForceEnableDMAVector=true +NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:false\:true\:false +NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:false\:true\:false +NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:false\:true\:false +NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:false\:false\:false +NVIC.PriorityGroup=NVIC_PRIORITYGROUP_0 +NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:false\:false\:false +NVIC.SysTick_IRQn=true\:0\:0\:true\:false\:true\:true\:true +NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:false\:true\:false +PA10.Locked=true +PA10.Mode=Asynchronous +PA10.Signal=USART1_RX +PA13.GPIOParameters=GPIO_Label +PA13.GPIO_Label=TMS +PA13.Locked=true +PA13.Mode=Serial_Wire +PA13.Signal=SYS_JTMS-SWDIO +PA14.GPIOParameters=GPIO_Label +PA14.GPIO_Label=TCK +PA14.Locked=true +PA14.Mode=Serial_Wire +PA14.Signal=SYS_JTCK-SWCLK +PA2.Mode=Asynchronous +PA2.Signal=USART2_TX +PA3.Mode=Asynchronous +PA3.Signal=USART2_RX +PA5.GPIOParameters=GPIO_Speed,GPIO_PuPd,GPIO_Label,GPIO_Mode +PA5.GPIO_Label=LD2 [Green Led] +PA5.GPIO_Mode=GPIO_MODE_OUTPUT_PP +PA5.GPIO_PuPd=GPIO_NOPULL +PA5.GPIO_Speed=GPIO_SPEED_FREQ_LOW +PA5.Locked=true +PA5.Signal=GPIO_Output +PA9.Locked=true +PA9.Mode=Asynchronous +PA9.Signal=USART1_TX +PB3.GPIOParameters=GPIO_Label +PB3.GPIO_Label=SWO +PB3.Locked=true +PB3.Signal=SYS_JTDO-TRACESWO +PC13.GPIOParameters=GPIO_Label,GPIO_ModeDefaultEXTI +PC13.GPIO_Label=B1 [Blue PushButton] +PC13.GPIO_ModeDefaultEXTI=GPIO_MODE_IT_FALLING +PC13.Locked=true +PC13.Signal=GPXTI13 +PC14-OSC32_IN.Locked=true +PC14-OSC32_IN.Mode=LSE-External-Oscillator +PC14-OSC32_IN.Signal=RCC_OSC32_IN +PC15-OSC32_OUT.Locked=true +PC15-OSC32_OUT.Mode=LSE-External-Oscillator +PC15-OSC32_OUT.Signal=RCC_OSC32_OUT +PF0-OSC_IN.Locked=true +PF0-OSC_IN.Mode=HSE-External-Clock-Source +PF0-OSC_IN.Signal=RCC_OSC_IN +PF1-OSC_OUT.Locked=true +PF1-OSC_OUT.Signal=RCC_OSC_OUT +PinOutPanel.RotationAngle=0 +ProjectManager.AskForMigrate=true +ProjectManager.BackupPrevious=false +ProjectManager.CompilerOptimize=6 +ProjectManager.ComputerToolchain=false +ProjectManager.CoupleFile=true +ProjectManager.CustomerFirmwarePackage= +ProjectManager.DefaultFWLocation=true +ProjectManager.DeletePrevious=true +ProjectManager.DeviceId=STM32F303RETx +ProjectManager.FirmwarePackage=STM32Cube FW_F3 V1.11.3 +ProjectManager.FreePins=false +ProjectManager.HalAssertFull=false +ProjectManager.HeapSize=0x200 +ProjectManager.KeepUserCode=true +ProjectManager.LastFirmware=true +ProjectManager.LibraryCopy=1 +ProjectManager.MainLocation=Src +ProjectManager.NoMain=true +ProjectManager.PreviousToolchain= +ProjectManager.ProjectBuild=false +ProjectManager.ProjectFileName=stm32_project_template_v1.ioc +ProjectManager.ProjectName=stm32_project_template_v1 +ProjectManager.RegisterCallBack= +ProjectManager.StackSize=0x400 +ProjectManager.TargetToolchain=Makefile +ProjectManager.ToolChainLocation= +ProjectManager.UnderRoot=false +ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_USART2_UART_Init-USART2-false-HAL-true,4-MX_USART1_UART_Init-USART1-false-HAL-true +RCC.ADC12outputFreq_Value=72000000 +RCC.ADC34outputFreq_Value=72000000 +RCC.AHBFreq_Value=72000000 +RCC.APB1CLKDivider=RCC_HCLK_DIV2 +RCC.APB1Freq_Value=36000000 +RCC.APB1TimFreq_Value=72000000 +RCC.APB2Freq_Value=72000000 +RCC.APB2TimFreq_Value=72000000 +RCC.CortexFreq_Value=72000000 +RCC.FCLKCortexFreq_Value=72000000 +RCC.FamilyName=M +RCC.HCLKFreq_Value=72000000 +RCC.HSE_VALUE=8000000 +RCC.HSI_VALUE=8000000 +RCC.I2C1Freq_Value=8000000 +RCC.I2C2Freq_Value=8000000 +RCC.I2C3Freq_Value=8000000 +RCC.I2SClocksFreq_Value=72000000 +RCC.IPParameters=ADC12outputFreq_Value,ADC34outputFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2C1Freq_Value,I2C2Freq_Value,I2C3Freq_Value,I2SClocksFreq_Value,LSI_VALUE,MCOFreq_Value,PLLCLKFreq_Value,PLLM,PLLMCOFreq_Value,PLLMUL,PLLN,PLLP,PLLQ,RCC_PLLsource_Clock_Source_FROM_HSE,RTCFreq_Value,RTCHSEDivFreq_Value,SYSCLKFreq_VALUE,SYSCLKSourceVirtual,TIM15Freq_Value,TIM16Freq_Value,TIM17Freq_Value,TIM1Freq_Value,TIM20Freq_Value,TIM2Freq_Value,TIM3Freq_Value,TIM8Freq_Value,UART4Freq_Value,UART5Freq_Value,USART1Freq_Value,USART2Freq_Value,USART3Freq_Value,USBFreq_Value,VCOOutput2Freq_Value +RCC.LSI_VALUE=40000 +RCC.MCOFreq_Value=72000000 +RCC.PLLCLKFreq_Value=72000000 +RCC.PLLM=8 +RCC.PLLMCOFreq_Value=72000000 +RCC.PLLMUL=RCC_PLL_MUL9 +RCC.PLLN=336 +RCC.PLLP=RCC_PLLP_DIV4 +RCC.PLLQ=7 +RCC.RCC_PLLsource_Clock_Source_FROM_HSE=RCC_HSE_PREDIV_DIV2 +RCC.RTCFreq_Value=40000 +RCC.RTCHSEDivFreq_Value=250000 +RCC.SYSCLKFreq_VALUE=72000000 +RCC.SYSCLKSourceVirtual=RCC_SYSCLKSOURCE_PLLCLK +RCC.TIM15Freq_Value=72000000 +RCC.TIM16Freq_Value=72000000 +RCC.TIM17Freq_Value=72000000 +RCC.TIM1Freq_Value=72000000 +RCC.TIM20Freq_Value=72000000 +RCC.TIM2Freq_Value=72000000 +RCC.TIM3Freq_Value=72000000 +RCC.TIM8Freq_Value=72000000 +RCC.UART4Freq_Value=36000000 +RCC.UART5Freq_Value=36000000 +RCC.USART1Freq_Value=72000000 +RCC.USART2Freq_Value=36000000 +RCC.USART3Freq_Value=36000000 +RCC.USBFreq_Value=72000000 +RCC.VCOOutput2Freq_Value=8000000 +SH.GPXTI13.0=GPIO_EXTI13 +SH.GPXTI13.ConfNb=1 +USART1.BaudRate=115200 +USART1.IPParameters=VirtualMode-Asynchronous,BaudRate +USART1.VirtualMode-Asynchronous=VM_ASYNC +USART2.BaudRate=115200 +USART2.IPParameters=VirtualMode-Asynchronous,BaudRate +USART2.VirtualMode-Asynchronous=VM_ASYNC +VP_SYS_VS_Systick.Mode=SysTick +VP_SYS_VS_Systick.Signal=SYS_VS_Systick +board=custom diff --git a/tests/inc/tests_core.h b/tests/inc/test_core.h similarity index 57% rename from tests/inc/tests_core.h rename to tests/inc/test_core.h index 8617a26..058dc8b 100644 --- a/tests/inc/tests_core.h +++ b/tests/inc/test_core.h @@ -1,7 +1,7 @@ /** - * @file tests_core.h + * @file test_core.h * - * @brief Core functions to the tests + * @brief Core functions to the test * * @date 04/2021 * @@ -9,12 +9,17 @@ * */ +#ifndef __TEST_CORE_H__ +#define __TEST_CORE_H__ + /***************************************** * Public Functions Prototypes *****************************************/ /** - * @brief Initialize tests core + * @brief Initialize test core * */ void test_core_init(void); + +#endif // __TEST_CORE_H__ diff --git a/tests/src/tests_core.c b/tests/src/test_core.c similarity index 75% rename from tests/src/tests_core.c rename to tests/src/test_core.c index f03d8dc..3387397 100644 --- a/tests/src/tests_core.c +++ b/tests/src/test_core.c @@ -1,7 +1,7 @@ /** - * @file tests_core.c + * @file test_core.c * - * @brief Core functions to the tests + * @brief Core functions to the test * * @date 04/2021 * @@ -9,7 +9,7 @@ * */ -#include "tests_core.h" +#include "test_core.h" #include "mcu.h" /***************************************** diff --git a/uncrustify.cfg b/uncrustify.cfg index a298933..26fd455 100644 --- a/uncrustify.cfg +++ b/uncrustify.cfg @@ -28,10 +28,10 @@ string_replace_tab_chars = false # false/true tok_split_gte = false # false/true # Override the default ' *INDENT-OFF*' in comments for disabling processing of part of the file. -disable_processing_cmt = "" # string +disable_processing_cmt = "FORMAT_OFF" # string # Override the default ' *INDENT-ON*' in comments for enabling processing of part of the file. -enable_processing_cmt = "" # string +enable_processing_cmt = "FORMAT_ON" # string # Enable parsing of digraphs. Default=False. enable_digraphs = false # false/true @@ -51,7 +51,7 @@ utf8_force = false # false/true # Add or remove space around arithmetic operator '+', '-', '/', '*', etc # also '>>>' '<<' '>>' '%' '|'. -sp_arith = force # ignore/add/remove/force +sp_arith = add # ignore/add/remove/force # Add or remove space around arithmetic operator '+' and '-'. Overrides sp_arith sp_arith_additive = ignore # ignore/add/remove/force @@ -196,7 +196,7 @@ sp_angle_shift = remove # ignore/add/remove/force # Permit removal of the space between '>>' in 'foo >' (C++11 only). Default=False. # sp_angle_shift cannot remove the space without this option. -sp_permit_cpp11_shift = false # false/true +sp_permit_cpp11_shift = true # false/true # Add or remove space before '(' of 'if', 'for', 'switch', 'while', etc. sp_before_sparen = force # ignore/add/remove/force @@ -601,7 +601,7 @@ sp_extern_paren = ignore # ignore/add/remove/force sp_cmt_cpp_start = force # ignore/add/remove/force # True: If space is added with sp_cmt_cpp_start, do it after doxygen sequences like '///', '///<', '//!' and '//!<'. -sp_cmt_cpp_doxygen = false # false/true +sp_cmt_cpp_doxygen = true # false/true # True: If space is added with sp_cmt_cpp_start, do it after Qt translator or meta-data comments like '//:', '//=', and '//~'. sp_cmt_cpp_qttr = false # false/true @@ -633,7 +633,7 @@ sp_inside_newop_paren_close = ignore # ignore/add/remove/force sp_before_tr_emb_cmt = force # ignore/add/remove/force # Number of spaces before a trailing or embedded comment. -sp_num_before_tr_emb_cmt = 1 # unsigned number +sp_num_before_tr_emb_cmt = 2 # unsigned number # Control space between a Java annotation and the open paren. sp_annotation_paren = ignore # ignore/add/remove/force @@ -905,7 +905,7 @@ indent_vbrace_open_on_tabstop = false # false/true indent_token_after_brace = true # false/true # If True, cpp lambda body will be indentedDefault=False. -indent_cpp_lambda_body = false # false/true +indent_cpp_lambda_body = true # false/true # indent (or not) an using block if no braces are used. Only for C#.Default=True. indent_using_block = true # false/true @@ -1132,7 +1132,7 @@ nl_case_colon_brace = remove # ignore/add/remove/force nl_namespace_brace = remove # ignore/add/remove/force # Add or remove newline between 'template<>' and whatever follows. -nl_template_class = remove # ignore/add/remove/force +nl_template_class = add # ignore/add/remove/force # Add or remove newline between 'class' and '{'. nl_class_brace = remove # ignore/add/remove/force @@ -1258,7 +1258,7 @@ nl_oc_msg_args = false # false/true nl_fdef_brace = remove # ignore/add/remove/force # Add or remove newline between C++11 lambda signature and '{'. -nl_cpp_ldef_brace = ignore # ignore/add/remove/force +nl_cpp_ldef_brace = remove # ignore/add/remove/force # Add or remove a newline between the return keyword and return expression. nl_return_expr = remove # ignore/add/remove/force @@ -1691,7 +1691,7 @@ align_typedef_func = 0 # unsigned number # 0: Align on typedef type, ignore '*' # 1: The '*' is part of type name: typedef int *pint; # 2: The '*' is part of the type, but dangling: typedef int *pint; -align_typedef_star_style = 2 # unsigned number +align_typedef_star_style = 0 # unsigned number # Controls the positioning of the '&' in typedefs. Just try it. # 0: Align on typedef type, ignore '&'