📄 tflc.c
字号:
void Serial_Receive_Interrupt(void) interrupt 4
{
unsigned char i;
TR1=0;
ET1=0;
ES=0;
if((RI==1)&&(COMU==0))
{
Check_first=0;
if(Flag_Effective_Data==0)
{
Serial_Communication_Data_Buffer[Communication_Data_Counter]=SBUF;
Communication_Data_Counter++;
if(Communication_Data_Counter>=20) //65
{
Communication_Data_Counter=0;
if( (Serial_Communication_Data_Buffer[0]==0xf0)
&&(Serial_Communication_Data_Buffer[1]==0xf1)
&&(Serial_Communication_Data_Buffer[2]==0xf2)
&&(Serial_Communication_Data_Buffer[3]==0xf3)
&&(Serial_Communication_Data_Buffer[4]==0xf4)
&&(Serial_Communication_Data_Buffer[5]==0xf5)
&&(Serial_Communication_Data_Buffer[6]==0xf6)
&&(Serial_Communication_Data_Buffer[7]==0xf7)
&&(Serial_Communication_Data_Buffer[8]==0xf8)
&&(Serial_Communication_Data_Buffer[9]==0xf9)
&&(Serial_Communication_Data_Buffer[18]==0x02)&&(Serial_Communication_Data_Buffer[13]==0x06)
)
{
Flag_Effective_Data=1;
// Flag_Serial_Communication_Over=0;
Communication_Data_Counter=0;
// Display_Busy2();
flag_first=1;
SUM_COMU=0;
for(i=10;i<20;i++)
{
SUM_COMU=SUM_COMU+Serial_Communication_Data_Buffer[i];
}
}
else
{
Flag_Effective_Data=0;
// Flag_Serial_Communication_Over=0;
Communication_Data_Counter=0;
// Display_Busy2();
flag_first=1;
}
}
}
else
{
Serial_Communication_Data_Buffer[Communication_Data_Counter]=SBUF;
SUM_COMU=SUM_COMU+Serial_Communication_Data_Buffer[Communication_Data_Counter];
Communication_Data_Counter++;
// Display_Busy3();
if((Communication_Data_Counter==65)&&(flag_first==1))
{
which_one=Serial_Communication_Data_Buffer[0];
flag_first=0;
if((which_one%2)==1)
{
IIC_Data_Addr_L=0x00;
IIC_Data_Addr_H=which_one/2;
}
else
{
IIC_Data_Addr_L=0x80;
IIC_Data_Addr_H=which_one/2-1;
}
Data_Length=64;
Display_Busy(TABLE_LED_Display1[2*which_one-1]);
Write_FloorDefine();
// display_ok();
Flag_Effective_Data=1;
Communication_Data_Counter=1;
}
else if((Communication_Data_Counter==66)&&(flag_first==0))
{
flag_first=1;
if((which_one%2)==1)
{
IIC_Data_Addr_L=0x40;
IIC_Data_Addr_H=which_one/2;
}
else
{
IIC_Data_Addr_L=0xc0;
IIC_Data_Addr_H=which_one/2-1;
}
Data_Length=64;
Display_Busy(TABLE_LED_Display1[(2*which_one)]);
Write_FloorDefine();
// display_ok();
Flag_Effective_Data=0;
Communication_Data_Counter=0;
if(Serial_Communication_Data_Buffer[65]!=(SUM_COMU-Serial_Communication_Data_Buffer[65]))
{
Display_Busy(0X6D);
goto loop;
}
}
}
RI=0;
}
ES=1;
loop:;
}
//----------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -