Hi, I'm trying to understand a part of a C-program written for the M16C. This part of code should send a string through the uart. The previous code builds the string (an unsigned char array) to be sent. It manipulates every byte, then put it into the array, and then sent it byte after byte in the for-loop.
[...] tmp = InfoToBeSent >> 8; //What does this mean?tmp = tmp & 0x0F; if (tmp < 0x0A) // And this? { tmp = tmp + 0x30; // And this?? } else { tmp = tmp + 0x37; // And this?!? }
StringToBeSent[7] = tmp;
[...]for (tmp = 0; tmp < 11; tmp++) { TX_PORT = StringToBeSent[x]; }
I can't catch the meaning of the 3 lines where I put a comment... Have you any idea? Thanks