223{
228
231
232 total = *size;
233 res = *crc8;
234 pos = 0;
235
236 rc =
soc_crc8_cal(&res, refin, plynml, &stream[0], size);
237 if (*size > 0) {
238
239 pos = total - *size;
241 pos = total - *size;
242 }
244 if (0 == *size) {
245 if (refout) {
247 }
248 res = res ^ xorout;
249 }
250 *crc8 = res;
251 }
252 return rc;
253}
static xwer_t xwlib_crc8_swcal(xwu8_t *crc8, bool refin, xwu8_t plynml, const xwu8_t stream[], xwsz_t *size)
软件方式计算数据的CRC8校验值
xwer_t soc_crc8_cal(xwu8_t *crc8, bool refin, xwu8_t polynomial, const xwu8_t stream[], xwsz_t *size)
#define EFAULT
Bad address
xwu8_t xwbop_rbit8(xwu8_t x)
#define XWOS_VALIDATE(exp, errstr,...)
检查函数参数是否有效