blob: 3dbae6d0607ffc405bb4f322f9a2bbcbf772c663 [file] [log] [blame]
Ravago Jones281800e2023-02-13 02:24:07 -08001load("//third_party/pico-sdk:hex.bzl", "pioasm", "uf2_from_elf")
Austin Schuh0a96ea32022-01-01 22:29:30 -08002
3# TODO(austin): We should be able to either push the linker script into the crosstool, or wrap this in a macro.
4cc_binary(
5 name = "blink.elf",
6 srcs = [
7 "blink.c",
8 "//third_party/pico-sdk/src/rp2_common/boot_stage2:bs2_default_padded_checksummed.S",
9 ],
10 additional_linker_inputs = [
11 "//third_party/pico-sdk:src/rp2_common/pico_standard_link/memmap_default.ld",
12 ],
13 linkopts = [
14 "-Wl,--script=third_party/pico-sdk/src/rp2_common/pico_standard_link/memmap_default.ld",
15 ],
16 target_compatible_with = [
17 "@platforms//os:none",
18 "//tools/platforms/hardware:cortex_m0plus",
19 ],
20 deps = ["//third_party/pico-sdk"],
21)
22
23uf2_from_elf(
24 name = "blink",
25)
Ravago Jones281800e2023-02-13 02:24:07 -080026
27pioasm(
28 name = "quadrature_encoder",
29 src = "quadrature_encoder.pio",
30 out = "quadrature_encoder.pio.h",
31)
32
33# TODO(austin): We should be able to either push the linker script into the crosstool, or wrap this in a macro.
34cc_binary(
35 name = "ADIS16505.elf",
36 srcs = [
37 "ADIS16505.cc",
38 "quadrature_encoder.pio.h",
39 "//third_party/pico-sdk/src/rp2_common/boot_stage2:bs2_default_padded_checksummed.S",
40 ],
41 additional_linker_inputs = [
42 "//third_party/pico-sdk:src/rp2_common/pico_standard_link/memmap_default.ld",
43 ],
44 copts = [
45 "-Wno-unused-parameter",
46 "-Wno-unused-variable",
47 "-Wno-double-promotion",
48 "-Wno-format",
49 "-Wno-unused-function",
50 ],
51 includes = ["."],
52 linkopts = [
53 "-Wl,--script=third_party/pico-sdk/src/rp2_common/pico_standard_link/memmap_default.ld",
54 ],
55 target_compatible_with = [
56 "@platforms//os:none",
57 "//tools/platforms/hardware:cortex_m0plus",
58 ],
59 deps = ["//third_party/pico-sdk"],
60)
61
62uf2_from_elf(
63 name = "ADIS16505",
64)