Skip to content

Commit

Permalink
UF2 builds and passes tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mattnite committed Jan 20, 2025
1 parent 41b3409 commit da26318
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tools/uf2/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub fn build(b: *std.Build) void {
const gen = b.addExecutable(.{
.name = "gen",
.root_source_file = b.path("src/gen.zig"),
.target = b.host,
.target = b.graph.host,
});
const gen_run_step = b.addRunArtifact(gen);
const gen_step = b.step("gen", "Generate family id enum");
Expand All @@ -66,7 +66,7 @@ pub fn build(b: *std.Build) void {
const example = b.addExecutable(.{
.name = "example",
.root_source_file = b.path("src/example.zig"),
.target = b.host,
.target = b.graph.host,
});
b.installArtifact(example);
}
2 changes: 1 addition & 1 deletion tools/uf2/src/elf2uf2.zig
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub fn main() !void {
else
std.meta.stringToEnum(uf2.FamilyId, family_id_str) orelse {
std.log.err("invalid family id: {s}, valid family names are:", .{family_id_str});
inline for (@typeInfo(uf2.FamilyId).Enum.fields) |field|
inline for (@typeInfo(uf2.FamilyId).@"enum".fields) |field|
std.log.err(" - {s}", .{field.name});

return error.InvalidFamilyId;
Expand Down
2 changes: 1 addition & 1 deletion tools/uf2/src/uf2.zig
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ test "Block loopback" {
var buf: [512]u8 = undefined;
var fbs = std.io.fixedBufferStream(&buf);

var prng = std.rand.DefaultPrng.init(0xf163bfab);
var prng = std.Random.DefaultPrng.init(0xf163bfab);
var rand = prng.random();
var expected = Block{
.flags = @as(Flags, @bitCast(rand.int(u32))),
Expand Down

0 comments on commit da26318

Please sign in to comment.