#include /* module dump9 */ #include #include #include #include #include #include #include #include #include #include #include #include #include unsigned char sum; /* 6 calendar bytes: hours, minutes, seconds, month, day, year nb status bytes (checksum if arg = 1) 64 metering bytes (32 ints) checksum byte */ /**************************************************************************/ dump(void) /* send database to com2 */ { int fail=1,i,n=0; if(parse[4]!=CR) { if(arg(1,2)) goto abort; n=atoi(&parse[4]); } clkey(); sum=0; if(n==2) goto dump2; calout(tyme); /* 3 bytes */ calout(dayt); /* 3 bytes */ for(i=0;icounter[33]) { fail=1; status[26]|=0x08; break; } } } } else { fail=com3out(byte); sum=sum+byte; if(com3in()==XOFF) while(com3in()!=XON); } return(fail); } /****************************************************************************/ wordout(integer) /* send 16-bit number to COM2 or COM3 */ { unsigned char lower,upper; int fail; lower=integer&0xFF; upper=(integer&0xFF00)/256; if(fail=byteout(lower)) goto abort; fail=byteout(upper); abort: return(fail); }