blob: 503291f3e5b375d6914d781b3ca0a3c80e0dc450 [file] [log] [blame]
Brian Silvermanf91524f2017-09-23 13:15:55 -04001load('//motors:macros.bzl', 'hex_from_elf')
2load("//tools:environments.bzl", "mcu_cpus")
3
4cc_binary(
5 name = 'drivers_station.elf',
6 srcs = [
7 'drivers_station.cc',
8 ],
9 deps = [
10 '//motors:util',
Brian Silverman4aa83042018-01-05 12:47:31 -080011 '//motors/peripheral:can',
Brian Silvermand930f282017-11-04 23:09:12 -040012 '//motors/core',
Brian Silvermanf91524f2017-09-23 13:15:55 -040013 '//motors/usb',
Brian Silvermaneda63f32017-10-08 18:57:33 -040014 '//motors/usb:cdc',
Brian Silvermand930f282017-11-04 23:09:12 -040015 '//motors/usb:hid',
Brian Silverman4aa83042018-01-05 12:47:31 -080016 '//motors/usb:interrupt_out',
Brian Silvermanf91524f2017-09-23 13:15:55 -040017 ],
18 restricted_to = mcu_cpus,
19)
20
21hex_from_elf(
22 name = 'drivers_station',
23 restricted_to = mcu_cpus,
24)
Brian Silverman4aa83042018-01-05 12:47:31 -080025
26cc_binary(
Brian Silverman6260c092018-01-14 15:21:36 -080027 name = 'controller.elf',
28 srcs = [
29 'vtable_wheel.cc',
30 'vtable_trigger.cc',
31 'controller.cc',
32 ],
33 deps = [
34 ':motor_controls',
35 '//motors:util',
36 '//motors:motor',
37 '//motors/core',
38 '//motors/peripheral:can',
39 '//motors/peripheral:adc',
40 '//motors/usb',
41 '//motors/usb:cdc',
42 '//frc971/control_loops/drivetrain:haptic_input_uc',
43 ],
44 restricted_to = mcu_cpus,
45)
46
47hex_from_elf(
48 name = 'controller',
49 restricted_to = mcu_cpus,
50)
51
52cc_binary(
Brian Silverman4aa83042018-01-05 12:47:31 -080053 name = 'usb_forward_linux',
54 srcs = [
55 'usb_forward.cc',
56 ],
57 deps = [
58 # Don't add anything else here. :usb_forward_windows still has to build it
59 # without any other dependencies.
60 '@libusb_1_0',
61 ],
62 restricted_to = ['//tools:k8'],
63)
64
65genrule(
66 name = 'usb_forward_windows',
67 outs = [
68 'usb_forward.exe',
69 ],
70 srcs = [
71 'usb_forward.cc',
72 '@libusb_1_0_windows//file',
73 ],
74 tools = [
75 'usb_forward_windows_build.sh',
76 ],
77 cmd = ' '.join([
78 '$(location usb_forward_windows_build.sh)',
79 '$(location usb_forward.cc)',
80 '$(location @libusb_1_0_windows//file)',
81 '$@',
82 ]),
83 output_to_bindir = True,
84)
Brian Silverman6260c092018-01-14 15:21:36 -080085
86cc_library(
87 name = 'motor_controls',
88 visibility = ['//visibility:public'],
89 hdrs = [
90 'motor_controls.h',
91 ],
92 srcs = [
93 'motor_controls.cc',
94 ],
95 deps = [
96 '//motors:math',
97 '//motors:motor',
98 '//motors/peripheral:configuration',
99 '//third_party/eigen',
100 ],
101 restricted_to = mcu_cpus,
102)