I have to calculate LRC of a character string using this method:
LRC byte is calculated with an operation of Exclusive OR (XOR) on Data
Example :
uint8 LRC(const uint8* str, const uint16 length)
{
uint16 i=length;
uint8 r=0x00;
while (i--)
r^=*str++;
return r;
}
can you help me ?
LRC byte is calculated with an operation of Exclusive OR (XOR) on Data
Example :
uint8 LRC(const uint8* str, const uint16 length)
{
uint16 i=length;
uint8 r=0x00;
while (i--)
r^=*str++;
return r;
}
can you help me ?