This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Why this shift doesn't run?

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);
...


Even the values in BuffRX[1] and BuffRX[2] are differents from zero, ValCRCcomp is always zero!

Any hints?

Thanks

0