Skip to content

Commit a296366

Browse files
authored
Merge pull request #3345 from bcostm/fix_suspend_tick
STM32 - Remove TIM_IT_UPDATE flag in HAL_Suspend/ResumeTick functions
2 parents c8c01f0 + 18dc6f4 commit a296366

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

targets/TARGET_STM/hal_tick_16b.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,15 +167,13 @@ HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
167167
void HAL_SuspendTick(void)
168168
{
169169
TimMasterHandle.Instance = TIM_MST;
170-
// Disable HAL tick and us_ticker update interrupts (used for 32 bit counter)
171-
__HAL_TIM_DISABLE_IT(&TimMasterHandle, (TIM_IT_CC2 | TIM_IT_UPDATE));
170+
__HAL_TIM_DISABLE_IT(&TimMasterHandle, TIM_IT_CC2);
172171
}
173172

174173
void HAL_ResumeTick(void)
175174
{
176175
TimMasterHandle.Instance = TIM_MST;
177-
// Enable HAL tick and us_ticker update interrupts (used for 32 bit counter)
178-
__HAL_TIM_ENABLE_IT(&TimMasterHandle, (TIM_IT_CC2 | TIM_IT_UPDATE));
176+
__HAL_TIM_ENABLE_IT(&TimMasterHandle, TIM_IT_CC2);
179177
}
180178

181179
#endif // TIM_MST_16BIT

targets/TARGET_STM/hal_tick_32b.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,13 @@ HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
130130
void HAL_SuspendTick(void)
131131
{
132132
TimMasterHandle.Instance = TIM_MST;
133-
// Disable HAL tick and us_ticker update interrupts (used for 32 bit counter)
134-
__HAL_TIM_DISABLE_IT(&TimMasterHandle, (TIM_IT_CC2 | TIM_IT_UPDATE));
133+
__HAL_TIM_DISABLE_IT(&TimMasterHandle, TIM_IT_CC2);
135134
}
136135

137136
void HAL_ResumeTick(void)
138137
{
139138
TimMasterHandle.Instance = TIM_MST;
140-
// Enable HAL tick and us_ticker update interrupts (used for 32 bit counter)
141-
__HAL_TIM_ENABLE_IT(&TimMasterHandle, (TIM_IT_CC2 | TIM_IT_UPDATE));
139+
__HAL_TIM_ENABLE_IT(&TimMasterHandle, TIM_IT_CC2);
142140
}
143141

144142
#endif // !TIM_MST_16BIT

0 commit comments

Comments
 (0)