|
|||||||||||
|
Technical Support Support Resources
Product Information |
Technical SupportC51: ARE CHECKSUM LIBRARY ROUTINES INCLUDED?QUESTIONIs a checksum routine available with the C51 compiler? ANSWERThere is no predefined checksum routine included in the C51 library. However, these routines are notoriously easy to implement. For example:
unsigned char calc_checksum (
unsigned char *start_addr,
unsigned int len)
{
unsigned char checksum = 0;
for (; len > 0; len--, start_addr++)
{
checksum += *start_addr;
}
return (checksum);
}
is a checksum routine that works with the C51 Compiler. Last Reviewed: Sunday, May 16, 2004 | ||||||||||
|
|||||||||||