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