void processInput(void) { char tempstr[16]; int j; unsigned char CRC; tempstr[0]=0; // clear for later use CRC=comInput1[0]+3; if(comInputLoc1>=CRC) // comInputLoc1 = input from com1, how many bytes are in the buffer { for(j=0;j<=CRC;j++) { tempstr[j]=comInput1[j]; comInput1[j]=comInput1[j+tempstr[0]+3]; } comInputLoc1=comInputLoc1-(tempstr[0]+3); comInput1[comInputLoc1+1]=0; } if(tempstr[0]!=0) // Validate CRC { CRC=0; for(j=0;j> 8; // strip lower bytes tempstr[3]=j; j=altVoltOutConv; // fill in with real data later j=(char)j; tempstr[4]=j; CRC=tempstr[0]+tempstr[1]+tempstr[2]+tempstr[3]+tempstr[4]; CRC=0xff-CRC; CRC++; tempstr[5]=CRC; break; default: break; } } }