| while(1) {
 LPM3;
 
 motor(recbuf[0],recbuf[1]); //方向, 偏转次数
 }
 
 
 /*****UART0 RX ISR will for exit from LPM3 in Mainloop**/
 #pragma vector=UART0RX_VECTOR
 __interrupt void usart0_rx (void)
 {
 while (!(IFG1 & UTXIFG0));           // USART0 TX buffer ready
 recbuf[J] = RXBUF0;                          // RXBUF0 to recbuf[]
 J++;
 if(J==2)
 {
 J=0;
 LPM3_EXIT;                                //跳出LPM3
 }
 
 有时recbuf[0],recbuf[1]接收不正确,举个例子我发01 02然后再发03 04 大多情况都对的,但是有时发完03 04 我看寄存器发现recbuf[0],recbuf[1]的值为04 03不知是什么原因??
 |