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

[复制链接]
4193|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 | 显示全部楼层
  1. /**
  2.   * @brief  Clears the EXTI抯 line pending bits.
  3.   * @param  EXTI_Line: specifies the EXTI lines to clear.
  4.   *   This parameter can be any combination of EXTI_Linex where x can be (0..19).
  5.   * @retval None
  6.   */
  7. void EXTI_ClearITPendingBit(uint32_t EXTI_Line)
  8. {
  9.   /* Check the parameters */
  10.   assert_param(IS_EXTI_LINE(EXTI_Line));
  11.   
  12.   EXTI->R = EXTI_Line;
  13. }
  1. /**
  2.   * @brief  Clears the EXTI抯 line pending flags.
  3.   * @param  EXTI_Line: specifies the EXTI lines flags to clear.
  4.   *   This parameter can be any combination of EXTI_Linex where x can be (0..19).
  5.   * @retval None
  6.   */
  7. void EXTI_ClearFlag(uint32_t EXTI_Line)
  8. {
  9.   /* Check the parameters */
  10.   assert_param(IS_EXTI_LINE(EXTI_Line));
  11.   
  12.   EXTI->R = EXTI_Line;
  13. }



这样看起来是不是赏心悦目些?
aozima 发表于 2012-2-25 18:13 | 显示全部楼层
通过对比来看,仅是名称不同,作用一样。
对比.png
哲哲55 发表于 2012-2-25 20:20 | 显示全部楼层
在搞什麽?
linqing171 发表于 2012-2-26 08:28 | 显示全部楼层
从beyond compare的图中看,是一样的。
估计新版本命名更规范了。
感觉进入中断后,除了操作数据寄存器外,还需要清空中断标志位的,都是用pending 这个词。。。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

5

主题

50

帖子

0

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