电子一小白 发表于 2024-4-29 16:31

MSP430F149串口1中断接收,程序能进入中断,但使用中断标志位进入不了程序

本帖最后由 电子一小白 于 2024-4-29 16:36 编辑

<p>&nbsp;</p>

<p><span style="font-size:20px;"><strong>//各位大神,求教</strong></span></p>

<p>&nbsp;</p>

<p>#define R1XIFG&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (IFG2&amp;&nbsp; &nbsp;URXIFG1)</p>

<p>#define SET_R1XIFG_1&nbsp; &nbsp; &nbsp; &nbsp; IFG2|=&nbsp;&nbsp;URXIFG1</p>

<p>#define SET_R1XIFG_0&nbsp; &nbsp; &nbsp; &nbsp; IFG2&amp;= ~URXIFG1</p>

<p>&nbsp;</p>

<p>#if __VER__ &lt; 200<br />
interrupt void port1_Rcv_Proc(void)<br />
#else<br />
#pragma vector=UART1RX_VECTOR<br />
__interrupt void port1_Rcv_Proc(void)<br />
#endif<br />
{&nbsp;<br />
&nbsp; if(R1XIFG)&nbsp; &nbsp; &nbsp; &nbsp; //使用断点调试,将断点放在此处程序<span style="font-size:16px;"><strong>会执行</strong></span>到这一步<br />
&nbsp; {<br />
&nbsp; &nbsp; SET_R1XIFG_0; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //使用断点调试,将断点放在此处程序<strong><span style="font-size:16px;">不会进入</span></strong><br />
&nbsp; &nbsp; if(RxIndex&lt;50) RxBuf = U1RXBUF;&nbsp;&nbsp;<br />
&nbsp; }<br />
&nbsp; SET_T1XIFG_0;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
}</p>

电子一小白 发表于 2024-4-29 16:32

电子小白,求教各位大神

wangerxian 发表于 2024-4-29 17:30

<p>RxBuf和RxIndex内容也不会发生变化?</p>
页: [1]
查看完整版本: MSP430F149串口1中断接收,程序能进入中断,但使用中断标志位进入不了程序