blob: ac65f37e31d156a109cbf7e2da15126d0c06bb93 [file] [log] [blame]
Brian Silverman54dd2fe2018-03-16 23:44:31 -07001load("//motors:macros.bzl", "hex_from_elf")
Brian Silvermanf91524f2017-09-23 13:15:55 -04002load("//tools:environments.bzl", "mcu_cpus")
3
Brian Silverman8d3816a2017-07-03 18:52:15 -07004cc_library(
Brian Silverman54dd2fe2018-03-16 23:44:31 -07005 name = "motor",
6 srcs = [
7 "motor.cc",
8 ],
9 hdrs = [
10 "motor.h",
11 ],
12 restricted_to = mcu_cpus,
13 visibility = ["//visibility:public"],
14 deps = [
15 ":algorithms",
16 ":util",
17 "//motors/core",
18 "//motors/peripheral:adc",
19 "//motors/peripheral:can",
20 "//motors/peripheral:configuration",
Brian Silverman4787a6e2018-10-06 16:00:54 -070021 "//motors/print",
Brian Silverman54dd2fe2018-03-16 23:44:31 -070022 ],
Brian Silverman8b638692017-06-26 23:10:26 -070023)
24
Brian Silverman8b638692017-06-26 23:10:26 -070025cc_library(
Brian Silverman54dd2fe2018-03-16 23:44:31 -070026 name = "util",
27 hdrs = [
28 "util.h",
29 ],
30 restricted_to = mcu_cpus,
31 visibility = ["//visibility:public"],
32 deps = [
33 "//motors/core",
34 ],
Brian Silverman8d3816a2017-07-03 18:52:15 -070035)
36
37genrule(
Brian Silverman54dd2fe2018-03-16 23:44:31 -070038 name = "doc",
39 srcs = [
40 "NOTES.md",
41 ],
42 outs = [
43 "NOTES.html",
44 ],
45 cmd = " ".join([
Brian Silverman7297c0c2018-08-05 13:43:00 -070046 "$(location @pandoc)",
Brian Silverman54dd2fe2018-03-16 23:44:31 -070047 "-f",
48 "markdown_github-hard_line_breaks",
49 "-t",
50 "html5",
51 "-o",
52 "$@",
53 "$<",
54 ]),
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 ],
69 compatible_with = mcu_cpus,
Brian Silverman8d3816a2017-07-03 18:52:15 -070070)
71
72cc_test(
Brian Silverman54dd2fe2018-03-16 23:44:31 -070073 name = "algorithms_test",
74 srcs = [
75 "algorithms_test.cc",
76 ],
77 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 ],
91 compatible_with = mcu_cpus,
92 visibility = ["//visibility:public"],
Brian Silverman8d3816a2017-07-03 18:52:15 -070093)
94
95cc_test(
Brian Silverman54dd2fe2018-03-16 23:44:31 -070096 name = "math_test",
97 srcs = [
98 "math_test.cc",
99 ],
100 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 ],
111 restricted_to = mcu_cpus,
112 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",
126 restricted_to = mcu_cpus,
127)
128
129cc_binary(
130 name = "simple_receiver.elf",
131 srcs = [
132 "simple_receiver.cc",
133 ],
134 restricted_to = mcu_cpus,
135 deps = [
136 ":util",
137 "//motors/core",
138 "//motors/peripheral:adc",
139 "//motors/peripheral:can",
Brian Silverman4787a6e2018-10-06 16:00:54 -0700140 "//motors/print:usb",
Austin Schuh4fae0fc2018-03-27 23:51:42 -0700141 "//motors/seems_reasonable:drivetrain_lib",
142 "//motors/seems_reasonable:spring",
Brian Silverman54dd2fe2018-03-16 23:44:31 -0700143 ],
144)
145
146hex_from_elf(
Brian Silvermanb6570e32019-03-21 20:58:32 -0700147 name = "simpler_receiver",
148 restricted_to = mcu_cpus,
149)
150
151cc_binary(
152 name = "simpler_receiver.elf",
153 srcs = [
154 "simpler_receiver.cc",
155 ],
156 restricted_to = mcu_cpus,
157 deps = [
158 ":util",
159 "//motors/core",
160 "//motors/peripheral:can",
161 "//motors/peripheral:configuration",
162 "//motors/print:usb",
163 "//motors/seems_reasonable:drivetrain_lib",
164 ],
165)
166
167hex_from_elf(
Brian Silverman54dd2fe2018-03-16 23:44:31 -0700168 name = "simple_receiver",
169 restricted_to = mcu_cpus,
Brian Silverman259c4432018-01-15 14:34:21 -0800170)
Brian Silverman6470f442018-08-05 12:08:16 -0700171
172py_library(
173 name = "python_init",
174 srcs = ["__init__.py"],
175 visibility = ["//visibility:public"],
176)