Professional Documents
Culture Documents
/*
void receivedOP_CRC() { /// fourdigit crc
uint8_t i;
_INTEGER inCRC;
u16 crc;
u16 low_byte;
u16 high_byte;
char *ptr;
u16 a;
if ( ! crc_tab_init )
init_crc_tab();
crc = CRC_START_KERMIT;
ptr = input_str;
if ( ptr != NULL )
for (a=0; a<num_bytes; a++) {
return crc;
}
/*uint8_t buff[13];
uint8_t inBuff[2];
toHex(Disp[curDisp].stText[6], inBuff);
buff[0] = STX;
buff[1] = Disp[curDisp].dispID;
buff[2] = SELECTING;
buff[3] = '0';
buff[4] = '0';
buff[5] = inBuff[0];
buff[6] = inBuff[1];
buff[7] = '1';
buff[8] = '0';
buff[9] = '0';
buff[10] = '0';
buff[11] = ETX;
buff[12] = getCRC(buff, 11);
writeUSART1(buff, 11);*/
// return OP_CRC_OUT;
}
void receivedOP_CRC()
{
uint8_t buff[13];
uint8_t inBuff[2];
//toHex(Disp[curDisp].stText[6], inBuff);
buff[0] = STX;
buff[1] = Disp[curDisp].dispID;
buff[2] = SELECTING;
buff[3] = '0';
buff[4] = '0';
buff[5] = r1;
buff[6] = r2;
buff[7] = '1';
buff[8] = '0';
buff[9] = '0';
buff[10] = '0';
buff[11] = ETX;
buff[12] = 0;
buff[12] = getCRC(buff, 12);
// writeUSART1(conn.commBuff, 9);
writeUSART1(buff,12 );
// return OP_CRC_OUT;
/*rec_text[0] = _STX_;
rec_text[1] = noz_no;
rec_text[2] = 'A';
rec_text[3] = '0';
rec_text[4] = '0';
rec_text[5] = r1;
rec_text[6] = r2;
rec_text[7] = '1';
rec_text[8] = '0';
rec_text[9] = '0';
rec_text[10] = '0';
rec_text[11] = _ETX_;
trn = 12;
char bcc_chk = calc_BCC();
send_ch1(_STX_);
send_ch1(noz_no);
send_ch1('A');
send_ch1('0');
send_ch1('0');
send_ch1(r1);
send_ch1(r2);
send_ch1('1');
send_ch1('0');
send_ch1('0');
send_ch1('0');
send_ch1(_ETX_);
send_ch1(bcc_chk);*/