warning是这个
*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
SEGMENT: ?PR?_DISPLAY?3_5_1
Program Size: data=19.0 xdata=0 code=406
#include<reg52.h>
#define uint unsigned int
//声明U1锁存器,U2锁存器
sbit dula=P2^6;
sbit wela=P2^7;
sbit led=P1;
//定义显示数字编码
uint code table[]={
0x3f,0x06,0x5b,0x4f,
0x66,0x6d,0x7d,0x07,
0x7f,0x6f,0x77,0x7c,
0x39,0x51,0x79,0x71};
//定义变量
int num0,num1,num,shi,ge;
//定义定时器T0
void T0_
time() interrupt 1
{
TH0=(65536-45872)/256;
TL0=(65536-45872)%256;
num0++;
}
//定义定时器T1
void T1_time() interrupt 3
{
TH0=(65536-45872)/256;
TL0=(65536-45872)%256;
num1++;
}
//定义显示函数
void display(uint shi,uint ge)
{
dula=1;
P0=table[shi];
dula=0;
//消影
P0=0xff;
wela=1;
P0=0xfe;
wela=0;
dula=1;
P0=table[ge];
dula=0xfd;
//消影
P0=0xff;
wela=1;
P0=0xfd;
wela=0;
}
//主函数
void main()
{
TMOD=0x01;
TH0=(65536-45872)/256;
TL0=(65536-45872)%256;
TH1=(65536-45872)/256;
TL1=(65536-45872)%256;
EA=1;
ET0=1;
ET1=1;
TR0=1;
TR1=1;
while(1)
{
if(num0==4)
num0=0;
led=~led;
if(num1==20)
num1=0;
num++;
if(num==60)
num=0;
else
shi=num/10;
ge=num%10;
}
while(1)
{
display(shi,ge);
}
}
一周热门 更多>