cpubbs论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

LabVIEW+单片机学习套件全套教程资料下载[免费]LabVIEW论坛精华列表贴USB0816数据采集卡《LabVIEW宝典》
LabWindows/CVI论坛精华贴NET0816以太网数据采集卡RC0210远程设备授权系统 关闭关停锁定打开设备 户外分布式数据采集
NET1624低速高精度以太网数据采集卡WIFI0824SD无线WIFI网络数据采集卡脱机运行 SD存储 小尺寸微型 串口采集远程采集 安卓 手持移动采集 纪录仪
查看: 1554|回复: 1

C51程序库

[复制链接]
发表于 2004-11-6 03:10:13 | 显示全部楼层 |阅读模式
xuexi.c
//#include "reg51.h"
//#include "stdio.h"
//#include "math.h"
//#include "intrins.h"
//#include "absacc.h"
/*===========================================*/
/*A/D*/
#define ADCOM XBYTE[0x0800]
#define ADHI XBYTE[0x0802]
#define ADLO XBYTE[0x0803]
#define uint unsigned int
sbit adbusy = P1^7;
unsigned int xdata AD_report[2];
#define AD_switch XBYTE[0x1800]
#define K_OUT XBYTE[0x2000]
/*===================================*/
/*8250 regist*/
#define INS8250_DATA XBYTE[0x5800]
#define INS8250_BAUDL XBYTE[0x5800]
#define INS8250_IER XBYTE[0x5801]
#define INS8250_BAUDH XBYTE[0x5801]
#define INS8250_IIR XBYTE[0x5802]
#define INS8250_LCR XBYTE[0x5803]
#define INS8250_MCR XBYTE[0x5804]
#define INS8250_LSR XBYTE[0x5805]
#define INS8250_MSR XBYTE[0x5806]
/*===================================*/
/*============================================*/
#define DS128870 XBYTE[0x1000]
#define DS128871 XBYTE[0x1001]
#define DS128872 XBYTE[0x1002]
#define DS128873 XBYTE[0x1003]
#define DS128874 XBYTE[0x1004]
#define DS128875 XBYTE[0x1005]
#define DS128876 XBYTE[0x1006]
#define DS128877 XBYTE[0x1007]
#define DS128878 XBYTE[0x1008]
#define DS128879 XBYTE[0x1009]
#define DS12887a XBYTE[0x100a]
#define DS12887b XBYTE[0x100b]
#define DS12887c XBYTE[0x100c]
#define DS12887d XBYTE[0x100d]
#define DS12887e XBYTE[0x100e]
#define DS12887f XBYTE[0x100f]
unsigned char xdata sample_time[6];
unsigned char xdata current_time[6];
unsigned char xdata send_report[19];
unsigned char xdata sample_data[24576];
unsigned char xdata time_table[144];
unsigned char xdata verify_time[6];
/*============================================*/
#define telephone4 XBYTE[0x2800]/*4800*/
#define telephone3 XBYTE[0x3000]/*4000*/
#define telephone2 XBYTE[0x3800]/*3800*/
#define telephone1 XBYTE[0x4000]/*3000*/
#define station_name XBYTE[0x4800]/*2800*/
#define KR_input XBYTE[0x5000]
unsigned char xdata telephone[4];
#define K_out XBYTE[0x2000]
/*=====================================*/
#define CS_5731 XBYTE[0x1800]
/*=====================================*/
/* write ds1820 command extern function declare */
WDS1820_0(unsigned char x);
WDS1820_1(unsigned char x,unsigned char y,unsigned char z);
/* read ds1820 command extern function declare */
RDS1820_0();
RDS1820_1();
RDS1820_2();
RDS1820_3();
RDS1820_4();
RDS1820_5();
/* reset ds1820 command extern function declare */
第 1 页
xuexi.c
/*=============*/
RTDS1820_0();
RTDS1820_1();
RTDS1820_2();
RTDS1820_3();
RTDS1820_4();
RTDS1820_5();
/*=============*/
/* delay 15us extern function declare */
Delay15(unsigned char x);
WDS1820_CODE();
RDS1820_code();
DS12887_ini();
INS8250_ini();
AD1674(void);
void serial(void);
send_byte(unsigned char ucI);
void read12887(unsigned char *p);
rst_watchdog();
timer_ini();
com_ini();
ini();
smec(unsigned int x);
sbit P10=P1^0;
sbit P11=P1^1;
sbit P14=P1^4;
sbit P15=P1^5;
sbit P16=P1^6;
sbit rst=P3^2;
sbit RUN=P3^4;
sbit P35=P3^5;
/*sbit temp0=temp^0;
sbit temp1=temp^1;
sbit temp2=temp^2;
sbit temp3=temp^3;
sbit temp4=temp^4;
sbit temp5=temp^5;
sbit temp6=temp^6;
sbit temp7=temp^7;
sbit temp8=temp^8;
sbit temp9=temp^9;
sbit temp10=temp^10;*/
unsigned char *pt,*t,*sam_pt;
unsigned int R_code;
/*unsigned char tempf;*/
unsigned char family_code[8];
unsigned char xdata time[6];
/*================================================================================*/
/*DS1820的编码号,第一位为28H*/
unsigned char code DS18201_code[9]={0x28,0x48,0xF2,0x0C,0x00,0x00,0x00,0xFD,0xFF};
unsigned char code DS18202_code[9]={0x28,0x4D,0xE2,0x0D,0x00,0x00,0x00,0xE5,0xFF};
unsigned char code DS18203_code[9]={0x28,0x83,0xC5,0x0C,0x00,0x00,0x00,0x4F,0xFF};
unsigned char code DS18204_code[9]={0x28,0x6E,0xDB,0x0D,0x00,0x00,0x00,0x7D,0xFF};
unsigned char code DS18205_code[9]={0x28,0xDC,0xCE,0x0C,0x00,0x00,0x00,0x35,0xFF};
unsigned char code DS18206_code[9]={0x28,0xFB,0x0F,0x0D,0x00,0x00,0x00,0x66,0xFF};
/*================================================================================*/
unsigned int xdata tempf_data[6];
unsigned char xdata tempf[6];
unsigned char xdata telephone_code[12];
/*================================================================================*/
unsigned char XOR_BYTE,right_flog,call_ring,verify_flog,sam_first;
unsigned int count;
void main(void)
{
unsigned int j,i;
unsigned char a,m;
rst_watchdog();
adbusy=1;
sample_flog = 1;
ini();
/*===============================================*/
while(1)
{
read12887(&current_time);
for(i=0;i<6;i++)
第 2 页
xuexi.c
{
if(current_time<i>=sample_time<i>)
{
m++;
if(m == 6)
{
call_ring = 1;
m=0;
}
}
else
{
i = 6;
}
}
if(verify_flog == 1)
{
rst_watchdog();
m = DS12887d;
DS12887a=0x20; DS12887b=0x82;
DS128870=0x00; DS128871=0xff;
DS128872=0x00; DS128873=0xff;
DS128874=0x00; DS128875=0xff;
DS128876=0x03; DS128877=0x1c;
DS128878=0x07; DS128879=0x01;
DS12887b=0x02; DS12887a=0x20;
m = DS12887c;
m = 0;
verify_flog = 0;
}
if(call_ring==1)
{
sam_first = 0;
telephone_code[0] = 0x41;
telephone_code[1] = 0x54;
telephone_code[2] = 0x44;
telephone_code[3] = 0x54;
telephone_code[4] = telephone4&amp;0x0F+0x30;
telephone_code[5] = telephone3&amp;0xF0+0x30;
telephone_code[6] = telephone3&amp;0x0F+0x30;
telephone_code[7] = telephone2&amp;0xF0+0x30;
telephone_code[8] = telephone2&amp;0x0F+0x30;
telephone_code[9] = telephone1&amp;0xF0+0x30;
telephone_code[10]= telephone1&amp;0x0F+0x30;
telephone_code[11]= 0x0D;
A8250_MCR=A8250_MCR|0x03;
pt=&amp;telephone_code;
for(i=0;i&lt;12;i++)
{
send_byte(*pt++);
}
i=0;
}
}
}
/*=======================================*/
while(1)
{
AD_switch=0x20;
adbusy=1;
rst_watchdog();
read12887(&amp;time);
telephone[0]=telephone4;
telephone[1]=telephone3;
telephone[2]=telephone2;
telephone[3]=telephone1;
AD_report[1]=AD1674();
K_OUT=0x00;
/*send_byte(0x41);
send_byte(0x54);
send_byte(0x5A);*/
AD_switch=AD_switch|0x02;
while(P10!=0)
{
第 3 页
xuexi.c
rst_watchdog();
}
send_byte(0x41);
send_byte(0x54);
send_byte(0x5A);
AD_switch=AD_switch|0x01;
while(P11==0)
{
rst_watchdog();
}
t=&amp;phone;
while(*t!=0xff)
{
send_byte(*t++);
}
i=station_name;
i=0;
}
}
/*=====================================================*/
ini()
{
timer_ini();
DS12887_ini();
INS8250_ini();
}
timer_ini()
{
TR0 = 0;
ET0 = 0;*/
/*TMOD=0X01;*/
/*TH0 = 0x3C; */
/*TL0 = 0xB0;
TR0 = 1;
ET0 = 1;
EA=0;*/
}
com_ini()
{
PCON &amp;= 0x7F;
SCON = 0xd0;
TMOD = 0x21;
TH1 = 0xFD;
TR1 = 1;
ET1 = 0;
TI = 0;
RI = 0;
ES = 1;
EA = 1;
EX1 = 1;
IT1 = 1;
}
DS12887_ini()
{
unsigned char i;
rst_watchdog();
i=DS12887d;
DS12887a=0x20; DS12887b=0x82;
DS128870=0x00; DS128871=0xff;
DS128872=0x00; DS128873=0xff;
DS128874=0x00; DS128875=0xff;
DS128876=0x03; DS128877=0x1c;
DS128878=0x07; DS128879=0x01;
DS12887b=0x02; DS12887a=0x20;
i=DS12887c;
}
INS8250_ini()
{
A8250_LCR=0x80;
A8250_BAUDL=0x60;
第 4 页
xuexi.c
A8250_BAUDH=0x00;
A8250_LCR=0x03;
A8250_IER=0x0F;
A8250_MCR=0x0F;
A8250_IER=0x01;
IT1=1;
EX1=1;
EA=1;
}
/*=======================================================*/
RTDS1820_0()
{
unsigned char x,i,j,exist;
rst_watchdog();
P15=0;
Delay15(468);
P15=1;
Delay15(500);
for(i=0;i&lt;8;i++)
{
if(P14==1)
{
i=8;
exist=1;
}
}
if(exist==0)
{
return(0);
}
for(i=0;i&lt;80;i++)
{
if(P14==0)
{
return(1);
}
}
}
/*=====================================================*/
RTDS1820_1()
{
unsigned char a,i,j,exist;
rst_watchdog();
CS_5731=CS_5731&amp;0xFB;
Delay15(468);
CS_5731=CS_5731|0x04;
Delay15(500);
for(i=0;i&lt;8;i++)
{
if(P16==1)
{
i=8;
exist=1;
}
}
if(exist==0)
{
return(0);
}
for(i=0;i&lt;80;i++)
{
if(P16==0)
{
return(1);
}
}
}
/*=====================================================*/
RTDS1820_2()
{
unsigned char a,i,j,exist;
rst_watchdog();
CS_5731=CS_5731&amp;0xF7;
Delay15(468);
第 5 页
xuexi.c
CS_5731=CS_5731|0x08;
Delay15(500);
for(i=0;i&lt;8;i++)
{
if((KR_input&amp;0x10)==0x10)
{
i=8;
exist=1;
}
}
if(exist==0)
{
return(0);
}
for(i=0;i&lt;40;i++)
{
if((KR_input&amp;0x10)==0)
{
return(1);
}
}
i=0;
}
/*=====================================================*/
RTDS1820_3()
{
unsigned char a,i,j,exist;
rst_watchdog();
CS_5731=CS_5731&amp;0xEF;
Delay15(468);
CS_5731=CS_5731|0x10;
Delay15(500);
for(i=0;i&lt;8;i++)
{
if((KR_input&amp;0x20)==0x20)
{
i=8;
exist=1;
}
}
if(exist==0)
{
return(0);
}
for(i=0;i&lt;80;i++)
{
if((KR_input&amp;0x20)==0)
{
return(1);
}
}
}
/*=====================================================*/
RTDS1820_4()
{
unsigned char a,i,j,exist;
rst_watchdog();
CS_5731=CS_5731&amp;0xDF;
Delay15(468);
CS_5731=CS_5731|0x20;
Delay15(500);
for(i=0;i&lt;8;i++)
{
if((KR_input&amp;0x40)==0x40)
{
i=8;
exist=1;
}
}
if(exist==0)
{
return(0);
}
for(i=0;i&lt;80;i++)
{
第 6 页
xuexi.c
if((KR_input&amp;0x40)==0)
{
return(1);
}
}
}
/*=====================================================*/
 楼主| 发表于 2004-11-6 03:10:37 | 显示全部楼层
RTDS1820_5()
{
unsigned char a,i,j,exist;
rst_watchdog();
CS_5731=CS_5731&amp;0xBF;
Delay15(468);
CS_5731=CS_5731|0x40;
Delay15(500);
for(i=0;i&lt;8;i++)
{
if((KR_input&amp;0x80)==0x80)
{
i=8;
exist=1;
}
}
if(exist==0)
{
return(0);
}
for(i=0;i&lt;80;i++)
{
if((KR_input&amp;0x80)==0)
{
return(1);
}
}
}
/*=====================================================*/
timer0() interrupt 2 using 1
{
unsigned char n;
n++;
if(n==5)
{
RUN=!RUN;
n=0;
}
TH0=0X3C;
TL0=0XB0;
}
extern0() interrupt 3 using 1
{
unsigned char buffer,report_type;
unsigned int report_long;
rst_watchdog();
if((INS8250_IIR&amp;0x01)!=0)
{
switch(count)
{
buffer = INS8250_DATA;
XOR_BYTE ^= buffer;
count++;
case 1:
if(buffer != 0xFD)
{
count = 0;
XOR_BYTE = 0;
}
break;
case 2:
report_long = buffer;
break;
case 3:
report_long = (report_long&lt;&lt;8) | buffer;
break;
case 4:
第 7 页
xuexi.c
if(buffer != 0x03)
{
count = 0;
XOR_BYTE = 0;
}
case 5:
verify_time[0] = buffer;
break;
case 6:
verify_time[1] = buffer;
break;
case 7:
verify_time[2] = buffer;
break;
case 8:
verify_time[3] = buffer;
break;
case 9:
verify_time[4] = buffer;
break;
case 10:
verify_time[5] = buffer;
break;
case 11:
verify_time[6] = buffer;
break;
case 12:
if(buffer!=0x01)
{
count = 0;
report_long = 0;
XOR_BYTE = 0;
}
else
{
pt = &amp;time_table;
}
break;
default:
if(count&lt;report_long)
{
*pt++ = buffer;
}
if((count == report_long)&amp;&amp;(XOR_BYTE == 0))
{
count = 0;
report_long = 0;
XOR_BYTE = 0;
verify_flog = 1;
}
break;
}
}
}
extern1() interrupt 2 using 1
{
rst_watchdog();
sam_first++;
if(P35==0)
{
if(sam_first==1)
{
sam_pt = &amp;sample_data;
*sam_pt++ = 0xFD;
*sam_pt++ = 0x00;
*sam_pt++ = 0x00
*sam_pt++ = 0x01;
read12887(&amp;current_time);
for(i=0;i&lt;6,i++)
{
*sam_pt++ = current_time<i>;
}
*sam_pt++ = 0x01;
}
第 8 页
xuexi.c
for(i=0;i&lt;5;i++)
{
switch(i)
{
rst_watchdog();
case 0:
if(RTDS1820_0()==1)
{
Delay15(0x00);
Delay15(0x00);
Delay15(0x00);
Delay15(0x00);
Delay15(0x00);
WDS1820_0(0xcc);
WDS1820_0(0x44);
}
if(RTDS1820_0()==1)
{
Delay15(0x00);
WDS1820_0(0x55);
pt=&amp;DS18201_code;
while(*pt!=0xFF)
{
WDS1820_0(*pt++);
}
WDS1820_0(0xBE);
*sam_pt=RDS1820_0();
}
break;
case 1:
if(RTDS1820_1()==1)
{
Delay15(0x00);
Delay15(0x00);
Delay15(0x00);
Delay15(0x00);
Delay15(0x00);
WDS1820_1(0xcc,0xFB,0x04);
WDS1820_1(0x44,0xFB,0x04);
}
if(RTDS1820_1()==1)
{
Delay15(0x00);
WDS1820_1(0x55,0xFB,0x04);
pt=&amp;DS18202_code;
while(*pt!=0xFF)
{
WDS1820_1(*pt++,0xFB,0x04);
}
WDS1820_1(0xBE,0xFB,0x04);
*sam_pt++=RDS1820_1();
}
break;
case 2:
if(RTDS1820_2()==1)
{
Delay15(0x00);
Delay15(0x00);
Delay15(0x00);
Delay15(0x00);
Delay15(0x00);
WDS1820_1(0xcc,0xF7,0x08);
WDS1820_1(0x44,0xF7,0x08);
}
if(RTDS1820_2()==1)
{
Delay15(0x00);
WDS1820_1(0x55,0xF7,0x08);
pt=&amp;DS18203_code;
while(*pt!=0xFF)
{
WDS1820_1(*pt++,0xF7,0x08);
}
WDS1820_1(0xBE,0xF7,0x08);
*sam_pt++=RDS1820_2();
第 9 页
xuexi.c
}
break;
case 3:
if(RTDS1820_3()==1)
{
Delay15(0x00);
Delay15(0x00);
Delay15(0x00);
Delay15(0x00);
Delay15(0x00);
WDS1820_1(0xcc,0xEF,0x10);
WDS1820_1(0x44,0xEF,0x10);
}
if(RTDS1820_3()==1)
{
Delay15(0x00);
WDS1820_1(0x55,0xEF,0x10);
pt=&amp;DS18204_code;
while(*pt!=0xFF)
{
WDS1820_1(*pt++,0xEF,0x10);
}
WDS1820_1(0xBE,0xEF,0x10);
*sam_pt++=RDS1820_3();
}
break;
case 4:
if(RTDS1820_4()==1)
{
Delay15(0x00);
Delay15(0x00);
Delay15(0x00);
Delay15(0x00);
Delay15(0x00);
WDS1820_1(0xcc,0xDF,0x20);
WDS1820_1(0x44,0xDF,0x20);
}
if(RTDS1820_4()==1)
{
Delay15(0x00);
WDS1820_1(0x55,0xDF,0x20);
pt=&amp;DS18205_code;
while(*pt!=0xFF)
{
WDS1820_1(*pt++,0xDF,0x20);
}
WDS1820_1(0xBE,0xDF,0x20);
*sam_pt++=RDS1820_4();
}
break;
default:
break;
}
}
AD_switch = 0x20;
*sam_pt++ = AD1674();
AD_switch = AD_switch|0x20;
*sam_pt++ = AD1674();
}
else
{
call_ring = 1;
}
}
RDS1820_0()
{
unsigned char x,i,R_count,empty_operation;
unsigned int read_bit,exist;
rst_watchdog();
R_count=16;
while(R_count!=0)
{
P15=0;
P15=1;
第 10 页
xuexi.c
Delay15(500);
read_bit=P1;
Delay15(496);
P15=1;
read_bit=read_bit&amp;0x0010;
read_bit=read_bit&lt;&lt;11;
R_code=R_code|read_bit;
if(R_count!=1)
{
R_code=R_code&gt;&gt;1;
}
R_count--;
}
return(R_code);
}
/*======================================================*/
RDS1820_1()
{
unsigned char x,i,R_count;
unsigned int read_bit,exist;
rst_watchdog();
R_count=16;
while(R_count!=0)
{
CS_5731=CS_5731&amp;0xFB;
CS_5731=CS_5731|0x04;
Delay15(500);
read_bit=P1;
Delay15(496);
CS_5731=CS_5731|0x04;
read_bit=read_bit&amp;0x0040;
read_bit=read_bit&lt;&lt;9;
R_code=R_code|read_bit;
if(R_count!=1)
{
R_code=R_code&gt;&gt;1;
}
R_count--;
}
return(R_code);
}
/*======================================================*/
RDS1820_2()
{
unsigned char x,i,R_count;
unsigned int read_bit,exist;
rst_watchdog();
R_count=16;
while(R_count!=0)
{
CS_5731=CS_5731&amp;0xF7;
CS_5731=CS_5731|0x08;
Delay15(500);
read_bit=KR_input;
Delay15(496);
CS_5731=CS_5731|0x08;
read_bit=read_bit&amp;0x0010;
read_bit=read_bit&lt;&lt;11;
R_code=R_code|read_bit;
if(R_count!=1)
{
R_code=R_code&gt;&gt;1;
}
R_count--;
}
return(R_code);
}
/*======================================================*/
RDS1820_3()
{
unsigned char x,i,R_count;
unsigned int read_bit,exist;
rst_watchdog();
R_count=16;
while(R_count!=0)
第 11 页
xuexi.c
{
CS_5731=CS_5731&amp;0xEF;
CS_5731=CS_5731|0x10;
Delay15(500);
read_bit=KR_input;
Delay15(496);
CS_5731=CS_5731|0x10;
read_bit=read_bit&amp;0x0020;
read_bit=read_bit&lt;&lt;10;
R_code=R_code|read_bit;
if(R_count!=1)
{
R_code=R_code&gt;&gt;1;
}
R_count--;
}
return(R_code);
}
/*======================================================*/
RDS1820_4()
{
unsigned char x,i,R_count;
unsigned int read_bit,exist;
rst_watchdog();
R_count=16;
while(R_count!=0)
{
CS_5731=CS_5731&amp;0xDF;
CS_5731=CS_5731|0x20;
Delay15(500);
read_bit=KR_input;
Delay15(496);
CS_5731=CS_5731|0x20;
read_bit=read_bit&amp;0x0040;
read_bit=read_bit&lt;&lt;9;
R_code=R_code|read_bit;
if(R_count!=1)
{
R_code=R_code&gt;&gt;1;
}
R_count--;
}
return(R_code);
}
/*======================================================*/
RDS1820_5()
{
unsigned char x,i,R_count;
unsigned int read_bit,exist;
rst_watchdog();
R_count=16;
while(R_count!=0)
{
CS_5731=CS_5731&amp;0xBF;
CS_5731=CS_5731|0x40;
Delay15(500);
read_bit=KR_input;
Delay15(496);
CS_5731=CS_5731|0x40;
read_bit=read_bit&amp;0x0080;
read_bit=read_bit&lt;&lt;8;
R_code=R_code|read_bit;
if(R_count!=1)
{
R_code=R_code&gt;&gt;1;
}
R_count--;
}
return(R_code);
}
WDS1820_0(unsigned char x)
{
unsigned char write_bit,W_count,empty_operation;
rst_watchdog();
第 12 页
xuexi.c
W_count=8;
while(W_count!=0)
{
if((x&amp;0x01)==1)
{
write_bit=1;
}
else
{
write_bit=0;
}
P15 = 0;
P15 = write_bit;
Delay15(497);
P15 = 1;
x = x&gt;&gt;1;
W_count--;
}
}
/*=====================================================*/
WDS1820_1(unsigned char x,unsigned char y,unsigned char z)
{
unsigned char write_bit,W_count;
rst_watchdog();
W_count=8;
while(W_count!=0)
{
if((x&amp;0x01)==1)
{
CS_5731=CS_5731&amp;y;
CS_5731=CS_5731|z;
}
else
{
CS_5731=CS_5731&amp;y;
CS_5731=CS_5731&amp;y;
}
Delay15(497);
CS_5731=CS_5731|z;
x = x&gt;&gt;1;
W_count--;
}
}
/*=====================================================*/
void read12887(unsigned char *p)
{
unsigned char a;
DS12887b=0x82;
do{
rst_watchdog();
a=DS12887a;
}
while((a&amp;0x80)==0x80);
*p++=DS128870; *p++=DS128872;
*p++=DS128874; *p++=DS128877;
*p++=DS128878; *p++=DS128879;
DS12887b=0x02;
}
AD1674(void)
{
unsigned int er,fr;
ADCOM = 0;
while(adbusy == 1){;}
return ((uint)(ADHI &lt;&lt; 4)+((ADLO &gt;&gt; 4) &amp; 0x0F));
}
send_byte(unsigned char ucI)
{
SBUF = ucI;
do
{
rst_watchdog();
} while(TI == 0);
TI = 0;
第 13 页
xuexi.c
}
confirm_report()
{
rst_watchdog();
report[0] = 0xFD;
XOR_BYTE = 0xFD;
report[1] = 0x00;
XOR_BYTE = 0x00;
report[2] = 0x0B;
XOR_BYTE = 0x0B;
report[3] = 0x02;
XOR_BYTE = 0x02;
}
Delay15(unsigned int x)
{
unsigned int j,i;
rst=!rst;
i=0;
for(;x&lt;500;x++)
{j=0;}
}
smec(unsigned int x)
{
unsigned int j;
while(x--)
{
for(j=0;j&lt;500;j++){;}
}
}
rst_watchdog()
{
rst = !rst;
}
第 14 页
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|cpubbs论坛. ( 粤ICP备09171248号 )

GMT+8, 2025-4-4 20:03 , Processed in 1.957027 second(s), 7 queries , Gzip On, File On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表