打印

请教二个库函数的区别 ???

[复制链接]
3430|7
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
hwrhys|  楼主 | 2012-2-25 15:48 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
我看不出这二个库函数有什么区别?? 请各位专家给与指导:
/**

库函数3.4版
:
EXTI_ClearFlag;
00203
* @brief
Clears the EXTI?s line pending flags.
00204
* @param
EXTI_Line: specifies the EXTI lines flags to clear.
00205
*
This parameter can be any combination of EXTI_Linex where x can be (0..19).
00206
* @retval None
00207
*/
00208 void EXTI_ClearFlag(uint32_t EXTI_Line)00209 {00210
/* Check the parameters */
00211
assert_param(IS_EXTI_LINE(EXTI_Line));00212
00213
EXTI->PR = EXTI_Line;   指它***************,00214 }
/**
库函数3.4版
: EXTI_ClearITPendingBit;
00243
* @brief
Clears the EXTI?s line pending bits.
00244
* @param
EXTI_Line: specifies the EXTI lines to clear.
00245
*
This parameter can be any combination of EXTI_Linex where x can be (0..19).
00246
* @retval None
00247
*/
00248 void EXTI_ClearITPendingBit(uint32_t EXTI_Line)00249 {00250
/* Check the parameters */
00251
assert_param(IS_EXTI_LINE(EXTI_Line));00252
00253
EXTI->PR = EXTI_Line;
这个表达式和上边的函数一样,怎么回事
??????????
00254 }  我试了一下:
      我原来的程序是这样的:


EXTI_ClearITPendingBit(EXTI_Line11);


EXTI_ClearFlag(EXTI_Line11);

   只用这一个原函数也可以:
EXTI->PR = EXTI_Line11;

ST的库函数表达的有问题吗 ?????????????
沙发
aozima| | 2012-2-25 17:02 | 只看该作者
楼主的贴子没有可读性,

1.代表不要使用全角字符
2.注意代码格式
3.在BBS发贴时,代码请加code标签。

使用特权

评论回复
板凳
hwrhys|  楼主 | 2012-2-25 17:37 | 只看该作者
重发一遍,

/**

库函数3.4版
:
EXTI_ClearFlag;

* @brief
Clears the EXTI?s line pending flags.

* @param
EXTI_Line: specifies the EXTI lines flags to clear.

*
This parameter can be any combination of EXTI_Linex where x can be (0..19).

* @retval None
*/
void EXTI_ClearFlag(uint32_t EXTI_Line){
/* Check the parameters */
   assert_param(IS_EXTI_LINE(EXTI_Line));


EXTI->;PR = EXTI_Line;}

/**
库函数3.4版
: EXTI_ClearITPendingBit;


* @brief
Clears the EXTI?s line pending bits.

* @param
EXTI_Line: specifies the EXTI lines to clear.

*
This parameter can be any combination of EXTI_Linex where x can be (0..19).

* @retval None

*/
void EXTI_ClearITPendingBit(uint32_t EXTI_Line){
/* Check the parameters */
   assert_param(IS_EXTI_LINE(EXTI_Line));  EXTI->;PR = EXTI_Line;

这个表达式和上边的函数一样,怎么回事
??????????
}
我试了一下:
      我原来的程序是这样的:
EXTI_ClearITPendingBit(EXTI_Line11);

EXTI_ClearFlag(EXTI_Line11);

   只用这一个原函数也可以:
EXTI->R = EXTI_Line11;
程序也执行正常。

ST的库函数表达的有问题吗 ???
??????

使用特权

评论回复
地板
aozima| | 2012-2-25 18:11 | 只看该作者
/**
  * @brief  Clears the EXTI抯 line pending bits.
  * @param  EXTI_Line: specifies the EXTI lines to clear.
  *   This parameter can be any combination of EXTI_Linex where x can be (0..19).
  * @retval None
  */
void EXTI_ClearITPendingBit(uint32_t EXTI_Line)
{
  /* Check the parameters */
  assert_param(IS_EXTI_LINE(EXTI_Line));
  
  EXTI->R = EXTI_Line;
}
/**
  * @brief  Clears the EXTI抯 line pending flags.
  * @param  EXTI_Line: specifies the EXTI lines flags to clear.
  *   This parameter can be any combination of EXTI_Linex where x can be (0..19).
  * @retval None
  */
void EXTI_ClearFlag(uint32_t EXTI_Line)
{
  /* Check the parameters */
  assert_param(IS_EXTI_LINE(EXTI_Line));
  
  EXTI->R = EXTI_Line;
}



这样看起来是不是赏心悦目些?

使用特权

评论回复
5
aozima| | 2012-2-25 18:13 | 只看该作者
通过对比来看,仅是名称不同,作用一样。

使用特权

评论回复
6
哲哲55| | 2012-2-25 20:20 | 只看该作者
在搞什麽?

使用特权

评论回复
7
linqing171| | 2012-2-26 08:28 | 只看该作者
从beyond compare的图中看,是一样的。
估计新版本命名更规范了。
感觉进入中断后,除了操作数据寄存器外,还需要清空中断标志位的,都是用pending 这个词。。。。

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

5

主题

50

帖子

0

粉丝