diff options
Diffstat (limited to 'Projects/NUCLEO-WB15CC/Examples/HAL/HAL_TimeBase_TIM/Src/stm32wbxx_hal_timebase_tim.c')
-rw-r--r-- | Projects/NUCLEO-WB15CC/Examples/HAL/HAL_TimeBase_TIM/Src/stm32wbxx_hal_timebase_tim.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/Projects/NUCLEO-WB15CC/Examples/HAL/HAL_TimeBase_TIM/Src/stm32wbxx_hal_timebase_tim.c b/Projects/NUCLEO-WB15CC/Examples/HAL/HAL_TimeBase_TIM/Src/stm32wbxx_hal_timebase_tim.c index 517db51fd..a5d69f4c2 100644 --- a/Projects/NUCLEO-WB15CC/Examples/HAL/HAL_TimeBase_TIM/Src/stm32wbxx_hal_timebase_tim.c +++ b/Projects/NUCLEO-WB15CC/Examples/HAL/HAL_TimeBase_TIM/Src/stm32wbxx_hal_timebase_tim.c @@ -6,13 +6,12 @@ ****************************************************************************** * @attention * - * <h2><center>© Copyright (c) 2020 STMicroelectronics. - * All rights reserved.</center></h2> + * Copyright (c) 2020-2021 STMicroelectronics. + * All rights reserved. * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause + * 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. * ****************************************************************************** */ @@ -50,6 +49,7 @@ HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) /* Enable the TIM2 global Interrupt */ HAL_NVIC_EnableIRQ(TIM2_IRQn); + /* Enable TIM2 clock */ __HAL_RCC_TIM2_CLK_ENABLE(); @@ -74,6 +74,7 @@ HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) htim2.Init.Prescaler = uwPrescalerValue; htim2.Init.ClockDivision = 0; htim2.Init.CounterMode = TIM_COUNTERMODE_UP; + if(HAL_TIM_Base_Init(&htim2) == HAL_OK) { /* Start the TIM time Base generation in interrupt mode */ @@ -107,5 +108,3 @@ void HAL_ResumeTick(void) /* Enable TIM2 Update interrupt */ __HAL_TIM_ENABLE_IT(&htim2, TIM_IT_UPDATE); } - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |