Fan YANG e03342ff6b [bsp][hpmicro] add HPM5300EVK,HPM5301EVKLITE and HPM6800EVK support & update hpm_sdk
- added new boards: hpm5300evk, hpm5301evklite and hpm6800evk
- upgaded hpm_sdk
- driver updates and bugfixes
- add hpmicro BSPs to CI

Signed-off-by: Fan YANG <fan.yang@hpmicro.com>
2024-06-03 18:05:20 +08:00

27 lines
443 B
C

/*
* Copyright (c) 2023 HPMicro
*
* SPDX-License-Identifier: BSD-3-Clause
*
*/
#include "hpm_crc32.h"
uint32_t crc32(const uint8_t *buf, uint32_t len)
{
uint8_t i;
uint32_t crc = 0xFFFFFFFF;
while (len--) {
crc ^= *buf++;
for (i = 0; i < 8; ++i) {
if (crc & 1)
crc = (crc >> 1) ^ 0xEDB88320;
else
crc = (crc >> 1);
}
}
return ~crc;
}