update readme (#12)

wch-ch32v003
Matt Knight 1 year ago committed by Matt Knight
parent 6a4d593020
commit 5893535f03

@ -9,14 +9,22 @@ See https://github.com/microsoft/uf2#file-containers for how we're going to embe
For use in a build.zig: For use in a build.zig:
```zig ```zig
const uf2 = @import("uf2");
pub fn build(b: *Build) void { pub fn build(b: *Build) void {
// ... // ...
const uf2_file = uf2.from_elf(b, exe, .{ .family_id = .RP2040 }); const uf2_dep = b.dependency("uf2", .{});
b.installFile(uf2_file_source);
// ... const elf2uf2_run = b.addRunArtifact(uf2_dep.artifact("elf2uf2"));
// family id
elf2uf2_run.addArgs(&.{"--family-id", "RP2040"});
// elf file
elf2uf2_run.addArg("--elf-path");
elf2uf2_run.addArtifactArg(exe.inner);
// output file
const uf2_file = elf2uf2_run.addPrefixedOutputFileArg("--output-path", "test.uf2");
b.addInstallFile(uf2_file, "bin/test.uf2");
} }
``` ```

Loading…
Cancel
Save