mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-08-05 06:25:20 +00:00
move crc.h to sys/crc.h and create a shim for backward-compatibility. No functional changes to the headers. A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES. Related to #16539 Signed-off-by: Anas Nashif <anas.nashif@intel.com>
20 lines
291 B
C
20 lines
291 B
C
/*
|
|
* Copyright (c) 2018 Google LLC.
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#include <sys/crc.h>
|
|
|
|
u8_t crc7_be(u8_t seed, const u8_t *src, size_t len)
|
|
{
|
|
while (len--) {
|
|
u8_t e = seed ^ *src++;
|
|
u8_t f = e ^ (e >> 4) ^ (e >> 7);
|
|
|
|
seed = (f << 1) ^ (f << 4);
|
|
}
|
|
|
|
return seed;
|
|
}
|