一 累加和校验变种:
/*******************************************************************************
--- @brief
--- @param None
--- @retval None
--- @note
*******************************************************************************/
static INT8U Calculate_JiaoYan(INT8U *Buffer,INT16U len)
{
INT16U i =0;
INT16U Sum = 0x0;
INT8U jiaoyan_bit = 0x0;
for(i = 0; i < len; i++) {
Sum += Buffer[i];
}
jiaoyan_bit = (Sum&0x7f);
return (INT8U)(jiaoyan_bit);
}
用小工具CheckTool.exe手工计算检验。