📄 tirfc.lst
字号:
C51 COMPILER V3.20, SN-50203013 TIRFC 09/11/06 13:20:00 PAGE 1
DOS C51 COMPILER V3.20, COMPILATION OF MODULE TIRFC
OBJECT MODULE PLACED IN TIRFC.OBJ
COMPILER INVOKED BY: F:\COMP51\BIN\C51.EXE TIRFC.C DB OE SMALL ROM(LARGE)
stmt level source
1 #pragma RB(0)
2
3 #include <reg52.h>
4 #include <intrins.h>
5 #include <pub.h>
6 #if defined (TIRFCARD)
#define uchar unsigned char
#define uint unsigned int
#define ulong unsigned long
#define nop _nop_()
#pragma ROM(LARGE)
#pragma RB(5,SIZE)
uchar RFCardID[14];
bit check_code()
{
uint crc_byte;
uchar byte1,byte2,k,j;
crc_byte=0;
for (k=0;k<8;k++)
{
for (j=0;j<8;j++)
{
byte1=(uchar)(crc_byte & 0x0001);
crc_byte >>=0x01;
if (byte1==1) crc_byte |=0x8000;
else crc_byte &=0x7fff;
byte2=(RFCardID[k+1]>>j) & 0x0001;
if (byte2==1)
{
crc_byte ^=0x8000;
byte2=(crc_byte>>15) & 0x0001;
if (byte2==1)crc_byte ^=0x0408;
}
else
{
byte2=(crc_byte >>15) & 0x0001;
if (byte2==1)crc_byte ^=0x0408;
}
}
}
if (RFCardID[9]==(uchar)crc_byte &&
RFCardID[10]==(uchar)(crc_byte>>8))
{
if (RFCardID[0]==0x7e)
{
if ((RFCardID[11]==0x7e) && (RFCardID[12]==0x0)
&& (RFCardID[13]==0x0))
{return 0;}
}
else if (RFCardID[0]==0xfe)
C51 COMPILER V3.20, SN-50203013 TIRFC 09/11/06 13:20:00 PAGE 2
{
if ((RFCardID[11]==0xfe) && (RFCardID[12]==RFCardID[1])
&& (RFCardID[13]==RFCardID[2]))
{return 0;}
}
else;
}
return 1;
}
void delayRec(uchar th0,uchar tl0)
{
TL0=tl0;TH0=th0; /*延时2.05ms*/
TR0=0x1;
while(!TF0 ) TR0=1;
TF0=0;TR0=0x0;
}
/* 延时n个uS */
static void delayNus(uint nus)
{
TR0=0;/*先停止计数*/
nus = 0xffff- nus;
TF0=0; TL0=(uchar)nus; TH0=nus/0x100;
TR0=1;
while( !TF0 );
TF0=0;
}
bit rfTI()
{
uchar i,j,k;
uchar byte;
txct=0x1; /*转换为空闲模式,此处大约为2us*/
scio=1; /*作为输入方式*/
delayRec(0xf0,0x00); /* 0XF533=delay3ms */
txct=0x0; /* typ.charge_time = 50ms */
delayRec(0x4c,0x10); /* delay50ms 0x4c,0x10*/
txct=0x01;
TL0=0x00;TH0=0xb8; /*延时20ms*/
TR0=0x1;k=0;
while( (!TF0) && (k!=14) )
{
byte=0;
if (scio==1)
{
for (j=0;j<7;j++){nop;} /*延时84us*/
for (i=0;i<8;i++)
{
if (scio==1){byte >>=1;byte &=0x7f;nop;}
else {byte >>=1;byte |=0x80;nop;nop;nop;}
for (j=0;j<3;j++){nop;nop;nop;} /*延时64us*/
}
RFCardID[k]=byte;k++;
}
}
txct=1;
if (TF0==1) return 1; else; /*时间超时*/
if (check_code()==1) return 1; else; /*CRC校验出错*/
C51 COMPILER V3.20, SN-50203013 TIRFC 09/11/06 13:20:00 PAGE 3
return 0; /*接收码值完成*/
}
void initRfTI()
{
txct=1;
}
#endif
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = ---- ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -