blob: 0eed7ef0d1d7f4629b4407d764efe71c6e5f3c3e [file] [log] [blame]
Brian Silvermand44258e2018-05-14 10:01:18 -07001load("//motors:macros.bzl", "hex_from_elf")
2load("//tools:environments.bzl", "mcu_cpus")
3
4cc_binary(
Brian Silvermand9566392018-06-10 15:02:03 -07005 name = "fet12.elf",
6 srcs = [
James Kuszmaul998d3032018-09-08 15:41:41 -07007 "current_equalization.h",
Brian Silvermand9566392018-06-10 15:02:03 -07008 "fet12.cc",
9 ],
10 restricted_to = mcu_cpus,
11 deps = [
12 ":motor_controls",
13 "//motors:motor",
14 "//motors:util",
15 "//motors/core",
16 "//motors/peripheral:adc",
17 "//motors/peripheral:can",
18 "//motors/usb",
19 "//motors/usb:cdc",
20 ],
21)
22
James Kuszmaul998d3032018-09-08 15:41:41 -070023cc_binary(
24 name = "fet12v2.elf",
25 srcs = [
26 "current_equalization.h",
27 "fet12v2.cc",
28 ],
29 restricted_to = mcu_cpus,
30 deps = [
31 ":motor_controls",
32 "//motors:motor",
33 "//motors:util",
34 "//motors/core",
35 "//motors/peripheral:adc",
36 "//motors/peripheral:can",
37 "//motors/peripheral:uart",
38 ],
39)
40
Brian Silvermand9566392018-06-10 15:02:03 -070041hex_from_elf(
42 name = "fet12",
43 restricted_to = mcu_cpus,
44)
45
46cc_binary(
Brian Silvermand44258e2018-05-14 10:01:18 -070047 name = "power_wheels.elf",
48 srcs = [
49 "power_wheels.cc",
50 ],
51 restricted_to = mcu_cpus,
52 deps = [
53 "//motors:util",
54 "//motors/core",
55 "//motors/peripheral:adc",
56 "//motors/usb",
57 "//motors/usb:cdc",
58 ],
59)
60
61hex_from_elf(
62 name = "power_wheels",
63 restricted_to = mcu_cpus,
64)
Brian Silvermand9566392018-06-10 15:02:03 -070065
66cc_library(
67 name = "motor_controls",
68 srcs = [
69 "motor_controls.cc",
70 ],
71 hdrs = [
72 "motor_controls.h",
73 ],
74 restricted_to = mcu_cpus,
75 deps = [
76 "//motors:math",
77 "//motors:motor",
78 "//motors/peripheral:configuration",
79 "//third_party/eigen",
80 ],
81)
James Kuszmaul998d3032018-09-08 15:41:41 -070082
Brian Silvermanb7fdb692018-09-09 15:50:45 -070083py_binary(
84 name = "current_equalize",
85 srcs = [
86 "current_equalize.py",
87 ],
88 data = [
89 "@python_repo//:scipy",
90 ],
91)
92
James Kuszmaul998d3032018-09-08 15:41:41 -070093genrule(
94 name = "gen_current_equalization",
95 outs = ["current_equalization.h"],
Brian Silvermanb7fdb692018-09-09 15:50:45 -070096 cmd = "./$(location current_equalize) > \"$@\"",
James Kuszmaul998d3032018-09-08 15:41:41 -070097 restricted_to = mcu_cpus,
Brian Silvermanb7fdb692018-09-09 15:50:45 -070098 tools = ["current_equalize"],
James Kuszmaul998d3032018-09-08 15:41:41 -070099)