#include "reg52.h" #include <stdio.h>
unsigned int va,vb,vc,ca,cb,cc,dat0,dat1,dat2,dat3; unsigned long pa,pb,pc,pt,Qa,Qb,Qc,Qt; unsigned char idata buf[50];
main() { unsigned char i,Year,Month,Day,Hour,Minute;
while ( 1 ) { va=vb=vc=ca=cb=cc=999; i=sprintf(buf,"%2x-%2x-%2x,%2x:%2x,",(unsigned int)(Year),(unsigned int)(Month),(unsigned int)(Day),(unsigned int)(Hour),(unsigned int)(Minute)); i+=sprintf(buf+15,"%3u,%3u,%3u,%3u,%3u,%3u,",va,vb,vc,ca,cb,cc);
pa=pb=pc=pt=Qa=Qb=Qc=Qt=999999; // i=sprintf(buf,"%6lu,%6lu,%6lu,",(pa&0x000fffff),(pb&0x000fffff),(pc&0x000fffff)); i=sprintf(buf,"%6lu,%6lu,%6lu,",999999,999999,999999); i+=sprintf(buf+21,"%6lu,%6lu,%6lu,",(pt&0x000fffff),(Qa&0x000fffff),(Qb&0x000fffff));
dat0=2000; dat1=2000; dat2=2000; dat3=2000; i=sprintf(buf,"%6lu,%6lu,",(Qc&0x000fffff),(Qt&0x000fffff)); i+=sprintf(buf+14,"%4u,%4u,%4u,%4u
",dat0,dat1,dat2,dat3); } } |