blob: b606bf777404e04a80c30a28a282f84dc7b6a957 [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
Brian Silverman259c4432018-01-15 14:34:21 -0800106cc_binary(
Brian Silverman54dd2fe2018-03-16 23:44:31 -0700107 name = "button_board.elf",
108 srcs = [
109 "button_board.cc",
110 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800111 target_compatible_with = ["@platforms//os:none"],
Brian Silverman54dd2fe2018-03-16 23:44:31 -0700112 deps = [
113 ":util",
114 "//motors/core",
115 "//motors/peripheral:adc",
116 "//motors/peripheral:can",
Brian Silverman4787a6e2018-10-06 16:00:54 -0700117 "//motors/print:usb",
Brian Silverman54dd2fe2018-03-16 23:44:31 -0700118 "//motors/usb",
119 "//motors/usb:cdc",
120 "//motors/usb:hid",
121 ],
Brian Silverman259c4432018-01-15 14:34:21 -0800122)
123
124hex_from_elf(
Brian Silverman54dd2fe2018-03-16 23:44:31 -0700125 name = "button_board",
Philipp Schraderdada1072020-11-24 11:34:46 -0800126 target_compatible_with = ["@platforms//os:none"],
Brian Silverman54dd2fe2018-03-16 23:44:31 -0700127)
128
129cc_binary(
130 name = "simple_receiver.elf",
131 srcs = [
132 "simple_receiver.cc",
133 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700134 copts = ["-Wno-type-limits"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800135 target_compatible_with = ["@platforms//os:none"],
Brian Silverman54dd2fe2018-03-16 23:44:31 -0700136 deps = [
137 ":util",
138 "//motors/core",
139 "//motors/peripheral:adc",
140 "//motors/peripheral:can",
Brian Silverman4787a6e2018-10-06 16:00:54 -0700141 "//motors/print:usb",
Austin Schuh4fae0fc2018-03-27 23:51:42 -0700142 "//motors/seems_reasonable:drivetrain_lib",
143 "//motors/seems_reasonable:spring",
Brian Silverman54dd2fe2018-03-16 23:44:31 -0700144 ],
145)
146
147hex_from_elf(
Brian Silvermanb6570e32019-03-21 20:58:32 -0700148 name = "simpler_receiver",
Philipp Schraderdada1072020-11-24 11:34:46 -0800149 target_compatible_with = ["@platforms//os:none"],
Brian Silvermanb6570e32019-03-21 20:58:32 -0700150)
151
152cc_binary(
153 name = "simpler_receiver.elf",
154 srcs = [
155 "simpler_receiver.cc",
156 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700157 copts = ["-Wno-type-limits"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800158 target_compatible_with = ["@platforms//os:none"],
Brian Silvermanb6570e32019-03-21 20:58:32 -0700159 deps = [
160 ":util",
161 "//motors/core",
Brian Silvermanb6570e32019-03-21 20:58:32 -0700162 "//motors/peripheral:configuration",
163 "//motors/print:usb",
164 "//motors/seems_reasonable:drivetrain_lib",
165 ],
166)
167
168hex_from_elf(
Brian Silverman54dd2fe2018-03-16 23:44:31 -0700169 name = "simple_receiver",
Philipp Schraderdada1072020-11-24 11:34:46 -0800170 target_compatible_with = ["@platforms//os:none"],
Brian Silverman259c4432018-01-15 14:34:21 -0800171)
Brian Silverman6470f442018-08-05 12:08:16 -0700172
173py_library(
174 name = "python_init",
175 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800176 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700177 visibility = ["//visibility:public"],
178)