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
16 changes: 7 additions & 9 deletions port/microchip/atmega/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,11 @@ pub fn init(dep: *std.Build.Dependency) ?Self {
pub fn build(b: *std.Build) void {
const test_step = b.step("test", "Run platform agnostic unit tests");

for ([_][]const u8{ "uart", "spi", "time" }) |name| {
const tests = b.addTest(.{
.root_module = b.createModule(.{
.root_source_file = b.path(b.fmt("src/hals/atmega328p/{s}.zig", .{name})),
.target = b.graph.host,
}),
});
test_step.dependOn(&b.addRunArtifact(tests).step);
}
const tests = b.addTest(.{
.root_module = b.createModule(.{
.root_source_file = b.path("src/hals/ATmega328P.zig"),
.target = b.graph.host,
}),
});
test_step.dependOn(&b.addRunArtifact(tests).step);
}
6 changes: 6 additions & 0 deletions port/microchip/atmega/src/hals/ATmega328P.zig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ pub const spi = @import("atmega328p/spi.zig");
pub const time = @import("atmega328p/time.zig");
pub const uart = @import("atmega328p/uart.zig");

test {
_ = spi;
_ = time;
_ = uart;
}

pub const gpio = struct {
/// The I/O registers start at this address in the data space. SBI/CBI
/// take I/O addresses, regular loads and stores take data addresses.
Expand Down
Loading