你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

查看: 11563|回复: 3

stm32的can接收中断中怎么不用清中断

[复制链接]

12

主题

14

回帖

0

蝴蝶豆

新手上路

最后登录
1970-1-1
发表于 2011-11-25 19:15:13 | 显示全部楼层 |阅读模式
中断实验不是在中断函数中清中断,
stm32的usart接收中断中就清中断
回复

使用道具 举报

134

主题

4489

回帖

239

蝴蝶豆

版主

最后登录
2020-12-9
发表于 2011-11-25 21:06:52 | 显示全部楼层

RE:stm32的can接收中断中怎么不用清中断

CAN也可以是查询接收,所以不用清除中断。这个要看程序了。如果是中断,必须清除中断标志位。
回复 支持 反对

使用道具 举报

12

主题

14

回帖

0

蝴蝶豆

新手上路

最后登录
1970-1-1
 楼主| 发表于 2011-11-26 14:23:41 | 显示全部楼层

回复:stm32的can接收中断中怎么不用清中断

回复第 2 楼 于2011-11-25 13:06:52发表:
CAN也可以是查询接收,所以不用清除中断。这个要看程序了。如果是中断,必须清除中断标志位。 

就用的中断方式,固件库中can接收中断中并没有清中断啊
 
 
但在main.c中有关中断
 
固件库中程序:

#ifndef STM32F10X_CL
[url=mkMSITStore:G:\Documents%20and%20Settings\chenzongxi\桌面\STM32固件库例程\固件库\STM32F10x_StdPeriph_Lib_V3.5.0\stm32f10x_stdperiph_lib_um.chm::/group__CAN__LoopBack.html#gaf57bde854fa2b396f29664995a502b19]00155[/url] void [url=mkMSITStore:G:\Documents%20and%20Settings\chenzongxi\桌面\STM32固件库例程\固件库\STM32F10x_StdPeriph_Lib_V3.5.0\stm32f10x_stdperiph_lib_um.chm::/group__CAN__LoopBack.html#gaf57bde854fa2b396f29664995a502b19]USB_LP_CAN1_RX0_IRQHandler[/url](void)
00156 #else
00157 void [url=mkMSITStore:G:\Documents%20and%20Settings\chenzongxi\桌面\STM32固件库例程\固件库\STM32F10x_StdPeriph_Lib_V3.5.0\stm32f10x_stdperiph_lib_um.chm::/group__CAN__DualCAN.html#ga4dcf621094d563287c456f7aa751e86b]CAN1_RX0_IRQHandler[/url](void)
00158 #endif
00159 {
00160   [url=mkMSITStore:G:\Documents%20and%20Settings\chenzongxi\桌面\STM32固件库例程\固件库\STM32F10x_StdPeriph_Lib_V3.5.0\stm32f10x_stdperiph_lib_um.chm::/structCanRxMsg.html]CanRxMsg[/url] [url=mkMSITStore:G:\Documents%20and%20Settings\chenzongxi\桌面\STM32固件库例程\固件库\STM32F10x_StdPeriph_Lib_V3.5.0\stm32f10x_stdperiph_lib_um.chm::/group__CAN__DualCAN.html#ga1570d2d5a1aef132c12627cc2789f6aa]RxMessage[/url];
00161
00162   RxMessage.[url=mkMSITStore:G:\Documents%20and%20Settings\chenzongxi\桌面\STM32固件库例程\固件库\STM32F10x_StdPeriph_Lib_V3.5.0\stm32f10x_stdperiph_lib_um.chm::/structCanRxMsg.html#a62769e18836146f71238bee6b43b531e]StdId[/url]=0x00;
00163   RxMessage.[url=mkMSITStore:G:\Documents%20and%20Settings\chenzongxi\桌面\STM32固件库例程\固件库\STM32F10x_StdPeriph_Lib_V3.5.0\stm32f10x_stdperiph_lib_um.chm::/structCanRxMsg.html#a1fdca10d31c81eea2ccef41d2aced562]ExtId[/url]=0x00;
00164   RxMessage.[url=mkMSITStore:G:\Documents%20and%20Settings\chenzongxi\桌面\STM32固件库例程\固件库\STM32F10x_StdPeriph_Lib_V3.5.0\stm32f10x_stdperiph_lib_um.chm::/structCanRxMsg.html#a83a67d1a709cc01570ce956e5adc811f]IDE[/url]=0;
00165   RxMessage.[url=mkMSITStore:G:\Documents%20and%20Settings\chenzongxi\桌面\STM32固件库例程\固件库\STM32F10x_StdPeriph_Lib_V3.5.0\stm32f10x_stdperiph_lib_um.chm::/structCanRxMsg.html#abf77d3abf9ad290c08cdfd5d99ebc745]DLC[/url]=0;
00166   RxMessage.[url=mkMSITStore:G:\Documents%20and%20Settings\chenzongxi\桌面\STM32固件库例程\固件库\STM32F10x_StdPeriph_Lib_V3.5.0\stm32f10x_stdperiph_lib_um.chm::/structCanRxMsg.html#a5afe39d8e295659eeb3030593828b96a]FMI[/url]=0;
00167   RxMessage.Data[0]=0x00;
00168   RxMessage.Data[1]=0x00;
00169
00170   CAN_Receive(CAN1, CAN_FIFO0, &RxMessage);
00171
00172   if((RxMessage.ExtId==0x1234) && (RxMessage.IDE==CAN_ID_EXT)
00173      && (RxMessage.DLC==2) && ((RxMessage.Data[1]|RxMessage.Data[0]
回复 支持 反对

使用道具 举报

3

主题

185

回帖

0

蝴蝶豆

新手上路

最后登录
1970-1-1
发表于 2011-11-27 10:36:26 | 显示全部楼层

RE:stm32的can接收中断中怎么不用清中断

中断标志位,我记得是有两种类型的,在STM32的英文文档中有过描述,但是不记得是哪个文档
1、手动清除中断标志位,需要软件清除的
2、自动清除中断标志位,硬件自动清除的。
回复 支持 反对

使用道具 举报

关于意法半导体
我们是谁
投资者关系
意法半导体可持续发展举措
创新与技术
招聘信息
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
关注我们
st-img 微信公众号
st-img 手机版