/* Checks whether the specified TIM flag is set or not.  */
FlagStatus TIM_GetFlagStatus(TIM_TypeDef *tim, TIMFLAG_Typedef flag)
/* Checks whether the specified TIM flag is set or not.  */
FlagStatus TIM_GetFlagStatus(TIM_TypeDef *tim, TIMFLAG_Typedef flag)
{
    return ((tim->SR & flag) ? SET : RESET);
}