[Mod] First commit
This commit is contained in:
BIN
.cache/clangd/index/FreeRTOS.h.256D37B32AA5C519.idx
Normal file
BIN
.cache/clangd/index/FreeRTOS.h.256D37B32AA5C519.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/FreeRTOSConfig.h.AD13241519486EB8.idx
Normal file
BIN
.cache/clangd/index/FreeRTOSConfig.h.AD13241519486EB8.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/cmsis_compiler.h.CB91E76A32DB66A6.idx
Normal file
BIN
.cache/clangd/index/cmsis_compiler.h.CB91E76A32DB66A6.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/cmsis_gcc.h.09A33CDADF18AECC.idx
Normal file
BIN
.cache/clangd/index/cmsis_gcc.h.09A33CDADF18AECC.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/cmsis_os.h.09A5B086BD22BE1B.idx
Normal file
BIN
.cache/clangd/index/cmsis_os.h.09A5B086BD22BE1B.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/cmsis_os2.c.C26BFBFBCA19718D.idx
Normal file
BIN
.cache/clangd/index/cmsis_os2.c.C26BFBFBCA19718D.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/cmsis_os2.h.B707703FCB3F6F12.idx
Normal file
BIN
.cache/clangd/index/cmsis_os2.h.B707703FCB3F6F12.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/cmsis_version.h.3A74DAFFB3AE78B2.idx
Normal file
BIN
.cache/clangd/index/cmsis_version.h.3A74DAFFB3AE78B2.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/core_cm4.h.99CA8FB827BD807F.idx
Normal file
BIN
.cache/clangd/index/core_cm4.h.99CA8FB827BD807F.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/croutine.c.95902BD4CDE14934.idx
Normal file
BIN
.cache/clangd/index/croutine.c.95902BD4CDE14934.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/croutine.h.3D7AB6EF36BB4D8A.idx
Normal file
BIN
.cache/clangd/index/croutine.h.3D7AB6EF36BB4D8A.idx
Normal file
Binary file not shown.
Binary file not shown.
BIN
.cache/clangd/index/event_groups.c.6885087BA54583E6.idx
Normal file
BIN
.cache/clangd/index/event_groups.c.6885087BA54583E6.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/event_groups.h.620195F6DEC33ADF.idx
Normal file
BIN
.cache/clangd/index/event_groups.h.620195F6DEC33ADF.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/freertos.c.6C9829971BC70E3D.idx
Normal file
BIN
.cache/clangd/index/freertos.c.6C9829971BC70E3D.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/gpio.c.99CEBA32095AD56A.idx
Normal file
BIN
.cache/clangd/index/gpio.c.99CEBA32095AD56A.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/gpio.h.6B3EEE0E7DB97A4C.idx
Normal file
BIN
.cache/clangd/index/gpio.h.6B3EEE0E7DB97A4C.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/heap_4.c.43459590E84EDD34.idx
Normal file
BIN
.cache/clangd/index/heap_4.c.43459590E84EDD34.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/list.c.6392E9B65E4F44AE.idx
Normal file
BIN
.cache/clangd/index/list.c.6392E9B65E4F44AE.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/list.h.2FE0D91EF01693EC.idx
Normal file
BIN
.cache/clangd/index/list.h.2FE0D91EF01693EC.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/main.c.02F39C36264316B0.idx
Normal file
BIN
.cache/clangd/index/main.c.02F39C36264316B0.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/main.h.A48FFE76210930C7.idx
Normal file
BIN
.cache/clangd/index/main.h.A48FFE76210930C7.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/mpu_wrappers.h.FCFA8D07C5A60B12.idx
Normal file
BIN
.cache/clangd/index/mpu_wrappers.h.FCFA8D07C5A60B12.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/port.c.F31439BE6BD0054B.idx
Normal file
BIN
.cache/clangd/index/port.c.F31439BE6BD0054B.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/portable.h.0F11E291C80288EF.idx
Normal file
BIN
.cache/clangd/index/portable.h.0F11E291C80288EF.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/portmacro.h.0E11B7578D6BA67E.idx
Normal file
BIN
.cache/clangd/index/portmacro.h.0E11B7578D6BA67E.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/projdefs.h.1779426C09185126.idx
Normal file
BIN
.cache/clangd/index/projdefs.h.1779426C09185126.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/queue.c.535EAEB046F23162.idx
Normal file
BIN
.cache/clangd/index/queue.c.535EAEB046F23162.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/queue.h.E0C6905EA65CDB0E.idx
Normal file
BIN
.cache/clangd/index/queue.h.E0C6905EA65CDB0E.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/semphr.h.04BC78843E8BA6E1.idx
Normal file
BIN
.cache/clangd/index/semphr.h.04BC78843E8BA6E1.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stack_macros.h.C23368650ACA8653.idx
Normal file
BIN
.cache/clangd/index/stack_macros.h.C23368650ACA8653.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/startup_stm32f302x8.s.260704EBFB82C6FE.idx
Normal file
BIN
.cache/clangd/index/startup_stm32f302x8.s.260704EBFB82C6FE.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32_hal_legacy.h.DCF7AACBF6F3BD0C.idx
Normal file
BIN
.cache/clangd/index/stm32_hal_legacy.h.DCF7AACBF6F3BD0C.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f302x8.h.454AE557DA1A34B1.idx
Normal file
BIN
.cache/clangd/index/stm32f302x8.h.454AE557DA1A34B1.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx.h.6EB4DE0D565AC8C3.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx.h.6EB4DE0D565AC8C3.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal.c.B010154A9B77980B.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal.c.B010154A9B77980B.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal.h.AAFAFC34728F00FD.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal.h.AAFAFC34728F00FD.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_conf.h.DC8E562AB580330C.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_conf.h.DC8E562AB580330C.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_cortex.c.DCFA909807A57A23.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_cortex.c.DCFA909807A57A23.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_cortex.h.9D7E95075ACA5CED.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_cortex.h.9D7E95075ACA5CED.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_def.h.7B9224C402A94F41.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_def.h.7B9224C402A94F41.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_dma.c.6DA4FF353C12695C.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_dma.c.6DA4FF353C12695C.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_dma.h.BEDFB22566F1C92A.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_dma.h.BEDFB22566F1C92A.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_dma_ex.h.15A86144D91FB41B.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_dma_ex.h.15A86144D91FB41B.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_exti.c.22AB04DD540E4A47.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_exti.c.22AB04DD540E4A47.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_exti.h.7D79C925ACBBB114.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_exti.h.7D79C925ACBBB114.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_flash.c.A9CB76739A6EAAB0.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_flash.c.A9CB76739A6EAAB0.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_flash.h.30E3080B21B6001A.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_flash.h.30E3080B21B6001A.idx
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_gpio.c.60E740D690B009DB.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_gpio.c.60E740D690B009DB.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_gpio.h.089FDF9BA7083F02.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_gpio.h.089FDF9BA7083F02.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_gpio_ex.h.7C3A1E4BCFE5BE21.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_gpio_ex.h.7C3A1E4BCFE5BE21.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_i2c.c.65F9D145BCF313BA.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_i2c.c.65F9D145BCF313BA.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_i2c.h.26C38C391B03C70C.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_i2c.h.26C38C391B03C70C.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_i2c_ex.c.27695F8BED767FFD.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_i2c_ex.c.27695F8BED767FFD.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_i2c_ex.h.CC7D69547E52141F.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_i2c_ex.h.CC7D69547E52141F.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_msp.c.CD2AE54C756FD04D.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_msp.c.CD2AE54C756FD04D.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_pwr.c.571B3F9F4F389100.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_pwr.c.571B3F9F4F389100.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_pwr.h.44EC49ECBEF294B1.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_pwr.h.44EC49ECBEF294B1.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_pwr_ex.c.9FB5B349CEEA493B.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_pwr_ex.c.9FB5B349CEEA493B.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_pwr_ex.h.4460B6F16B8CCB40.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_pwr_ex.h.4460B6F16B8CCB40.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_rcc.c.7E6000173CC13469.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_rcc.c.7E6000173CC13469.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_rcc.h.4235944AB704AC3C.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_rcc.h.4235944AB704AC3C.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_rcc_ex.c.D34CF7C4508A8647.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_rcc_ex.c.D34CF7C4508A8647.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_rcc_ex.h.C276116E72AFE49D.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_rcc_ex.h.C276116E72AFE49D.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_tim.c.9921EF3B22592F57.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_tim.c.9921EF3B22592F57.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_tim.h.76DD86E9BFAB1D7A.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_tim.h.76DD86E9BFAB1D7A.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_tim_ex.c.4CF595D5A8255BF9.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_tim_ex.c.4CF595D5A8255BF9.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_tim_ex.h.3C42A7684443C1A0.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_tim_ex.h.3C42A7684443C1A0.idx
Normal file
Binary file not shown.
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_uart.c.356E75EF6A46FCD0.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_uart.c.356E75EF6A46FCD0.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_uart.h.592E26296402AB62.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_uart.h.592E26296402AB62.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_uart_ex.c.172C55E35F6E5473.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_uart_ex.c.172C55E35F6E5473.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_hal_uart_ex.h.F0702267B86885EE.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_hal_uart_ex.h.F0702267B86885EE.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_it.c.AF30F6D86E01D29E.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_it.c.AF30F6D86E01D29E.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stm32f3xx_it.h.78E75FA3FEEEDC64.idx
Normal file
BIN
.cache/clangd/index/stm32f3xx_it.h.78E75FA3FEEEDC64.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stream_buffer.c.9BCFCD78F9DEFE4C.idx
Normal file
BIN
.cache/clangd/index/stream_buffer.c.9BCFCD78F9DEFE4C.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/stream_buffer.h.2798ECB92587A36E.idx
Normal file
BIN
.cache/clangd/index/stream_buffer.h.2798ECB92587A36E.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/system_stm32f3xx.c.1CF745F49EC4E1DA.idx
Normal file
BIN
.cache/clangd/index/system_stm32f3xx.c.1CF745F49EC4E1DA.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/system_stm32f3xx.h.16A4AF264205B018.idx
Normal file
BIN
.cache/clangd/index/system_stm32f3xx.h.16A4AF264205B018.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/task.h.9E6E7F40D64A3678.idx
Normal file
BIN
.cache/clangd/index/task.h.9E6E7F40D64A3678.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/tasks.c.58F8EFB53B72E27F.idx
Normal file
BIN
.cache/clangd/index/tasks.c.58F8EFB53B72E27F.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/timers.c.1902EEE52F2E6ABF.idx
Normal file
BIN
.cache/clangd/index/timers.c.1902EEE52F2E6ABF.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/timers.h.88C7FA801A78DBF7.idx
Normal file
BIN
.cache/clangd/index/timers.h.88C7FA801A78DBF7.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/usart.c.33BD83B5A1F181B8.idx
Normal file
BIN
.cache/clangd/index/usart.c.33BD83B5A1F181B8.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/usart.h.97B63180D5672E68.idx
Normal file
BIN
.cache/clangd/index/usart.h.97B63180D5672E68.idx
Normal file
Binary file not shown.
31
.mxproject
31
.mxproject
File diff suppressed because one or more lines are too long
149
Core/Inc/FreeRTOSConfig.h
Executable file
149
Core/Inc/FreeRTOSConfig.h
Executable file
@ -0,0 +1,149 @@
|
||||
/* USER CODE BEGIN Header */
|
||||
/*
|
||||
* FreeRTOS Kernel V10.0.1
|
||||
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
* the Software without restriction, including without limitation the rights to
|
||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* http://www.FreeRTOS.org
|
||||
* http://aws.amazon.com/freertos
|
||||
*
|
||||
* 1 tab == 4 spaces!
|
||||
*/
|
||||
/* USER CODE END Header */
|
||||
|
||||
#ifndef FREERTOS_CONFIG_H
|
||||
#define FREERTOS_CONFIG_H
|
||||
|
||||
/*-----------------------------------------------------------
|
||||
* Application specific definitions.
|
||||
*
|
||||
* These definitions should be adjusted for your particular hardware and
|
||||
* application requirements.
|
||||
*
|
||||
* These parameters and more are described within the 'configuration' section of the
|
||||
* FreeRTOS API documentation available on the FreeRTOS.org web site.
|
||||
*
|
||||
* See http://www.freertos.org/a00110.html
|
||||
*----------------------------------------------------------*/
|
||||
|
||||
/* USER CODE BEGIN Includes */
|
||||
/* Section where include file can be added */
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Ensure definitions are only used by the compiler, and not by the assembler. */
|
||||
#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__)
|
||||
#include <stdint.h>
|
||||
extern uint32_t SystemCoreClock;
|
||||
#endif
|
||||
#define configUSE_PREEMPTION 1
|
||||
#define configSUPPORT_STATIC_ALLOCATION 1
|
||||
#define configSUPPORT_DYNAMIC_ALLOCATION 1
|
||||
#define configUSE_IDLE_HOOK 0
|
||||
#define configUSE_TICK_HOOK 0
|
||||
#define configCPU_CLOCK_HZ ( SystemCoreClock )
|
||||
#define configTICK_RATE_HZ ((TickType_t)1000)
|
||||
#define configMAX_PRIORITIES ( 56 )
|
||||
#define configMINIMAL_STACK_SIZE ((uint16_t)128)
|
||||
#define configTOTAL_HEAP_SIZE ((size_t)3072)
|
||||
#define configMAX_TASK_NAME_LEN ( 16 )
|
||||
#define configUSE_TRACE_FACILITY 1
|
||||
#define configUSE_16_BIT_TICKS 0
|
||||
#define configUSE_MUTEXES 1
|
||||
#define configQUEUE_REGISTRY_SIZE 8
|
||||
#define configUSE_RECURSIVE_MUTEXES 1
|
||||
#define configUSE_COUNTING_SEMAPHORES 1
|
||||
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
|
||||
|
||||
/* Co-routine definitions. */
|
||||
#define configUSE_CO_ROUTINES 0
|
||||
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
|
||||
|
||||
/* Software timer definitions. */
|
||||
#define configUSE_TIMERS 1
|
||||
#define configTIMER_TASK_PRIORITY ( 2 )
|
||||
#define configTIMER_QUEUE_LENGTH 10
|
||||
#define configTIMER_TASK_STACK_DEPTH 256
|
||||
|
||||
/* Set the following definitions to 1 to include the API function, or zero
|
||||
to exclude the API function. */
|
||||
#define INCLUDE_vTaskPrioritySet 1
|
||||
#define INCLUDE_uxTaskPriorityGet 1
|
||||
#define INCLUDE_vTaskDelete 1
|
||||
#define INCLUDE_vTaskCleanUpResources 0
|
||||
#define INCLUDE_vTaskSuspend 1
|
||||
#define INCLUDE_vTaskDelayUntil 1
|
||||
#define INCLUDE_vTaskDelay 1
|
||||
#define INCLUDE_xTaskGetSchedulerState 1
|
||||
#define INCLUDE_xTimerPendFunctionCall 1
|
||||
#define INCLUDE_xQueueGetMutexHolder 1
|
||||
#define INCLUDE_uxTaskGetStackHighWaterMark 1
|
||||
#define INCLUDE_eTaskGetState 1
|
||||
|
||||
/*
|
||||
* The CMSIS-RTOS V2 FreeRTOS wrapper is dependent on the heap implementation used
|
||||
* by the application thus the correct define need to be enabled below
|
||||
*/
|
||||
#define USE_FreeRTOS_HEAP_4
|
||||
|
||||
/* Cortex-M specific definitions. */
|
||||
#ifdef __NVIC_PRIO_BITS
|
||||
/* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
|
||||
#define configPRIO_BITS __NVIC_PRIO_BITS
|
||||
#else
|
||||
#define configPRIO_BITS 4
|
||||
#endif
|
||||
|
||||
/* The lowest interrupt priority that can be used in a call to a "set priority"
|
||||
function. */
|
||||
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15
|
||||
|
||||
/* The highest interrupt priority that can be used by any interrupt service
|
||||
routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
|
||||
INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
|
||||
PRIORITY THAN THIS! (higher priorities are lower numeric values. */
|
||||
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5
|
||||
|
||||
/* Interrupt priorities used by the kernel port layer itself. These are generic
|
||||
to all Cortex-M ports, and do not rely on any particular library functions. */
|
||||
#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
|
||||
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
|
||||
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
|
||||
#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
|
||||
|
||||
/* Normal assert() semantics without relying on the provision of an assert.h
|
||||
header file. */
|
||||
/* USER CODE BEGIN 1 */
|
||||
#define configASSERT( x ) if ((x) == 0) {taskDISABLE_INTERRUPTS(); for( ;; );}
|
||||
/* USER CODE END 1 */
|
||||
|
||||
/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
|
||||
standard names. */
|
||||
#define vPortSVCHandler SVC_Handler
|
||||
#define xPortPendSVHandler PendSV_Handler
|
||||
|
||||
/* IMPORTANT: This define is commented when used with STM32Cube firmware, when the timebase source is SysTick,
|
||||
to prevent overwriting SysTick_Handler defined within STM32Cube HAL */
|
||||
|
||||
#define xPortSysTickHandler SysTick_Handler
|
||||
|
||||
/* USER CODE BEGIN Defines */
|
||||
/* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */
|
||||
/* USER CODE END Defines */
|
||||
|
||||
#endif /* FREERTOS_CONFIG_H */
|
||||
49
Core/Inc/gpio.h
Executable file
49
Core/Inc/gpio.h
Executable file
@ -0,0 +1,49 @@
|
||||
/* USER CODE BEGIN Header */
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file gpio.h
|
||||
* @brief This file contains all the function prototypes for
|
||||
* the gpio.c file
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2023 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
/* USER CODE END Header */
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __GPIO_H__
|
||||
#define __GPIO_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
|
||||
/* USER CODE BEGIN Includes */
|
||||
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* USER CODE BEGIN Private defines */
|
||||
|
||||
/* USER CODE END Private defines */
|
||||
|
||||
void MX_GPIO_Init(void);
|
||||
|
||||
/* USER CODE BEGIN Prototypes */
|
||||
|
||||
/* USER CODE END Prototypes */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /*__ GPIO_H__ */
|
||||
|
||||
@ -57,6 +57,20 @@ void Error_Handler(void);
|
||||
/* USER CODE END EFP */
|
||||
|
||||
/* Private defines -----------------------------------------------------------*/
|
||||
#define B1_Pin GPIO_PIN_13
|
||||
#define B1_GPIO_Port GPIOC
|
||||
#define USART_TX_Pin GPIO_PIN_2
|
||||
#define USART_TX_GPIO_Port GPIOA
|
||||
#define USART_RX_Pin GPIO_PIN_3
|
||||
#define USART_RX_GPIO_Port GPIOA
|
||||
#define LD2_Pin GPIO_PIN_13
|
||||
#define LD2_GPIO_Port GPIOB
|
||||
#define TMS_Pin GPIO_PIN_13
|
||||
#define TMS_GPIO_Port GPIOA
|
||||
#define TCK_Pin GPIO_PIN_14
|
||||
#define TCK_GPIO_Port GPIOA
|
||||
#define SWO_Pin GPIO_PIN_3
|
||||
#define SWO_GPIO_Port GPIOB
|
||||
|
||||
/* USER CODE BEGIN Private defines */
|
||||
|
||||
|
||||
@ -57,8 +57,8 @@
|
||||
/*#define HAL_RNG_MODULE_ENABLED */
|
||||
/*#define HAL_RTC_MODULE_ENABLED */
|
||||
/*#define HAL_SPI_MODULE_ENABLED */
|
||||
/*#define HAL_TIM_MODULE_ENABLED */
|
||||
/*#define HAL_UART_MODULE_ENABLED */
|
||||
#define HAL_TIM_MODULE_ENABLED
|
||||
#define HAL_UART_MODULE_ENABLED
|
||||
/*#define HAL_USART_MODULE_ENABLED */
|
||||
/*#define HAL_IRDA_MODULE_ENABLED */
|
||||
/*#define HAL_SMARTCARD_MODULE_ENABLED */
|
||||
|
||||
@ -51,10 +51,8 @@ void HardFault_Handler(void);
|
||||
void MemManage_Handler(void);
|
||||
void BusFault_Handler(void);
|
||||
void UsageFault_Handler(void);
|
||||
void SVC_Handler(void);
|
||||
void DebugMon_Handler(void);
|
||||
void PendSV_Handler(void);
|
||||
void SysTick_Handler(void);
|
||||
void TIM1_UP_TIM16_IRQHandler(void);
|
||||
/* USER CODE BEGIN EFP */
|
||||
|
||||
/* USER CODE END EFP */
|
||||
|
||||
52
Core/Inc/usart.h
Executable file
52
Core/Inc/usart.h
Executable file
@ -0,0 +1,52 @@
|
||||
/* USER CODE BEGIN Header */
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file usart.h
|
||||
* @brief This file contains all the function prototypes for
|
||||
* the usart.c file
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2023 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
/* USER CODE END Header */
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __USART_H__
|
||||
#define __USART_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
|
||||
/* USER CODE BEGIN Includes */
|
||||
|
||||
/* USER CODE END Includes */
|
||||
|
||||
extern UART_HandleTypeDef huart2;
|
||||
|
||||
/* USER CODE BEGIN Private defines */
|
||||
|
||||
/* USER CODE END Private defines */
|
||||
|
||||
void MX_USART2_UART_Init(void);
|
||||
|
||||
/* USER CODE BEGIN Prototypes */
|
||||
|
||||
/* USER CODE END Prototypes */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __USART_H__ */
|
||||
|
||||
129
Core/Src/freertos.c
Executable file
129
Core/Src/freertos.c
Executable file
@ -0,0 +1,129 @@
|
||||
/* USER CODE BEGIN Header */
|
||||
/**
|
||||
******************************************************************************
|
||||
* File Name : freertos.c
|
||||
* Description : Code for freertos applications
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2023 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
/* USER CODE END Header */
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
#include "main.h"
|
||||
#include "cmsis_os.h"
|
||||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN PTD */
|
||||
|
||||
/* USER CODE END PTD */
|
||||
|
||||
/* Private define ------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN PD */
|
||||
|
||||
/* USER CODE END PD */
|
||||
|
||||
/* Private macro -------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN PM */
|
||||
|
||||
/* USER CODE END PM */
|
||||
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Variables */
|
||||
|
||||
/* USER CODE END Variables */
|
||||
/* Definitions for defaultTask */
|
||||
osThreadId_t defaultTaskHandle;
|
||||
const osThreadAttr_t defaultTask_attributes = {
|
||||
.name = "defaultTask",
|
||||
.stack_size = 128 * 4,
|
||||
.priority = (osPriority_t) osPriorityNormal,
|
||||
};
|
||||
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
/* USER CODE BEGIN FunctionPrototypes */
|
||||
|
||||
/* USER CODE END FunctionPrototypes */
|
||||
|
||||
void StartDefaultTask(void *argument);
|
||||
|
||||
void MX_FREERTOS_Init(void); /* (MISRA C 2004 rule 8.1) */
|
||||
|
||||
/**
|
||||
* @brief FreeRTOS initialization
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void MX_FREERTOS_Init(void) {
|
||||
/* USER CODE BEGIN Init */
|
||||
|
||||
/* USER CODE END Init */
|
||||
|
||||
/* USER CODE BEGIN RTOS_MUTEX */
|
||||
/* add mutexes, ... */
|
||||
/* USER CODE END RTOS_MUTEX */
|
||||
|
||||
/* USER CODE BEGIN RTOS_SEMAPHORES */
|
||||
/* add semaphores, ... */
|
||||
/* USER CODE END RTOS_SEMAPHORES */
|
||||
|
||||
/* USER CODE BEGIN RTOS_TIMERS */
|
||||
/* start timers, add new ones, ... */
|
||||
/* USER CODE END RTOS_TIMERS */
|
||||
|
||||
/* USER CODE BEGIN RTOS_QUEUES */
|
||||
/* add queues, ... */
|
||||
/* USER CODE END RTOS_QUEUES */
|
||||
|
||||
/* Create the thread(s) */
|
||||
/* creation of defaultTask */
|
||||
defaultTaskHandle = osThreadNew(StartDefaultTask, NULL, &defaultTask_attributes);
|
||||
|
||||
/* USER CODE BEGIN RTOS_THREADS */
|
||||
/* add threads, ... */
|
||||
/* USER CODE END RTOS_THREADS */
|
||||
|
||||
/* USER CODE BEGIN RTOS_EVENTS */
|
||||
/* add events, ... */
|
||||
/* USER CODE END RTOS_EVENTS */
|
||||
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN Header_StartDefaultTask */
|
||||
/**
|
||||
* @brief Function implementing the defaultTask thread.
|
||||
* @param argument: Not used
|
||||
* @retval None
|
||||
*/
|
||||
/* USER CODE END Header_StartDefaultTask */
|
||||
void StartDefaultTask(void *argument)
|
||||
{
|
||||
/* USER CODE BEGIN StartDefaultTask */
|
||||
/* Infinite loop */
|
||||
for(;;)
|
||||
{
|
||||
osDelay(1);
|
||||
}
|
||||
/* USER CODE END StartDefaultTask */
|
||||
}
|
||||
|
||||
/* Private application code --------------------------------------------------*/
|
||||
/* USER CODE BEGIN Application */
|
||||
|
||||
/* USER CODE END Application */
|
||||
|
||||
73
Core/Src/gpio.c
Executable file
73
Core/Src/gpio.c
Executable file
@ -0,0 +1,73 @@
|
||||
/* USER CODE BEGIN Header */
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file gpio.c
|
||||
* @brief This file provides code for the configuration
|
||||
* of all used GPIO pins.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2023 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
/* USER CODE END Header */
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "gpio.h"
|
||||
|
||||
/* USER CODE BEGIN 0 */
|
||||
|
||||
/* USER CODE END 0 */
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Configure GPIO */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN 1 */
|
||||
|
||||
/* USER CODE END 1 */
|
||||
|
||||
/** Configure pins as
|
||||
* Analog
|
||||
* Input
|
||||
* Output
|
||||
* EVENT_OUT
|
||||
* EXTI
|
||||
*/
|
||||
void MX_GPIO_Init(void)
|
||||
{
|
||||
|
||||
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
||||
|
||||
/* GPIO Ports Clock Enable */
|
||||
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOF_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin : PtPin */
|
||||
GPIO_InitStruct.Pin = B1_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(B1_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : PtPin */
|
||||
GPIO_InitStruct.Pin = LD2_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(LD2_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 2 */
|
||||
|
||||
/* USER CODE END 2 */
|
||||
@ -18,6 +18,9 @@
|
||||
/* USER CODE END Header */
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
#include "cmsis_os.h"
|
||||
#include "usart.h"
|
||||
#include "gpio.h"
|
||||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
@ -47,6 +50,7 @@
|
||||
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
void SystemClock_Config(void);
|
||||
void MX_FREERTOS_Init(void);
|
||||
/* USER CODE BEGIN PFP */
|
||||
|
||||
/* USER CODE END PFP */
|
||||
@ -83,10 +87,19 @@ int main(void)
|
||||
/* USER CODE END SysInit */
|
||||
|
||||
/* Initialize all configured peripherals */
|
||||
MX_GPIO_Init();
|
||||
MX_USART2_UART_Init();
|
||||
/* USER CODE BEGIN 2 */
|
||||
|
||||
/* USER CODE END 2 */
|
||||
|
||||
/* Init scheduler */
|
||||
osKernelInitialize(); /* Call init function for freertos objects (in freertos.c) */
|
||||
MX_FREERTOS_Init();
|
||||
|
||||
/* Start scheduler */
|
||||
osKernelStart();
|
||||
/* We should never get here as control is now taken by the scheduler */
|
||||
/* Infinite loop */
|
||||
/* USER CODE BEGIN WHILE */
|
||||
while (1)
|
||||
@ -113,7 +126,9 @@ void SystemClock_Config(void)
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
|
||||
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
|
||||
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
|
||||
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL16;
|
||||
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
@ -123,12 +138,12 @@ void SystemClock_Config(void)
|
||||
*/
|
||||
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|
||||
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
|
||||
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI;
|
||||
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
|
||||
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
||||
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
|
||||
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
|
||||
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
|
||||
|
||||
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_0) != HAL_OK)
|
||||
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
@ -138,6 +153,27 @@ void SystemClock_Config(void)
|
||||
|
||||
/* USER CODE END 4 */
|
||||
|
||||
/**
|
||||
* @brief Period elapsed callback in non blocking mode
|
||||
* @note This function is called when TIM1 interrupt took place, inside
|
||||
* HAL_TIM_IRQHandler(). It makes a direct call to HAL_IncTick() to increment
|
||||
* a global variable "uwTick" used as application time base.
|
||||
* @param htim : TIM handle
|
||||
* @retval None
|
||||
*/
|
||||
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
|
||||
{
|
||||
/* USER CODE BEGIN Callback 0 */
|
||||
|
||||
/* USER CODE END Callback 0 */
|
||||
if (htim->Instance == TIM1) {
|
||||
HAL_IncTick();
|
||||
}
|
||||
/* USER CODE BEGIN Callback 1 */
|
||||
|
||||
/* USER CODE END Callback 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function is executed in case of error occurrence.
|
||||
* @retval None
|
||||
|
||||
@ -70,6 +70,8 @@ void HAL_MspInit(void)
|
||||
__HAL_RCC_PWR_CLK_ENABLE();
|
||||
|
||||
/* System interrupt init*/
|
||||
/* PendSV_IRQn interrupt configuration */
|
||||
HAL_NVIC_SetPriority(PendSV_IRQn, 15, 0);
|
||||
|
||||
/* USER CODE BEGIN MspInit 1 */
|
||||
|
||||
|
||||
128
Core/Src/stm32f3xx_hal_timebase_tim.c
Executable file
128
Core/Src/stm32f3xx_hal_timebase_tim.c
Executable file
@ -0,0 +1,128 @@
|
||||
/* USER CODE BEGIN Header */
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32f3xx_hal_timebase_TIM.c
|
||||
* @brief HAL time base based on the hardware TIM.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2023 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
/* USER CODE END Header */
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32f3xx_hal.h"
|
||||
#include "stm32f3xx_hal_tim.h"
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
/* Private define ------------------------------------------------------------*/
|
||||
/* Private macro -------------------------------------------------------------*/
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
TIM_HandleTypeDef htim1;
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
/* Private functions ---------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* @brief This function configures the TIM1 as a time base source.
|
||||
* The time source is configured to have 1ms time base with a dedicated
|
||||
* Tick interrupt priority.
|
||||
* @note This function is called automatically at the beginning of program after
|
||||
* reset by HAL_Init() or at any time when clock is configured, by HAL_RCC_ClockConfig().
|
||||
* @param TickPriority: Tick interrupt priority.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
|
||||
{
|
||||
RCC_ClkInitTypeDef clkconfig;
|
||||
uint32_t uwTimclock = 0U;
|
||||
|
||||
uint32_t uwPrescalerValue = 0U;
|
||||
uint32_t pFLatency;
|
||||
HAL_StatusTypeDef status;
|
||||
|
||||
/* Enable TIM1 clock */
|
||||
__HAL_RCC_TIM1_CLK_ENABLE();
|
||||
|
||||
/* Get clock configuration */
|
||||
HAL_RCC_GetClockConfig(&clkconfig, &pFLatency);
|
||||
|
||||
/* Compute TIM1 clock */
|
||||
uwTimclock = HAL_RCC_GetPCLK2Freq();
|
||||
|
||||
/* Compute the prescaler value to have TIM1 counter clock equal to 1MHz */
|
||||
uwPrescalerValue = (uint32_t) ((uwTimclock / 1000000U) - 1U);
|
||||
|
||||
/* Initialize TIM1 */
|
||||
htim1.Instance = TIM1;
|
||||
|
||||
/* Initialize TIMx peripheral as follow:
|
||||
|
||||
+ Period = [(TIM1CLK/1000) - 1]. to have a (1/1000) s time base.
|
||||
+ Prescaler = (uwTimclock/1000000 - 1) to have a 1MHz counter clock.
|
||||
+ ClockDivision = 0
|
||||
+ Counter direction = Up
|
||||
*/
|
||||
htim1.Init.Period = (1000000U / 1000U) - 1U;
|
||||
htim1.Init.Prescaler = uwPrescalerValue;
|
||||
htim1.Init.ClockDivision = 0;
|
||||
htim1.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
||||
|
||||
status = HAL_TIM_Base_Init(&htim1);
|
||||
if (status == HAL_OK)
|
||||
{
|
||||
/* Start the TIM time Base generation in interrupt mode */
|
||||
status = HAL_TIM_Base_Start_IT(&htim1);
|
||||
if (status == HAL_OK)
|
||||
{
|
||||
/* Enable the TIM1 global Interrupt */
|
||||
HAL_NVIC_EnableIRQ(TIM1_UP_TIM16_IRQn);
|
||||
/* Configure the SysTick IRQ priority */
|
||||
if (TickPriority < (1UL << __NVIC_PRIO_BITS))
|
||||
{
|
||||
/* Configure the TIM IRQ priority */
|
||||
HAL_NVIC_SetPriority(TIM1_UP_TIM16_IRQn, TickPriority, 0U);
|
||||
uwTickPrio = TickPriority;
|
||||
}
|
||||
else
|
||||
{
|
||||
status = HAL_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Return function status */
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Suspend Tick increment.
|
||||
* @note Disable the tick increment by disabling TIM1 update interrupt.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void HAL_SuspendTick(void)
|
||||
{
|
||||
/* Disable TIM1 update Interrupt */
|
||||
__HAL_TIM_DISABLE_IT(&htim1, TIM_IT_UPDATE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Resume Tick increment.
|
||||
* @note Enable the tick increment by Enabling TIM1 update interrupt.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void HAL_ResumeTick(void)
|
||||
{
|
||||
/* Enable TIM1 Update interrupt */
|
||||
__HAL_TIM_ENABLE_IT(&htim1, TIM_IT_UPDATE);
|
||||
}
|
||||
|
||||
@ -55,6 +55,7 @@
|
||||
/* USER CODE END 0 */
|
||||
|
||||
/* External variables --------------------------------------------------------*/
|
||||
extern TIM_HandleTypeDef htim1;
|
||||
|
||||
/* USER CODE BEGIN EV */
|
||||
|
||||
@ -138,19 +139,6 @@ void UsageFault_Handler(void)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles System service call via SWI instruction.
|
||||
*/
|
||||
void SVC_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN SVCall_IRQn 0 */
|
||||
|
||||
/* USER CODE END SVCall_IRQn 0 */
|
||||
/* USER CODE BEGIN SVCall_IRQn 1 */
|
||||
|
||||
/* USER CODE END SVCall_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Debug monitor.
|
||||
*/
|
||||
@ -164,33 +152,6 @@ void DebugMon_Handler(void)
|
||||
/* USER CODE END DebugMonitor_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Pendable request for system service.
|
||||
*/
|
||||
void PendSV_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN PendSV_IRQn 0 */
|
||||
|
||||
/* USER CODE END PendSV_IRQn 0 */
|
||||
/* USER CODE BEGIN PendSV_IRQn 1 */
|
||||
|
||||
/* USER CODE END PendSV_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles System tick timer.
|
||||
*/
|
||||
void SysTick_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN SysTick_IRQn 0 */
|
||||
|
||||
/* USER CODE END SysTick_IRQn 0 */
|
||||
HAL_IncTick();
|
||||
/* USER CODE BEGIN SysTick_IRQn 1 */
|
||||
|
||||
/* USER CODE END SysTick_IRQn 1 */
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* STM32F3xx Peripheral Interrupt Handlers */
|
||||
/* Add here the Interrupt Handlers for the used peripherals. */
|
||||
@ -198,6 +159,20 @@ void SysTick_Handler(void)
|
||||
/* please refer to the startup file (startup_stm32f3xx.s). */
|
||||
/******************************************************************************/
|
||||
|
||||
/**
|
||||
* @brief This function handles TIM1 update and TIM16 interrupts.
|
||||
*/
|
||||
void TIM1_UP_TIM16_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN TIM1_UP_TIM16_IRQn 0 */
|
||||
|
||||
/* USER CODE END TIM1_UP_TIM16_IRQn 0 */
|
||||
HAL_TIM_IRQHandler(&htim1);
|
||||
/* USER CODE BEGIN TIM1_UP_TIM16_IRQn 1 */
|
||||
|
||||
/* USER CODE END TIM1_UP_TIM16_IRQn 1 */
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 1 */
|
||||
|
||||
/* USER CODE END 1 */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user