STM32的库 V3.3.0 的tim.c中的函数是否有BUG

[复制链接]
3341|3
 楼主| 32446975 发表于 2011-2-14 11:45 | 显示全部楼层 |阅读模式
* @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;
}
sjnh 发表于 2011-2-14 11:59 | 显示全部楼层
rc w0, 写0清,写1不清
香水城 发表于 2011-2-14 14:13 | 显示全部楼层
LZ说说为什么使用时会修改其它的标志位?
hjiongh 发表于 2011-2-17 17:11 | 显示全部楼层
LZ应该是没有仔细看User Manual
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:STM32,STM8,51,PIC,AVR。QQ:281342118

5

主题

69

帖子

2

粉丝
快速回复 在线客服 返回列表 返回顶部