blob: 625c1498a1a09ae70a7c6b2a6701633d9620741c [file] [log] [blame]
load("//motors:macros.bzl", "hex_from_elf")
load("//tools:environments.bzl", "mcu_cpus")
cc_binary(
name = "fet12.elf",
srcs = [
"current_equalization.h",
"fet12.cc",
],
restricted_to = mcu_cpus,
deps = [
":motor_controls",
"//motors:motor",
"//motors:util",
"//motors/core",
"//motors/peripheral:adc",
"//motors/peripheral:can",
"//motors/print:usb",
],
)
cc_binary(
name = "fet12v2.elf",
srcs = [
"current_equalization.h",
"fet12v2.cc",
],
restricted_to = mcu_cpus,
deps = [
":motor_controls",
"//motors:motor",
"//motors:util",
"//motors/core",
"//motors/peripheral:adc",
"//motors/peripheral:adc_dma",
"//motors/peripheral:can",
"//motors/print:uart",
],
)
hex_from_elf(
name = "fet12",
restricted_to = mcu_cpus,
)
cc_binary(
name = "power_wheels.elf",
srcs = [
"power_wheels.cc",
],
restricted_to = mcu_cpus,
deps = [
"//motors:util",
"//motors/core",
"//motors/peripheral:adc",
"//motors/usb",
"//motors/usb:cdc",
],
)
hex_from_elf(
name = "power_wheels",
restricted_to = mcu_cpus,
)
cc_library(
name = "motor_controls",
srcs = [
"motor_controls.cc",
],
hdrs = [
"motor_controls.h",
],
restricted_to = mcu_cpus,
deps = [
"//motors:math",
"//motors:motor",
"//motors/peripheral:configuration",
"//third_party/eigen",
],
)
py_library(
name = "calib_sensors",
srcs = [
"calib_sensors.py",
],
data = [
"@python_repo//:scipy",
],
)
py_binary(
name = "current_equalize",
srcs = [
"current_equalize.py",
],
data = [
":calib_sensors",
"@python_repo//:scipy",
],
)
genrule(
name = "gen_current_equalization",
srcs = [
"calib_data_6030.csv",
"calib_data_60a.csv",
"calib_data_60b.csv",
"calib_data_60c.csv",
],
outs = ["current_equalization.h"],
cmd = "./$(location current_equalize) $(location calib_data_60a.csv) $(location calib_data_60b.csv) $(location calib_data_60c.csv) $(location calib_data_6030.csv) > \"$@\"",
restricted_to = mcu_cpus,
tools = ["current_equalize"],
)