blob: d4ad63d9ed0c345f54f7886554259feca9ec790a [file] [log] [blame]
Brian Silverman54dd2fe2018-03-16 23:44:31 -07001load("//motors:macros.bzl", "hex_from_elf")
Brian Silvermanf91524f2017-09-23 13:15:55 -04002
Brian Silverman8d3816a2017-07-03 18:52:15 -07003cc_library(
Brian Silverman54dd2fe2018-03-16 23:44:31 -07004 name = "motor",
5 srcs = [
6 "motor.cc",
7 ],
8 hdrs = [
9 "motor.h",
10 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080011 target_compatible_with = ["@platforms//os:none"],
Brian Silverman54dd2fe2018-03-16 23:44:31 -070012 visibility = ["//visibility:public"],
13 deps = [
14 ":algorithms",
15 ":util",
16 "//motors/core",
17 "//motors/peripheral:adc",
18 "//motors/peripheral:can",
19 "//motors/peripheral:configuration",
Brian Silverman4787a6e2018-10-06 16:00:54 -070020 "//motors/print",
Brian Silverman54dd2fe2018-03-16 23:44:31 -070021 ],
Brian Silverman8b638692017-06-26 23:10:26 -070022)
23
Brian Silverman8b638692017-06-26 23:10:26 -070024cc_library(
Brian Silverman54dd2fe2018-03-16 23:44:31 -070025 name = "util",
26 hdrs = [
27 "util.h",
28 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080029 target_compatible_with = ["@platforms//os:none"],
Brian Silverman54dd2fe2018-03-16 23:44:31 -070030 visibility = ["//visibility:public"],
31 deps = [
32 "//motors/core",
33 ],
Brian Silverman8d3816a2017-07-03 18:52:15 -070034)
35
36genrule(
Brian Silverman54dd2fe2018-03-16 23:44:31 -070037 name = "doc",
38 srcs = [
39 "NOTES.md",
40 ],
41 outs = [
42 "NOTES.html",
43 ],
44 cmd = " ".join([
Brian Silverman7297c0c2018-08-05 13:43:00 -070045 "$(location @pandoc)",
Brian Silverman54dd2fe2018-03-16 23:44:31 -070046 "-f",
47 "markdown_github-hard_line_breaks",
48 "-t",
49 "html5",
50 "-o",
51 "$@",
52 "$<",
53 ]),
Philipp Schraderdada1072020-11-24 11:34:46 -080054 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman7297c0c2018-08-05 13:43:00 -070055 tools = [
56 "@pandoc",
57 "@pandoc//:all_files",
58 ],
Brian Silverman8d3816a2017-07-03 18:52:15 -070059)
60
61cc_library(
Brian Silverman54dd2fe2018-03-16 23:44:31 -070062 name = "algorithms",
63 srcs = [
64 "algorithms.cc",
65 ],
66 hdrs = [
67 "algorithms.h",
68 ],
Brian Silverman8d3816a2017-07-03 18:52:15 -070069)
70
71cc_test(
Brian Silverman54dd2fe2018-03-16 23:44:31 -070072 name = "algorithms_test",
73 srcs = [
74 "algorithms_test.cc",
75 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080076 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman54dd2fe2018-03-16 23:44:31 -070077 deps = [
78 ":algorithms",
79 "//aos/testing:googletest",
80 ],
Brian Silverman8d3816a2017-07-03 18:52:15 -070081)
82
83cc_library(
Brian Silverman54dd2fe2018-03-16 23:44:31 -070084 name = "math",
85 srcs = [
86 "math.cc",
87 ],
88 hdrs = [
89 "math.h",
90 ],
Brian Silverman54dd2fe2018-03-16 23:44:31 -070091 visibility = ["//visibility:public"],
Brian Silverman8d3816a2017-07-03 18:52:15 -070092)
93
94cc_test(
Brian Silverman54dd2fe2018-03-16 23:44:31 -070095 name = "math_test",
96 srcs = [
97 "math_test.cc",
98 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080099 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman54dd2fe2018-03-16 23:44:31 -0700100 deps = [
101 ":math",
102 "//aos/testing:googletest",
Brian Silverman54dd2fe2018-03-16 23:44:31 -0700103 ],
Brian Silverman8d3816a2017-07-03 18:52:15 -0700104)
105
Sindy Tan9e89a882024-06-29 16:13:59 -0700106cc_library(
Sindy Tanfc771aa2024-07-19 22:38:43 -0700107 name = "driver_station_lib",
108 srcs = ["driver_station.cc"],
109 hdrs = ["driver_station.h"],
Sindy Tan9e89a882024-06-29 16:13:59 -0700110 target_compatible_with = ["@platforms//os:none"],
111 deps = [
112 ":util",
113 "//motors/core",
114 "//motors/peripheral:adc",
115 "//motors/peripheral:can",
116 "//motors/print:usb",
117 "//motors/usb",
118 "//motors/usb:cdc",
119 "//motors/usb:hid",
120 ],
121)
122
123[
124 cc_binary(
Sindy Tanfc771aa2024-07-19 22:38:43 -0700125 name = "driver_station.elf",
Sindy Tan9e89a882024-06-29 16:13:59 -0700126 target_compatible_with = ["@platforms//os:none"],
Sindy Tanfc771aa2024-07-19 22:38:43 -0700127 deps = [":driver_station_lib"],
Sindy Tan9e89a882024-06-29 16:13:59 -0700128 ),
129]
130
131[
132 hex_from_elf(
Sindy Tanfc771aa2024-07-19 22:38:43 -0700133 name = "driver_station",
Sindy Tan9e89a882024-06-29 16:13:59 -0700134 target_compatible_with = ["@platforms//os:none"],
135 ),
136]
137
Brian Silverman259c4432018-01-15 14:34:21 -0800138cc_binary(
Brian Silverman54dd2fe2018-03-16 23:44:31 -0700139 name = "simple_receiver.elf",
140 srcs = [
141 "simple_receiver.cc",
142 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700143 copts = ["-Wno-type-limits"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800144 target_compatible_with = ["@platforms//os:none"],
Brian Silverman54dd2fe2018-03-16 23:44:31 -0700145 deps = [
146 ":util",
147 "//motors/core",
148 "//motors/peripheral:adc",
149 "//motors/peripheral:can",
Brian Silverman4787a6e2018-10-06 16:00:54 -0700150 "//motors/print:usb",
Austin Schuh4fae0fc2018-03-27 23:51:42 -0700151 "//motors/seems_reasonable:drivetrain_lib",
152 "//motors/seems_reasonable:spring",
Brian Silverman54dd2fe2018-03-16 23:44:31 -0700153 ],
154)
155
156hex_from_elf(
Brian Silvermanb6570e32019-03-21 20:58:32 -0700157 name = "simpler_receiver",
Philipp Schraderdada1072020-11-24 11:34:46 -0800158 target_compatible_with = ["@platforms//os:none"],
Brian Silvermanb6570e32019-03-21 20:58:32 -0700159)
160
161cc_binary(
162 name = "simpler_receiver.elf",
163 srcs = [
164 "simpler_receiver.cc",
165 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700166 copts = ["-Wno-type-limits"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800167 target_compatible_with = ["@platforms//os:none"],
Brian Silvermanb6570e32019-03-21 20:58:32 -0700168 deps = [
169 ":util",
170 "//motors/core",
Brian Silvermanb6570e32019-03-21 20:58:32 -0700171 "//motors/peripheral:configuration",
172 "//motors/print:usb",
173 "//motors/seems_reasonable:drivetrain_lib",
174 ],
175)
176
177hex_from_elf(
Brian Silverman54dd2fe2018-03-16 23:44:31 -0700178 name = "simple_receiver",
Philipp Schraderdada1072020-11-24 11:34:46 -0800179 target_compatible_with = ["@platforms//os:none"],
Brian Silverman259c4432018-01-15 14:34:21 -0800180)
Brian Silverman6470f442018-08-05 12:08:16 -0700181
182py_library(
183 name = "python_init",
184 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800185 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700186 visibility = ["//visibility:public"],
187)