-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sensors mission - temperature, motion orientation
* sensors mission - temperature, motion orientation
- Loading branch information
1 parent
0333d18
commit 27e89b2
Showing
22 changed files
with
1,479 additions
and
2,428 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,39 @@ | ||
pub fn build(b: *Builder) void { | ||
const arch = builtin.Arch{ .thumb = builtin.Arch.Arm32.v6m }; | ||
const environ = builtin.Abi.none; | ||
pub fn build(b: *std.build.Builder) !void { | ||
const exec_name = "main"; | ||
const mode = b.standardReleaseOptions(); | ||
const os = builtin.Os.freestanding; | ||
const main = b.option([]const u8, "main", "main file") orelse "mission0_mission_selector.zig"; | ||
const want_display = b.option(bool, "display", "graphics display for qemu") orelse false; | ||
|
||
const exe = b.addExecutable(exec_name, "mission00_mission_selector.zig"); | ||
const exe = b.addExecutable(exec_name, main); | ||
exe.install(); | ||
exe.installRaw("main.img"); | ||
exe.setBuildMode(mode); | ||
exe.setLinkerScriptPath("linker.ld"); | ||
exe.setTarget(arch, os, environ); | ||
exe.setTheTarget(try std.Target.parse(.{ | ||
.arch_os_abi = "thumb-freestanding-none", | ||
})); | ||
|
||
const run_makehex = b.addSystemCommand(&[_][]const u8{ | ||
"zig", "run", "makehex.zig", | ||
}); | ||
run_makehex.step.dependOn(&exe.step); | ||
|
||
const qemu = b.step("qemu", "run in qemu"); | ||
const run_qemu = b.addSystemCommand(&[_][]const u8{ | ||
"qemu-system-arm", | ||
"-kernel", | ||
"zig-cache/bin/main.img", | ||
"-M", | ||
"microbit", | ||
"-serial", | ||
"stdio", | ||
"-display", | ||
if (want_display) "gtk" else "xnone", | ||
}); | ||
qemu.dependOn(&run_qemu.step); | ||
run_qemu.step.dependOn(&exe.step); | ||
|
||
b.default_step.dependOn(&run_makehex.step); | ||
} | ||
|
||
const Builder = std.build.Builder; | ||
const builtin = @import("builtin"); | ||
const std = @import("std"); |
Oops, something went wrong.