Skip to content

Commit 27be2e1

Browse files
committed
STM32 16 bits ticker: don't check FLAG just clear it
Not having the check will make the code more efficient.
1 parent 1b684ca commit 27be2e1

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

targets/TARGET_STM/us_ticker_16b.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,7 @@ void us_ticker_disable_interrupt(void)
113113
void us_ticker_clear_interrupt(void)
114114
{
115115
TimMasterHandle.Instance = TIM_MST;
116-
if (__HAL_TIM_GET_FLAG(&TimMasterHandle, TIM_FLAG_CC1) == SET) {
117-
__HAL_TIM_CLEAR_FLAG(&TimMasterHandle, TIM_FLAG_CC1);
118-
}
116+
__HAL_TIM_CLEAR_FLAG(&TimMasterHandle, TIM_FLAG_CC1);
119117
}
120118

121119
#endif // TIM_MST_16BIT

0 commit comments

Comments
 (0)