blob: 3b6433db110c76f345061a807bebfed8f39a6681 [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 Silverman8b638692017-06-26 23:10:26 -07004cc_binary(
Brian Silverman54dd2fe2018-03-16 23:44:31 -07005 name = "medium_salsa.elf",
6 srcs = [
7 "medium_salsa.cc",
8 ],
9 restricted_to = mcu_cpus,
10 deps = [
11 ":motor",
12 ":motor_controls",
13 ":util",
14 "//motors/core",
15 "//motors/peripheral:adc",
16 "//motors/peripheral:can",
17 "//motors/usb:legacy",
18 ],
Brian Silverman8d3816a2017-07-03 18:52:15 -070019)
20
21cc_library(
Brian Silverman54dd2fe2018-03-16 23:44:31 -070022 name = "motor",
23 srcs = [
24 "motor.cc",
25 ],
26 hdrs = [
27 "motor.h",
28 ],
29 restricted_to = mcu_cpus,
30 visibility = ["//visibility:public"],
31 deps = [
32 ":algorithms",
33 ":util",
34 "//motors/core",
35 "//motors/peripheral:adc",
36 "//motors/peripheral:can",
37 "//motors/peripheral:configuration",
38 "//motors/usb:cdc",
39 ],
Brian Silverman8b638692017-06-26 23:10:26 -070040)
41
Brian Silvermanf91524f2017-09-23 13:15:55 -040042hex_from_elf(
Brian Silverman54dd2fe2018-03-16 23:44:31 -070043 name = "medium_salsa",
44 restricted_to = mcu_cpus,
Brian Silverman8b638692017-06-26 23:10:26 -070045)
46
47cc_library(
Brian Silverman54dd2fe2018-03-16 23:44:31 -070048 name = "util",
49 hdrs = [
50 "util.h",
51 ],
52 restricted_to = mcu_cpus,
53 visibility = ["//visibility:public"],
54 deps = [
55 "//motors/core",
56 ],
Brian Silverman8d3816a2017-07-03 18:52:15 -070057)
58
59genrule(
Brian Silverman54dd2fe2018-03-16 23:44:31 -070060 name = "doc",
61 srcs = [
62 "NOTES.md",
63 ],
64 outs = [
65 "NOTES.html",
66 ],
67 cmd = " ".join([
68 "pandoc",
69 "-f",
70 "markdown_github-hard_line_breaks",
71 "-t",
72 "html5",
73 "-o",
74 "$@",
75 "$<",
76 ]),
Brian Silverman8d3816a2017-07-03 18:52:15 -070077)
78
79cc_library(
Brian Silverman54dd2fe2018-03-16 23:44:31 -070080 name = "algorithms",
81 srcs = [
82 "algorithms.cc",
83 ],
84 hdrs = [
85 "algorithms.h",
86 ],
87 compatible_with = mcu_cpus,
Brian Silverman8d3816a2017-07-03 18:52:15 -070088)
89
90cc_test(
Brian Silverman54dd2fe2018-03-16 23:44:31 -070091 name = "algorithms_test",
92 srcs = [
93 "algorithms_test.cc",
94 ],
95 deps = [
96 ":algorithms",
97 "//aos/testing:googletest",
98 ],
Brian Silverman8d3816a2017-07-03 18:52:15 -070099)
100
101cc_library(
Brian Silverman54dd2fe2018-03-16 23:44:31 -0700102 name = "math",
103 srcs = [
104 "math.cc",
105 ],
106 hdrs = [
107 "math.h",
108 ],
109 compatible_with = mcu_cpus,
110 visibility = ["//visibility:public"],
Brian Silverman8d3816a2017-07-03 18:52:15 -0700111)
112
113cc_test(
Brian Silverman54dd2fe2018-03-16 23:44:31 -0700114 name = "math_test",
115 srcs = [
116 "math_test.cc",
117 ],
118 deps = [
119 ":math",
120 "//aos/testing:googletest",
121 "//third_party/googletest:googlemock",
122 ],
Brian Silverman8d3816a2017-07-03 18:52:15 -0700123)
124
125cc_library(
Brian Silverman54dd2fe2018-03-16 23:44:31 -0700126 name = "motor_controls",
127 srcs = [
128 "motor_controls.cc",
129 ],
130 hdrs = [
131 "motor_controls.h",
132 ],
133 restricted_to = mcu_cpus,
134 deps = [
135 ":math",
136 ":motor",
137 "//motors/peripheral:configuration",
138 "//third_party/eigen",
139 ],
Brian Silverman8b638692017-06-26 23:10:26 -0700140)
Brian Silverman259c4432018-01-15 14:34:21 -0800141
142cc_binary(
Brian Silverman54dd2fe2018-03-16 23:44:31 -0700143 name = "button_board.elf",
144 srcs = [
145 "button_board.cc",
146 ],
147 restricted_to = mcu_cpus,
148 deps = [
149 ":util",
150 "//motors/core",
151 "//motors/peripheral:adc",
152 "//motors/peripheral:can",
153 "//motors/usb",
154 "//motors/usb:cdc",
155 "//motors/usb:hid",
156 ],
Brian Silverman259c4432018-01-15 14:34:21 -0800157)
158
159hex_from_elf(
Brian Silverman54dd2fe2018-03-16 23:44:31 -0700160 name = "button_board",
161 restricted_to = mcu_cpus,
162)
163
164cc_binary(
165 name = "simple_receiver.elf",
166 srcs = [
167 "simple_receiver.cc",
168 ],
169 restricted_to = mcu_cpus,
170 deps = [
171 ":util",
172 "//motors/core",
173 "//motors/peripheral:adc",
174 "//motors/peripheral:can",
175 "//motors/usb",
176 "//motors/usb:cdc",
177 ],
178)
179
180hex_from_elf(
181 name = "simple_receiver",
182 restricted_to = mcu_cpus,
Brian Silverman259c4432018-01-15 14:34:21 -0800183)