Brian Silverman | f91524f | 2017-09-23 13:15:55 -0400 | [diff] [blame] | 1 | load('//motors:macros.bzl', 'hex_from_elf') |
| 2 | load("//tools:environments.bzl", "mcu_cpus") |
| 3 | |
| 4 | cc_binary( |
| 5 | name = 'drivers_station.elf', |
| 6 | srcs = [ |
| 7 | 'drivers_station.cc', |
| 8 | ], |
| 9 | deps = [ |
| 10 | '//motors:util', |
Brian Silverman | 4aa8304 | 2018-01-05 12:47:31 -0800 | [diff] [blame] | 11 | '//motors/peripheral:can', |
Brian Silverman | d930f28 | 2017-11-04 23:09:12 -0400 | [diff] [blame] | 12 | '//motors/core', |
Brian Silverman | f91524f | 2017-09-23 13:15:55 -0400 | [diff] [blame] | 13 | '//motors/usb', |
Brian Silverman | eda63f3 | 2017-10-08 18:57:33 -0400 | [diff] [blame] | 14 | '//motors/usb:cdc', |
Brian Silverman | d930f28 | 2017-11-04 23:09:12 -0400 | [diff] [blame] | 15 | '//motors/usb:hid', |
Brian Silverman | 4aa8304 | 2018-01-05 12:47:31 -0800 | [diff] [blame] | 16 | '//motors/usb:interrupt_out', |
Brian Silverman | f91524f | 2017-09-23 13:15:55 -0400 | [diff] [blame] | 17 | ], |
| 18 | restricted_to = mcu_cpus, |
| 19 | ) |
| 20 | |
| 21 | hex_from_elf( |
| 22 | name = 'drivers_station', |
| 23 | restricted_to = mcu_cpus, |
| 24 | ) |
Brian Silverman | 4aa8304 | 2018-01-05 12:47:31 -0800 | [diff] [blame] | 25 | |
| 26 | cc_binary( |
Brian Silverman | 6260c09 | 2018-01-14 15:21:36 -0800 | [diff] [blame^] | 27 | 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 | |
| 47 | hex_from_elf( |
| 48 | name = 'controller', |
| 49 | restricted_to = mcu_cpus, |
| 50 | ) |
| 51 | |
| 52 | cc_binary( |
Brian Silverman | 4aa8304 | 2018-01-05 12:47:31 -0800 | [diff] [blame] | 53 | 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 | |
| 65 | genrule( |
| 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 Silverman | 6260c09 | 2018-01-14 15:21:36 -0800 | [diff] [blame^] | 85 | |
| 86 | cc_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 | ) |