- UID
- 172853
- 性别
- 男
|
#define flag 0
#define received_flag 1
void main(void)
{
........
for(;;)
{
feedCOP();
if (flag & received_flag)
SendChar(0xAA); //串口助手发送0X55,只收到55 收不到AA
delay(10000); //SendChar()函数放在中断里有效,说明函数对的
flag&=~received_flag;
}
}
.........................
interrupt 15 void SCI_RE(void)
{
if (SCIS1_RDRF)
{
rec_buf = SCID;
SCIC2_RE = 1;
if (rec_buf == 0x55 )
{
flag|=received_flag; //标志转换
SCIS1_RDRF=0;
while(!SCIS1_TDRE);
SCID=0x55;
}
}
}
*******************************************************************
找了一上午找不到问题,请教一下,谢谢各位的指教! |
|