利用中断进行的通讯:
void UART_Server(void) interrupt 4
{
if(TI == 0)
{
//deal with send function
}
if(RI == 0)
{
//deal with receive function
}
}
void T0_Server(void) interrupt 1
{
//deal with your step motor
}
void T0_Server(void) interrupt 1
{
//deal with your step motor
//adjust your T0 interrupt speed due to you step motor speed
}
void UART_Server(void) interrupt 4
{
if(TI == 1)
{
//deal with send function
}
if(RI == 1)
{
//deal with receive function
}
}
uchar crc = 0;//必须赋初值为0
for(i = 0; i < 512; i++)
{
GetCRC(g_TempState[i],&crc);
}//可以连续计算
crc =~crc;//结果要取反。
最后要说的是我用的是8210校验。
点击此处查看原文 >>
系统分类:
单片机 | 用户分类:
无分类
| 来源:
无分类