Initial commit

wch-ch32v003
Matt Knight 2 years ago committed by GitHub
commit 42c7a62a3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,4 @@
steps:
- group: Build
steps:
- command: zig build

2
.gitignore vendored

@ -0,0 +1,2 @@
zig-cache
zig-out

3
.gitmodules vendored

@ -0,0 +1,3 @@
[submodule "deps/microzig"]
path = deps/microzig
url = https://github.com/ZigEmbeddedGroup/microzig.git

@ -0,0 +1,19 @@
Copyright (c) 2022 <name>
This software is provided 'as-is', without any express or implied warranty. In
no event will the authors be held liable for any damages arising from the use
of this software.
Permission is granted to anyone to use this software for any purpose, including
commercial applications, and to alter it and redistribute it freely, subject to
the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim
that you wrote the original software. If you use this software in a product, an
acknowledgment in the product documentation would be appreciated but is not
required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.

@ -0,0 +1,6 @@
= Hardware Support Package Template
1. Update LICENSE file
2. Update `microzig` submodule under `deps/`
3. Add chips/boards/hals
4. Set up buildkite pipeline

@ -0,0 +1,35 @@
const std = @import("std");
const microzig = @import("deps/microzig/src/main.zig");
const boards = @import("src/boards.zig");
const chips = @import("src/chips.zig");
pub fn build(b: *std.build.Builder) void {
const optimize = b.standardOptimizeOption(.{});
inline for (@typeInfo(boards).Struct.decls) |decl| {
if (!decl.is_pub)
continue;
const exe = microzig.addEmbeddedExecutable(
b,
@field(boards, decl.name).name ++ ".minimal",
"test/programs/minimal.zig",
.{ .board = @field(boards, decl.name) },
.{ .optimize = optimize },
);
exe.install();
}
inline for (@typeInfo(chips).Struct.decls) |decl| {
if (!decl.is_pub)
continue;
const exe = microzig.addEmbeddedExecutable(
b,
@field(chips, decl.name).name ++ ".minimal",
"test/programs/minimal.zig",
.{ .chip = @field(chips, decl.name) },
.{ .optimize = optimize },
);
exe.install();
}
}

1
deps/microzig vendored

@ -0,0 +1 @@
Subproject commit 97ca5497da0f22d025e18bced9311efed088d893

@ -0,0 +1,6 @@
const std = @import("std");
const microzig = @import("../deps/microzig/src/main.zig");
fn root_dir() []const u8 {
return std.fs.path.dirname(@src().file) orelse ".";
}

@ -0,0 +1,6 @@
const std = @import("std");
const microzig = @import("../deps/microzig/src/main.zig");
fn root_dir() []const u8 {
return std.fs.path.dirname(@src().file) orelse ".";
}

@ -0,0 +1,5 @@
const micro = @import("microzig");
pub fn main() void {
// This function will contain the application logic.
}
Loading…
Cancel
Save