Ravago Jones | 281800e | 2023-02-13 02:24:07 -0800 | [diff] [blame^] | 1 | load("//third_party/pico-sdk:hex.bzl", "pioasm", "uf2_from_elf") |
Austin Schuh | 0a96ea3 | 2022-01-01 22:29:30 -0800 | [diff] [blame] | 2 | |
| 3 | # TODO(austin): We should be able to either push the linker script into the crosstool, or wrap this in a macro. |
| 4 | cc_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 | |
| 23 | uf2_from_elf( |
| 24 | name = "blink", |
| 25 | ) |
Ravago Jones | 281800e | 2023-02-13 02:24:07 -0800 | [diff] [blame^] | 26 | |
| 27 | pioasm( |
| 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. |
| 34 | cc_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 | |
| 62 | uf2_from_elf( |
| 63 | name = "ADIS16505", |
| 64 | ) |