From 7faf5922a677a93f8415d79181a17e1a427084dc Mon Sep 17 00:00:00 2001 From: LHaug Date: Sun, 27 Feb 2022 13:49:12 -0300 Subject: [PATCH 01/24] =?UTF-8?q?=F0=9F=94=A7=20Update=20vscode=20settings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/extensions.json | 6 +++++- .vscode/settings.json | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index c661615..229d934 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -5,7 +5,11 @@ // List of extensions which should be recommended for users of this workspace. "recommendations": [ "ms-vscode.cpptools", - "EditorConfig.EditorConfig", + "ms-vscode.cpptools", + "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" + ], + } From f91ed61ea2e12e83cd184e7105c2f8743891c9cb Mon Sep 17 00:00:00 2001 From: LHaug Date: Sun, 27 Feb 2022 13:49:24 -0300 Subject: [PATCH 02/24] =?UTF-8?q?=F0=9F=93=84=20Update=20license?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 94824cc6f27f2cac5510f9ef41d389c5ef6fc042 Mon Sep 17 00:00:00 2001 From: LHaug Date: Sun, 27 Feb 2022 13:49:37 -0300 Subject: [PATCH 03/24] =?UTF-8?q?=F0=9F=94=A7=20Update=20uncrustify=20conf?= =?UTF-8?q?ig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uncrustify.cfg | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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 '&' From 469a374ecb38537df2767d60b37e6254d7be3e13 Mon Sep 17 00:00:00 2001 From: LHaug Date: Sun, 27 Feb 2022 13:52:56 -0300 Subject: [PATCH 04/24] =?UTF-8?q?=F0=9F=8E=A8=20Fix=20config=20indentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/extensions.json | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 229d934..dcc196a 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -5,11 +5,10 @@ // List of extensions which should be recommended for users of this workspace. "recommendations": [ "ms-vscode.cpptools", - "ms-vscode.cpptools", - "cschlosser.doxdocgen", - "editorconfig.editorconfig", - "davidanson.vscode-markdownlint", - "zachflower.uncrustify", + "cschlosser.doxdocgen", + "editorconfig.editorconfig", + "davidanson.vscode-markdownlint", + "zachflower.uncrustify", "marus25.Cortex-Debug", ], From bef318200c527d78e365fdc43e7ffc3489086f71 Mon Sep 17 00:00:00 2001 From: LHaug Date: Sun, 27 Feb 2022 14:35:38 -0300 Subject: [PATCH 05/24] =?UTF-8?q?=E2=9C=A8=20include=20general=20config=20?= =?UTF-8?q?header=20in=20Makefile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 6adf682..8f7e4f2 100644 --- a/Makefile +++ b/Makefile @@ -51,13 +51,19 @@ TESTS_BIN := $(shell find $(TEST_DIR)/bin -name "*.c") CURRENT_TEST_BIN := $(shell find $(TEST_DIR)/bin -name ${TEST_NAME}.c) -CONFIG_HEADERS := - ifeq ($(TEST), 1) 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 += $(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 @@ -105,9 +111,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_GENERAL_CONFIG_INCLUDES += $(addprefix -I, \ + $(sort $(dir $(GENERAL_CONFIG_HEADERS))) \ +) +endif + # Adds libs sources and include directories ifneq ($(wildcard $(LIB_DIR)/.*),) -include $(shell find -L $(LIB_DIR) -name "sources.mk") @@ -149,7 +163,8 @@ CFLAGS := \ $(OPT) -std=c11 -MMD -MP \ ifneq ($(CFG_DIR),) -CFLAGS += -include $(CFG_DIR)/board/$(TARGET_BOARD).h +CFLAGS += -include $(BOARD_CONFIG_HEADER) +CFLAGS += $(C_GENERAL_CONFIG_INCLUDES) endif ifeq ($(DEBUG),1) From c230472c2beceb9871973c34bbfd91d50c9b0f42 Mon Sep 17 00:00:00 2001 From: LHaug Date: Sun, 27 Feb 2022 15:03:02 -0300 Subject: [PATCH 06/24] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Use=20project=20rele?= =?UTF-8?q?ase=20as=20ioc=20name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 10 +++++----- config.mk | 6 ++++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 6adf682..a27e53e 100644 --- a/Makefile +++ b/Makefile @@ -162,9 +162,9 @@ TEST_CFLAGS := \ # Build target base name definition ifeq ($(TEST), 1) -BUILD_TARGET_BASE_NAME := $(TEST_NAME)_$(PROJECT_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 +207,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 +262,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" >> $@ diff --git a/config.mk b/config.mk index 904c314..59b8943 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 From e1250e57bd5d177ff8329c6ef5d5806de9990d05 Mon Sep 17 00:00:00 2001 From: LHaug Date: Sun, 27 Feb 2022 15:17:50 -0300 Subject: [PATCH 07/24] =?UTF-8?q?=F0=9F=9A=9A=20Rename=20and=20update=20cu?= =?UTF-8?q?be?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...late.ioc => stm32_project_template_v1.ioc} | 363 +++++++++--------- 1 file changed, 178 insertions(+), 185 deletions(-) rename cube/{stm32_project_template.ioc => stm32_project_template_v1.ioc} (91%) 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 From 7c0aa7c71068df9ba2481835578b32136c580a2a Mon Sep 17 00:00:00 2001 From: LHaug Date: Sun, 27 Feb 2022 15:17:58 -0300 Subject: [PATCH 08/24] =?UTF-8?q?=F0=9F=93=9D=20Update=20docs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 4f61c62..4d3f923 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 ``` From 74f61e30eb68dd36e3eb334878d5a5a43529628a Mon Sep 17 00:00:00 2001 From: LHaug Date: Thu, 3 Mar 2022 22:12:12 -0300 Subject: [PATCH 09/24] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Refactor=20to=20use?= =?UTF-8?q?=20TEST=5FNAME=20instead=20of=20TEST?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 6 +++--- config.mk | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 6adf682..779614a 100644 --- a/Makefile +++ b/Makefile @@ -53,7 +53,7 @@ CURRENT_TEST_BIN := $(shell find $(TEST_DIR)/bin -name ${TEST_NAME}.c) CONFIG_HEADERS := -ifeq ($(TEST), 1) +ifneq ($(TEST_NAME),) C_SOURCES := $(filter-out $(shell find src -name "main.c"), $(C_SOURCES)) endif @@ -161,7 +161,7 @@ TEST_CFLAGS := \ $(CFLAGS) $(C_TESTS_INCLUDES) \ # Build target base name definition -ifeq ($(TEST), 1) +ifneq ($(TEST_NAME),) BUILD_TARGET_BASE_NAME := $(TEST_NAME)_$(PROJECT_NAME) else BUILD_TARGET_BASE_NAME := $(PROJECT_NAME) @@ -326,7 +326,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 diff --git a/config.mk b/config.mk index 904c314..53873bf 100644 --- a/config.mk +++ b/config.mk @@ -33,6 +33,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 ?= From 1cffbe411073202123a24327183335459f555929 Mon Sep 17 00:00:00 2001 From: LHaug Date: Thu, 3 Mar 2022 22:12:32 -0300 Subject: [PATCH 10/24] =?UTF-8?q?=F0=9F=93=9D=20Update=20docs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 4f61c62..de558cd 100644 --- a/README.md +++ b/README.md @@ -207,21 +207,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. From 004338b2fc673738505adac40327edce8283d7f2 Mon Sep 17 00:00:00 2001 From: LHaug Date: Thu, 3 Mar 2022 22:13:41 -0300 Subject: [PATCH 11/24] =?UTF-8?q?=F0=9F=90=9B=20Fix=20invalid=20test=20nam?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index 779614a..3981f40 100644 --- a/Makefile +++ b/Makefile @@ -51,6 +51,12 @@ TESTS_BIN := $(shell find $(TEST_DIR)/bin -name "*.c") CURRENT_TEST_BIN := $(shell find $(TEST_DIR)/bin -name ${TEST_NAME}.c) +ifneq ($(TEST_NAME),) +ifeq ($(CURRENT_TEST_BIN),) +$(error Invalid test name: $(TEST_NAME)) +endif +endif + CONFIG_HEADERS := ifneq ($(TEST_NAME),) From eba25cff69a8e6b89c2cc181e08f03557696dca9 Mon Sep 17 00:00:00 2001 From: LHaug Date: Sun, 6 Mar 2022 18:17:18 -0300 Subject: [PATCH 12/24] =?UTF-8?q?=F0=9F=90=9B=20Fix=20main=20compilation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 3981f40..bcd9f7f 100644 --- a/Makefile +++ b/Makefile @@ -78,7 +78,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 From fbdeacfaab8fc4d952df8e9fa7576ee3b195a842 Mon Sep 17 00:00:00 2001 From: LHaug Date: Tue, 8 Mar 2022 09:02:34 -0300 Subject: [PATCH 13/24] =?UTF-8?q?=F0=9F=9A=A8=20Update=20error=20message?= =?UTF-8?q?=20text?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index bcd9f7f..107107d 100644 --- a/Makefile +++ b/Makefile @@ -53,7 +53,7 @@ CURRENT_TEST_BIN := $(shell find $(TEST_DIR)/bin -name ${TEST_NAME}.c) ifneq ($(TEST_NAME),) ifeq ($(CURRENT_TEST_BIN),) -$(error Invalid test name: $(TEST_NAME)) +$(error Invalid test name, $(TEST_NAME).c not found) endif endif From a08a8846592f2e50aa5cf8c1d9f92a0c580a9982 Mon Sep 17 00:00:00 2001 From: LHaug Date: Thu, 10 Mar 2022 23:38:50 -0300 Subject: [PATCH 14/24] =?UTF-8?q?=F0=9F=94=A5=20Update=20vs=5Ffile=20targe?= =?UTF-8?q?t=20to=20remove=20old=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 50bb9f4..e69e4e9 100644 --- a/Makefile +++ b/Makefile @@ -465,9 +465,11 @@ export VS_CPP_PROPERTIES vs_files: $(VS_LAUNCH_FILE) $(VS_C_CPP_PROPERTIES_FILE) $(VS_LAUNCH_FILE): config.mk Makefile | $(VSCODE_FOLDER) + $(AT)rm $(VS_LAUNCH_FILE) $(AT)echo "$$VS_LAUNCH" > $@ $(VS_C_CPP_PROPERTIES_FILE): config.mk Makefile | $(VSCODE_FOLDER) + $(AT)rm $(VS_C_CPP_PROPERTIES_FILE) $(AT)echo "$$VS_CPP_PROPERTIES" > $@ $(VSCODE_FOLDER): From dfab85fcf1322b16b55dd8319a80dccdcf6d5223 Mon Sep 17 00:00:00 2001 From: LHaug Date: Thu, 10 Mar 2022 23:39:43 -0300 Subject: [PATCH 15/24] =?UTF-8?q?=F0=9F=94=A5=20Remove=20whitespace?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.mk b/config.mk index fc417bf..9995566 100644 --- a/config.mk +++ b/config.mk @@ -36,4 +36,4 @@ TEST_DIR := tests DEBUG ?= 1 VERBOSE ?= 0 -TEST_NAME ?= +TEST_NAME ?= From eefe05224c4dcfc892146d6623116fbdb0957a59 Mon Sep 17 00:00:00 2001 From: LHaug Date: Thu, 10 Mar 2022 23:42:41 -0300 Subject: [PATCH 16/24] =?UTF-8?q?=F0=9F=94=A7=20Update=20vscode=20files=20?= =?UTF-8?q?target?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e69e4e9..a4c1d24 100644 --- a/Makefile +++ b/Makefile @@ -441,9 +441,13 @@ define VS_CPP_PROPERTIES "configurations": [ { "name": "STM32_TR", + "includePath": [ - $(subst -I,$(NULL),$(subst $(SPACE),$(COMMA),$(strip $(foreach inc,$(C_INCLUDES) $(C_TESTS_INCLUDES),"$(inc)")))) + $(subst -I,$(NULL),$(subst $(SPACE),$(COMMA),$(strip $(foreach inc,$(C_INCLUDES) $(C_TESTS_INCLUDES) $(GENERAL_CONFIG_HEADERS),"$(inc)")))) ], + "forcedInclude": [ + "$(BOARD_CONFIG_HEADER)" + ], "defines": [ $(subst -D,$(NULL),$(subst $(SPACE),$(COMMA),$(strip $(foreach def,$(C_DEFS),"$(def)")))) From 24754fef7eeff089e468ad3b9c09cd6c98b967f2 Mon Sep 17 00:00:00 2001 From: LHaug Date: Thu, 10 Mar 2022 23:43:49 -0300 Subject: [PATCH 17/24] =?UTF-8?q?=E2=9C=A8=20Update=20to=20make=20config?= =?UTF-8?q?=20headers=20global?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index a4c1d24..7b57fdf 100644 --- a/Makefile +++ b/Makefile @@ -126,8 +126,8 @@ C_TESTS_INCLUDES := $(addprefix -I, \ C_GENERAL_CONFIG_INCLUDES := ifneq ($(CFG_DIR),) -C_GENERAL_CONFIG_INCLUDES += $(addprefix -I, \ - $(sort $(dir $(GENERAL_CONFIG_HEADERS))) \ +C_GENERAL_CONFIG_INCLUDES += $(addprefix -include , \ + $(GENERAL_CONFIG_HEADERS) \ ) endif @@ -443,10 +443,10 @@ define VS_CPP_PROPERTIES "name": "STM32_TR", "includePath": [ - $(subst -I,$(NULL),$(subst $(SPACE),$(COMMA),$(strip $(foreach inc,$(C_INCLUDES) $(C_TESTS_INCLUDES) $(GENERAL_CONFIG_HEADERS),"$(inc)")))) + $(subst -I,$(NULL),$(subst $(SPACE),$(COMMA),$(strip $(foreach inc,$(C_INCLUDES) $(C_TESTS_INCLUDES),"$(inc)")))) ], "forcedInclude": [ - "$(BOARD_CONFIG_HEADER)" + $(subst $(SPACE),$(COMMA),$(strip $(foreach inc,$(BOARD_CONFIG_HEADER) $(GENERAL_CONFIG_HEADERS),"$(inc)"))) ], "defines": [ From c6d69b8c74fcf852f5969990e3a3260eff96a21b Mon Sep 17 00:00:00 2001 From: LHaug Date: Sat, 12 Mar 2022 13:41:57 -0300 Subject: [PATCH 18/24] =?UTF-8?q?=F0=9F=90=9B=20Fix=20file=20removal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 7b57fdf..1ccb5b7 100644 --- a/Makefile +++ b/Makefile @@ -469,11 +469,11 @@ export VS_CPP_PROPERTIES vs_files: $(VS_LAUNCH_FILE) $(VS_C_CPP_PROPERTIES_FILE) $(VS_LAUNCH_FILE): config.mk Makefile | $(VSCODE_FOLDER) - $(AT)rm $(VS_LAUNCH_FILE) + $(AT)rm -f $(VS_LAUNCH_FILE) $(AT)echo "$$VS_LAUNCH" > $@ $(VS_C_CPP_PROPERTIES_FILE): config.mk Makefile | $(VSCODE_FOLDER) - $(AT)rm $(VS_C_CPP_PROPERTIES_FILE) + $(AT)rm -f $(VS_C_CPP_PROPERTIES_FILE) $(AT)echo "$$VS_CPP_PROPERTIES" > $@ $(VSCODE_FOLDER): From e7c9a052868f7c9247b6904b79cbb059f79ccbe8 Mon Sep 17 00:00:00 2001 From: LHaug Date: Sat, 12 Mar 2022 14:01:15 -0300 Subject: [PATCH 19/24] =?UTF-8?q?=F0=9F=90=9B=20Fix=20to=20search=20for=20?= =?UTF-8?q?board=20config=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 1ccb5b7..9bcb379 100644 --- a/Makefile +++ b/Makefile @@ -66,7 +66,7 @@ BOARD_CONFIG_HEADER := GENERAL_CONFIG_HEADERS := ifneq ($(CFG_DIR),) -BOARD_CONFIG_HEADER += $(CFG_DIR)/board/$(TARGET_BOARD).h +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/*") @@ -126,8 +126,8 @@ C_TESTS_INCLUDES := $(addprefix -I, \ C_GENERAL_CONFIG_INCLUDES := ifneq ($(CFG_DIR),) -C_GENERAL_CONFIG_INCLUDES += $(addprefix -include , \ - $(GENERAL_CONFIG_HEADERS) \ +C_CONFIG_INCLUDES += $(addprefix -include , \ + $(GENERAL_CONFIG_HEADERS) $(BOARD_CONFIG_HEADER) \ ) endif @@ -172,8 +172,7 @@ CFLAGS := \ $(OPT) -std=c11 -MMD -MP \ ifneq ($(CFG_DIR),) -CFLAGS += -include $(BOARD_CONFIG_HEADER) -CFLAGS += $(C_GENERAL_CONFIG_INCLUDES) +CFLAGS += $(C_CONFIG_INCLUDES) endif ifeq ($(DEBUG),1) From 64cc3d5c6ffbf051a1ea08fa5f8b7d6f22f6fe33 Mon Sep 17 00:00:00 2001 From: LHaug Date: Sat, 12 Mar 2022 14:29:37 -0300 Subject: [PATCH 20/24] =?UTF-8?q?=F0=9F=90=9B=20Fix=20vs=20files=20generat?= =?UTF-8?q?ion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lucas Schneider --- Makefile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 9bcb379..f379926 100644 --- a/Makefile +++ b/Makefile @@ -465,15 +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) +vs_launch: config.mk Makefile | $(VSCODE_FOLDER) $(AT)rm -f $(VS_LAUNCH_FILE) - $(AT)echo "$$VS_LAUNCH" > $@ + $(AT)echo "$$VS_LAUNCH" > $(VS_LAUNCH_FILE) -$(VS_C_CPP_PROPERTIES_FILE): config.mk Makefile | $(VSCODE_FOLDER) +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" > $@ + $(AT)echo "$$VS_CPP_PROPERTIES" > $(VS_C_CPP_PROPERTIES_FILE) $(VSCODE_FOLDER): $(AT)mkdir -p $@ @@ -483,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 jflash info reset clean_cube \ + clean clean_all format help vs_files rtt vs_launch vs_c_cpp_properties .DEFAULT_GOAL := all From 292c489e44b1bdeb5aefaad46e9f71a8c9ebe28f Mon Sep 17 00:00:00 2001 From: LHaug Date: Sat, 12 Mar 2022 14:30:02 -0300 Subject: [PATCH 21/24] =?UTF-8?q?=F0=9F=90=9B=20Fix=20compiler=20path=20on?= =?UTF-8?q?=20vs=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lucas Schneider --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f379926..66c7fde 100644 --- a/Makefile +++ b/Makefile @@ -452,7 +452,7 @@ define VS_CPP_PROPERTIES $(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" From 514662c5697d6f853e14edae64f3ec6ce7ac996c Mon Sep 17 00:00:00 2001 From: LHaug Date: Thu, 19 May 2022 21:13:10 -0300 Subject: [PATCH 22/24] =?UTF-8?q?=F0=9F=A9=B9=20Add=20include=20guard=20on?= =?UTF-8?q?=20test=20core=20header?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/inc/tests_core.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/inc/tests_core.h b/tests/inc/tests_core.h index 8617a26..3e6f8a5 100644 --- a/tests/inc/tests_core.h +++ b/tests/inc/tests_core.h @@ -9,6 +9,9 @@ * */ +#ifndef __TESTS_CORE_H__ +#define __TESTS_CORE_H__ + /***************************************** * Public Functions Prototypes *****************************************/ @@ -18,3 +21,5 @@ * */ void test_core_init(void); + +#endif // __TESTS_CORE_H__ From 3a179ec63208b72cb77c10a4963d7e34a9491b37 Mon Sep 17 00:00:00 2001 From: LucasHaug Date: Tue, 19 Jul 2022 18:54:52 -0300 Subject: [PATCH 23/24] =?UTF-8?q?=F0=9F=9A=9A=20Rename=20test=20core?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/inc/{tests_core.h => test_core.h} | 12 ++++++------ tests/src/{tests_core.c => test_core.c} | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) rename tests/inc/{tests_core.h => test_core.h} (56%) rename tests/src/{tests_core.c => test_core.c} (75%) diff --git a/tests/inc/tests_core.h b/tests/inc/test_core.h similarity index 56% rename from tests/inc/tests_core.h rename to tests/inc/test_core.h index 3e6f8a5..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,17 +9,17 @@ * */ -#ifndef __TESTS_CORE_H__ -#define __TESTS_CORE_H__ +#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 // __TESTS_CORE_H__ +#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" /***************************************** From 9cd55338e89c35a39c55814d476bc9491c9c5baa Mon Sep 17 00:00:00 2001 From: LucasHaug Date: Fri, 9 Sep 2022 18:29:11 -0300 Subject: [PATCH 24/24] =?UTF-8?q?=F0=9F=90=9B=20Fix=20jflash=20command=20d?= =?UTF-8?q?ependency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 66c7fde..abf3423 100644 --- a/Makefile +++ b/Makefile @@ -484,7 +484,7 @@ $(VSCODE_FOLDER): -include $(wildcard $(BUILD_DIR)/**/*.d) .PHONY: \ - all cube prepare flash load jflash info reset clean_cube \ + 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