Add basic rpi2040 blink demo app
Phew, things build! Lets check in how far we got.
Change-Id: Id82e2f4c73eed6620b2b4661726f931e79a6b0c1
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/third_party/pico-sdk/hex.bzl b/third_party/pico-sdk/hex.bzl
new file mode 100644
index 0000000..5e9dfae
--- /dev/null
+++ b/third_party/pico-sdk/hex.bzl
@@ -0,0 +1,25 @@
+def bin_from_elf(name, target_compatible_with = None):
+ native.genrule(
+ name = name,
+ srcs = ["%s.elf" % name],
+ outs = ["%s.bin" % name],
+ cmd = "$(OBJCOPY) -Obinary $< $@",
+ executable = True,
+ output_to_bindir = True,
+ target_compatible_with = target_compatible_with,
+ toolchains = ["@bazel_tools//tools/cpp:current_cc_toolchain"],
+ )
+
+def uf2_from_elf(name, target_compatible_with = None):
+ native.genrule(
+ name = name,
+ srcs = ["%s.elf" % name],
+ outs = ["%s.uf2" % name],
+ cmd = "$(location //third_party/pico-sdk/tools/elf2uf2) $< $@",
+ executable = True,
+ output_to_bindir = True,
+ target_compatible_with = target_compatible_with,
+ tools = [
+ "//third_party/pico-sdk/tools/elf2uf2",
+ ],
+ )