#include<reg52.h> #define uchar unsigned char #define uint unsigned int sbit lcden=P2^7; sbit lcdrs=P2^6; sbit lcdrw=P3^6; uchar count,shi,fen ,miao; uchar code table[]=" 2009-5-16"; uchar code table1[]=" 00:00:00"; void delay(uint z) { uint x,y; for(x=z;x>0;x--) for(y=110;y>0;y--); } void write_sfm(uchar add,uchar date) { uchar ge, shi ; shi=date/10; ge=date%10; write_com(0x80+0x40+add); write_data(0x30+shi); write_data(0x30+ge); }
void write_com(uchar com) { lcdrs=0; lcden=0; delay(5); P0=com; delay(5); lcden=1; delay(5); lcden=0; } void write_data(uchar date) { lcdrs=1; lcden=0; delay(5); P0=date; delay(5); lcden=1; delay(5); lcden=0; } void init() { lcdrw=0; write_com(0x38); write_com(0x0c); write_com(0x06); write_com(0x01); write_com (0x80); TMOD=0X01; TH0=(65535-50000)/256; TL0=(65535-50000)%256; EA=1; ET0=1; TR0=1; } main() { uchar num; init(); for(num=0;num<12;num++) { write_data(table[num]); delay(5); } write_com(0x80+0x40); for(num=0;num<11;num++) { write_data(table1[num]); delay(5); } while(1) { if(count==20) { miao++; if(miao==60) { miao==0; fen++; if(fen==60) {fen=0; shi++; if(shi==24) { shi=0; } } } write_sfm(10,miao);
} } } void time0() interrupt 1 { TH0=(65535-50000)/256; TL0=(65535-50000)%256; count++;
}keil调试后,出现 warning C206: 'write_com': missing function-prototype。
write_com(0x80+0x40+add);这句有何错
|