blob: 09b721307d4d9602cbf605fa702628c990b449fe [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",
103 "//third_party/googletest:googlemock",
104 ],
Brian Silverman8d3816a2017-07-03 18:52:15 -0700105)
106
Brian Silverman259c4432018-01-15 14:34:21 -0800107cc_binary(
Brian Silverman54dd2fe2018-03-16 23:44:31 -0700108 name = "button_board.elf",
109 srcs = [
110 "button_board.cc",
111 ],
112 restricted_to = mcu_cpus,
113 deps = [
114 ":util",
115 "//motors/core",
116 "//motors/peripheral:adc",
117 "//motors/peripheral:can",
Brian Silverman4787a6e2018-10-06 16:00:54 -0700118 "//motors/print:usb",
Brian Silverman54dd2fe2018-03-16 23:44:31 -0700119 "//motors/usb",
120 "//motors/usb:cdc",
121 "//motors/usb:hid",
122 ],
Brian Silverman259c4432018-01-15 14:34:21 -0800123)
124
125hex_from_elf(
Brian Silverman54dd2fe2018-03-16 23:44:31 -0700126 name = "button_board",
127 restricted_to = mcu_cpus,
128)
129
130cc_binary(
131 name = "simple_receiver.elf",
132 srcs = [
133 "simple_receiver.cc",
134 ],
135 restricted_to = mcu_cpus,
136 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(
148 name = "simple_receiver",
149 restricted_to = mcu_cpus,
Brian Silverman259c4432018-01-15 14:34:21 -0800150)
Brian Silverman6470f442018-08-05 12:08:16 -0700151
152py_library(
153 name = "python_init",
154 srcs = ["__init__.py"],
155 visibility = ["//visibility:public"],
156)