Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
fix build pkg (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattnite authored Jun 25, 2023
1 parent ae3e3e3 commit c2edba7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ See https://github.com/microsoft/uf2#file-containers for how we're going to embe

For use in a build.zig:

```zig
const uf2 = @import("uf2");
pub fn build(b: *Build) void {
// ...
const uf2_dep = b.dependency("uf2", .{});
const uf2_file = uf2.from_elf(uf2_dep, exe, .{ .family_id = .RP2040 });
_ = b.addInstallFile(uf2_file, "bin/test.uf2");
}
```

# Manually Executing elf2uf2

```zig
pub fn build(b: *Build) void {
// ...
Expand Down
2 changes: 1 addition & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const FileSource = std.Build.FileSource;

const uf2 = @import("src/uf2.zig");

pub fn from_elf(dep: Dependency, exe: CompileStep, opts: uf2.Options) FileSource {
pub fn from_elf(dep: *Dependency, exe: *CompileStep, opts: uf2.Options) FileSource {
std.debug.assert(!opts.bundle_source); // TODO: bundle source in UF2 File
const b = dep.builder;
const elf2uf2 = dep.artifact("elf2uf2");
Expand Down

0 comments on commit c2edba7

Please sign in to comment.