* @file stm32f10x_tim.c
* @author MCD Application Team
* @version V3.3.0
* @date 04/16/2010
* @brief This file provides all the TIM firmware functions.
1.
void TIM_ClearFlag(TIM_TypeDef* TIMx, uint16_t TIM_FLAG)
{
/* Clear the flags */
TIMx->SR = (uint16_t)~TIM_FLAG;
}
使用时会修改其它的标志位.
是否应该改为
void TIM_ClearFlag(TIM_TypeDef* TIMx, uint16_t TIM_FLAG)
{
/* Clear the flags */
TIMx->SR &= (uint16_t)~TIM_FLAG;
}
2.这个函数也有同样的问题.
void TIM_ClearITPendingBit(TIM_TypeDef* TIMx, uint16_t TIM_IT)
{
/* Clear the IT pending Bit */
TIMx->SR = (uint16_t)~TIM_IT;
}