void ri_zero(void) /*数组清空*/ { for(buf_c0=0;buf_c0<COM_LENGTH;buf_c0++) ri_buf[buf_c0]=0; com_count=0; }
uchar comp_read(void) /*检验外部EEROM是否大于等于1小于等于3*/ { if(ri_buf[2]!=0x0) return 1; if(ri_buf[3]!=0x3) return 2; if(ri_buf[5]+1>f_have_ee) return 3; if((ri_buf[5]==0)&&(ri_buf[6]==0)&&(ri_buf[7]<0x20)) return 4; buf_c0=0xaa^0x75^0x20^0x00^0x03^0xff^ri_buf[5]^ri_buf[6]^ri_buf[7]; if(ri_buf[8]!=buf_c0) return 5; return 0; }
void send_fun(char *pr,uchar n) /*串行接收数据*/ { 1_txd=0; fg_err0=0; ES=0; for(buf_c0=0;buf_c0<n;buf_c0++) { T1=0; ACC=*(pr+buf_c0); TB8=~P; SBUF=ACC; for(buf_c1=0;buf_c1<200;buf_c1++) if(T1) break; if(!T1) fg_err0=1; } T1=0; ES=1; } code uchar rd_err1[]={0x55,0x7a,0xfa,0xff,0x69}; code uchar wr_err1[]={0x55,0x7a,0xfb,0xff,0x2b}; code uchar wr_err2[]={0x55,0x7a,0xf5,0xff,0x25}; code uchar wr_rgh[]={0x55,0x7a,0xe0,0x00,0x00,0xff,0x30}; 帮我看看程序啊对 谢谢