- Category:
- Jsp/Servlet
- Tags:
-
- File Size:
- 10kb
- Update:
- 2014-05-27
- Downloads:
- 0 Times
- Uploaded by:
- 周平
Description: #pragma interrupt_handler uart1_rx_isr:31
void uart1_rx_isr(void)
{
unsigned char temp1
if(rx_num==0)
{
temp1=UDR1
if(temp1==0xbb)
{
rx_num++
rx_check=0
test=UDR1
}
}
else if(rx_num==1)
{
temp1=UDR1
rx_highbyte=temp1 //高字节
rx_check+=temp1 //校验和
rx_num++ //计数
}
else if(rx_num==2)
{
temp1=UDR1
rx_lowbyte=temp1 //低字节
rx_check+=temp1 //校验和
rx_num++ //计数
}
else if(rx_num==3)
{
temp1=UDR1
rx_address=temp1 //地址
rx_check+=temp1 //校验和
rx_num++ //计数
}
else
{
temp1=UDR1
rx_num=0
if(temp1==rx_check)
{
if(rx_address==0xb1)//送丝速度
{
rx_i=((unsigned int)(rx_highbyte))<<8
rx_i+=rx_lowbyte
zhengchang_ss=rx_i //
To Search:
File list (Check if you may need any files):
样品.docx