Rename CRC functions to be more generic
These will be useful for UART communications too.
Change-Id: I443ca555c91aa5522dae493b1a5e83ae622dafc5
diff --git a/y2019/jevois/BUILD b/y2019/jevois/BUILD
index e99a264..7d26c1e 100644
--- a/y2019/jevois/BUILD
+++ b/y2019/jevois/BUILD
@@ -1,7 +1,7 @@
load("//tools:environments.bzl", "mcu_cpus")
load("//motors:macros.bzl", "hex_from_elf")
-spi_crc_args = [
+jevois_crc_args = [
"$(location //third_party/pycrc:pycrc_main)",
"--width=16",
# This is the recommendation from
@@ -17,24 +17,24 @@
"--xor-out=0xffff",
"--std=C99",
"--algorithm=table-driven",
- "--symbol-prefix=jevois_spi_crc_",
+ "--symbol-prefix=jevois_crc_",
"--crc-type=uint16_t",
]
genrule(
- name = "gen_spi_crc",
+ name = "gen_jevois_crc",
outs = [
- "spi_crc.h",
- "spi_crc.c",
+ "jevois_crc.h",
+ "jevois_crc.c",
],
cmd = " && ".join([
- " ".join(spi_crc_args + [
+ " ".join(jevois_crc_args + [
"--generate=h",
- "--output=$(location spi_crc.h)",
+ "--output=$(location jevois_crc.h)",
]),
- " ".join(spi_crc_args + [
+ " ".join(jevois_crc_args + [
"--generate=c",
- "--output=$(location spi_crc.c)",
+ "--output=$(location jevois_crc.c)",
]),
]),
tools = [
@@ -43,12 +43,12 @@
)
cc_library(
- name = "spi_crc",
+ name = "jevois_crc",
srcs = [
- "spi_crc.c",
+ "jevois_crc.c",
],
hdrs = [
- "spi_crc.h",
+ "jevois_crc.h",
],
deps = [
"//third_party/GSL",
@@ -77,7 +77,7 @@
"spi.h",
],
deps = [
- ":spi_crc",
+ ":jevois_crc",
":structures",
"//aos/util:bitpacking",
"//third_party/GSL",