程序就是这样,写的程序会出来一个警告,下载进开发板后数字不会动,看了好多遍没看出警告到底出在哪,求大神指导, 谢谢!!
/****************************************这是编译后的警告*************************/
Build target 'Target 1'
compiling x.c...
linking...
*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
SEGMENT: ?PR?_WRITE_TIME?X
Program Size: data=14.0 xdata=0 code=231
creating hex file from "x"...
"x" - 0 Error(s), 1 Warning(s).
/*******************************************************************************/
/*************************这是程序***********************************************/
#include<reg52.h>
#define uint unsigned int
#define uchar unsigned char
sbit RW=P2^5;
sbit RS=P2^6;
sbit LCDE=P2^7;
uchar code table[]="00:00:00";
uchar num,tt0,shi,fen,miao;
void init();
void write_time(uchar add,uchar shuju);
void write_data(date);
void write_com(com);
void delay(uint z);
void main()
{
init();
while(1);
{
if(tt0==20)
{
tt0=0;
miao++;
if(miao==60)
{
miao=0;
fen++;
if(fen==60)
{
fen=0;
shi++;
if(shi==24)
{
shi=0;
}
write_time(0,shi);
}
write_time(3,fen);
}
write_time(6,miao);
}
}
}
void delay(uint z)
{
uint x,y;
for(x=z;x>0;x--)
for(y=110;y>0;y--);
}
void write_com(com)
{
RS=0;
RW=0;
P0=com;
delay(5);
LCDE=1;
delay(5);
LCDE=0;
delay(5);
RS=1;
RW=1;
}
void write_data(date)
{
RS=1;
RW=0;
P0=date;
delay(5);
LCDE=1;
delay(5);
LCDE=0;
delay(5);
RS=0;
RW=1;
}
void write_time(uchar add,uchar shuju)
{
uchar shi,ge;
shi=shuju/10;
ge=shuju%10;
write_com(0x80+0x40+add);
write_data(0x30+shi);
write_data(0x30+ge);
}
void init()
{
TMOD=0x01;
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
EA=1;
ET0=1;
TR0=1;
write_com(0x38);
write_com(0x0c);
write_com(0x06);
write_com(0x80+0x40);
for(num=0;num<8;num++)
{
write_data(table[num]);
delay(5);
}
}
void time0() interrupt 1
{
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
tt0++;
}
/********************************************************************************/
|