blob: 3bccf20d5254e4aa17468dfe6a33beed03d8e15c [file] [log] [blame]
Ravago Jones281800e2023-02-13 02:24:07 -08001load("//third_party/pico-sdk:hex.bzl", "pioasm", "uf2_from_elf")
Austin Schuh0a96ea32022-01-01 22:29:30 -08002
3# TODO(austin): We should be able to either push the linker script into the crosstool, or wrap this in a macro.
4cc_binary(
5 name = "blink.elf",
6 srcs = [
7 "blink.c",
8 "//third_party/pico-sdk/src/rp2_common/boot_stage2:bs2_default_padded_checksummed.S",
9 ],
10 additional_linker_inputs = [
11 "//third_party/pico-sdk:src/rp2_common/pico_standard_link/memmap_default.ld",
12 ],
13 linkopts = [
14 "-Wl,--script=third_party/pico-sdk/src/rp2_common/pico_standard_link/memmap_default.ld",
15 ],
16 target_compatible_with = [
17 "@platforms//os:none",
18 "//tools/platforms/hardware:cortex_m0plus",
19 ],
20 deps = ["//third_party/pico-sdk"],
21)
22
23uf2_from_elf(
24 name = "blink",
25)
Ravago Jones281800e2023-02-13 02:24:07 -080026
27pioasm(
28 name = "quadrature_encoder",
29 src = "quadrature_encoder.pio",
30 out = "quadrature_encoder.pio.h",
31)
32
33# TODO(austin): We should be able to either push the linker script into the crosstool, or wrap this in a macro.
34cc_binary(
35 name = "ADIS16505.elf",
36 srcs = [
37 "ADIS16505.cc",
38 "quadrature_encoder.pio.h",
39 "//third_party/pico-sdk/src/rp2_common/boot_stage2:bs2_default_padded_checksummed.S",
40 ],
41 additional_linker_inputs = [
42 "//third_party/pico-sdk:src/rp2_common/pico_standard_link/memmap_default.ld",
43 ],
44 copts = [
45 "-Wno-unused-parameter",
46 "-Wno-unused-variable",
47 "-Wno-double-promotion",
Ravago Jones281800e2023-02-13 02:24:07 -080048 "-Wno-unused-function",
49 ],
50 includes = ["."],
51 linkopts = [
52 "-Wl,--script=third_party/pico-sdk/src/rp2_common/pico_standard_link/memmap_default.ld",
53 ],
54 target_compatible_with = [
55 "@platforms//os:none",
56 "//tools/platforms/hardware:cortex_m0plus",
57 ],
58 deps = ["//third_party/pico-sdk"],
59)
60
61uf2_from_elf(
62 name = "ADIS16505",
63)
James Kuszmaula60aee12024-02-02 22:57:47 -080064
65cc_library(
66 name = "imu_calibrator",
67 srcs = ["imu_calibrator.cc"],
68 hdrs = [
69 "imu_calibrator.h",
70 "imu_calibrator-tmpl.h",
71 ],
72 target_compatible_with = ["@platforms//os:linux"],
73 deps = [
74 "//aos/time",
75 "//frc971/math:interpolate",
76 "@com_google_absl//absl/strings:str_format",
77 "@com_google_ceres_solver//:ceres",
78 "@org_tuxfamily_eigen//:eigen",
79 ],
80)
81
82cc_library(
83 name = "imu_calibrator_solver",
84 srcs = [
85 "imu_calibrator_solver.cc",
86 ],
87 hdrs = [
88 "imu_calibrator_solver.h",
89 ],
90 deps = [
91 ":imu_calibrator",
92 "@com_google_ceres_solver//:ceres",
93 "@org_tuxfamily_eigen//:eigen",
94 ],
95)
96
97cc_test(
98 name = "imu_calibrator_test",
99 srcs = ["imu_calibrator_test.cc"],
100 shard_count = 3,
101 deps = [
102 ":imu_calibrator",
103 ":imu_calibrator_solver",
104 "//aos/testing:googletest",
105 ],
106)