Hi, I've the following question about this code fragment:
... char BuffRX xdata UCHAR BuffRX[10]; idata unsigned short ValCRCcomp; idata unsigned short ValCRCappo; idata unsigned short ValCRCappo2; BuffRX[1] = 0x11; BufRX[2] = 0x2A; ... ValCRCappo = (unsigned short) (BuffRX[1] << 8); ValCRCappo2 = (unsigned short) (BuffRX[2] | 0x0000); ValCRCcomp = (unsigned short) (ValCRCappo | ValCRCappo2); ...
char BuffRX xdata UCHAR BuffRX[10]; two vatiables with the same name, read the error message and act on it Erik
char BuffRX xdata UCHAR BuffRX[10];
ValCRCappo = (unsigned short) (BuffRX[1] << 8);
ValCRCappo = (unsigned short)BuffRX[1] << 8;
ValCRCappo2 = (unsigned short) (BuffRX[2] | 0x0000);
Hi, sorry guys, the code posted previously contains some error, this is the right version:
xdata UCHAR BuffRX[10]; idata unsigned short ValCRCcomp; idata unsigned short ValCRCappo; idata unsigned short ValCRCappo2; BuffRX[1] = 0x11; BuffRX[2] = 0x2A; ... ValCRCappo = (unsigned short) (BuffRX[1] << 8); ValCRCappo2 = (unsigned short) (BuffRX[2] | 0x0000); ValCRCcomp = (unsigned short) (ValCRCappo | ValCRCappo2);
sorry guys, the code posted previously contains some error, this is the right version: That's OK, we are having sooo much fun trying to answer based on faulty posts. Erik
ValCRCcomp = (unsigned short) (ValCRCappo | ValCRCappo2);