Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions build-internals/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,11 @@ pub const Chip = struct {
/// Use the provided file directly as the chip file.
zig: LazyPath,

/// Path to embassy stm32-data directory
embassy: LazyPath,
/// Path to embassy stm32-data directory with optional device filter
embassy: struct {
path: LazyPath,
device: ?[]const u8 = null,
},

/// Single device from TI targetdb
targetdb: struct {
Expand Down
9 changes: 7 additions & 2 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ pub fn MicroBuild(port_select: PortSelect) type {
regz_run.addFileArg(file);
break :blk chips_dir.path(b, b.fmt("{s}.zig", .{target.chip.name}));
},
.embassy => |path| blk: {
.embassy => |embassy| blk: {
const regz_run = b.addRunArtifact(regz_exe);

regz_run.addArg("--format");
Expand All @@ -430,7 +430,12 @@ pub fn MicroBuild(port_select: PortSelect) type {
regz_run.addFileArg(patch_file);
}

regz_run.addDirectoryArg(path);
if (embassy.device) |device| {
regz_run.addArg("--device");
regz_run.addArg(device);
}

regz_run.addDirectoryArg(embassy.path);
break :blk chips_dir.path(b, b.fmt("{s}.zig", .{target.chip.name}));
},
.targetdb => |targetdb| blk: {
Expand Down
Loading
Loading