mirror of https://github.com/ARMmbed/mbed-os.git
STM32: TIM: Initialize new TIM parameter
parent
cdcaf2a473
commit
b15fc6a6b5
|
@ -118,6 +118,9 @@ HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
|
|||
TimMasterHandle.Init.Prescaler = (uint32_t)(SystemCoreClock / 1000000) - 1; // 1 us tick
|
||||
TimMasterHandle.Init.ClockDivision = 0;
|
||||
TimMasterHandle.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
#ifdef TARGET_STM32F0
|
||||
TimMasterHandle.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
||||
#endif
|
||||
HAL_TIM_Base_Init(&TimMasterHandle);
|
||||
|
||||
// Configure output compare channel 1 for mbed timeout (enabled later when used)
|
||||
|
|
|
@ -99,6 +99,9 @@ HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
|
|||
TimMasterHandle.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
#if !TARGET_STM32L1
|
||||
TimMasterHandle.Init.RepetitionCounter = 0;
|
||||
#endif
|
||||
#ifdef TARGET_STM32F0
|
||||
TimMasterHandle.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
||||
#endif
|
||||
HAL_TIM_OC_Init(&TimMasterHandle);
|
||||
|
||||
|
|
Loading…
Reference in New Issue