Refactor common IMU code into frc971
This lets us have different main functions for different years to manage
the hardware complexity.
Change-Id: Ia0fbef081265b6301e1d9e9ecc4f1d496f43a9cc
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/y2022/localizer/BUILD b/y2022/localizer/BUILD
index ec717fc..2a0a9fe 100644
--- a/y2022/localizer/BUILD
+++ b/y2022/localizer/BUILD
@@ -168,35 +168,15 @@
],
)
-cc_library(
- name = "imu",
- srcs = [
- "imu.cc",
- ],
- hdrs = [
- "imu.h",
- ],
- target_compatible_with = ["@platforms//os:linux"],
- deps = [
- "//aos/events:epoll",
- "//aos/events:shm_event_loop",
- "//aos/util:crc32",
- "//frc971/wpilib:imu_batch_fbs",
- "//frc971/wpilib:imu_fbs",
- "//y2022:constants",
- "@com_github_google_glog//:glog",
- "@com_google_absl//absl/types:span",
- ],
-)
-
cc_binary(
name = "imu_main",
srcs = ["imu_main.cc"],
target_compatible_with = ["@platforms//os:linux"],
visibility = ["//visibility:public"],
deps = [
- ":imu",
"//aos:init",
"//aos/events:shm_event_loop",
+ "//frc971/imu_reader:imu",
+ "//y2022:constants",
],
)