Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to master #395

Merged
merged 8 commits into from
Feb 26, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
[
espressif/esp,
gigadevice/gd32,
microchip/avr,
#microchip/avr,
microchip/atsam,
nordic/nrf5x,
nxp/lpc,
Expand Down
4 changes: 2 additions & 2 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

// used for creating package tarballs
.boxzer = .{
.url = "git+https://github.com/mattnite/boxzer.git#99ae59d04cff8321e3bfcdf392a177cb75a1181c",
.hash = "12205fc4565cb5f6e1b93ae7076b1e2d49644392d525d8bd2dd6af860e7d3e3a825d",
.url = "git+https://github.com/mattnite/boxzer.git#59da7d6bcbecb8cb7e76236ea9d18a7a6bcb4d00",
.hash = "1220457e3991f346f2eb4c7adfc1fcd60d71b10a127468949dd91e924e1ec44956f1",
},
},
.paths = .{
Expand Down
4 changes: 2 additions & 2 deletions core/src/mmio.zig
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ pub fn Mmio(comptime PackedT: type) type {
inline fn toggle_field(val: anytype, comptime field_name: []const u8, value: anytype) void {
const FieldType = @TypeOf(@field(val, field_name));
switch (@typeInfo(FieldType)) {
.Int => {
.int => {
@field(val, field_name) = @field(val, field_name) ^ value;
},
.Enum => |enum_info| {
.@"enum" => |enum_info| {
// same as for the .Int case, but casting to and from the u... tag type U of the enum FieldType
const U = enum_info.tag_type;
@field(val, field_name) =
Expand Down
2 changes: 1 addition & 1 deletion examples/raspberrypi/rp2xxx/src/spi_slave.zig
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const SCK_PIN = 18;
// master or slave mode.
const RX_PIN = 16;

pub const microzig_options = .{
pub const microzig_options = microzig.Options{
.log_level = .debug,
.logFn = rp2xxx.uart.logFn,
};
Expand Down
16 changes: 8 additions & 8 deletions port/stmicro/stm32/src/hals/STM32F303/pins.zig
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,16 @@ fn PinDescription(comptime spec: []const u8) type {
pub fn Pins(comptime config: GlobalConfiguration) type {
comptime {
var fields: []const StructField = &.{};
for (@typeInfo(GlobalConfiguration).Struct.fields) |port_field| {
for (@typeInfo(GlobalConfiguration).@"struct".fields) |port_field| {
if (@field(config, port_field.name)) |port_config| {
for (@typeInfo(PortConfiguration()).Struct.fields) |field| {
for (@typeInfo(PortConfiguration()).@"struct".fields) |field| {
if (@field(port_config, field.name)) |pin_config| {
const D = PinDescription(field.name);
fields = fields ++ &[_]StructField{.{
.is_comptime = false,
.name = pin_config.name orelse field.name,
.type = GPIO(D.gpio_port_id, D.gpio_pin_number_str, pin_config.mode orelse .{ .input = .floating }),
.default_value = null,
.default_value_ptr = null,
.alignment = @alignOf(field.type),
}};
}
Expand All @@ -87,7 +87,7 @@ pub fn Pins(comptime config: GlobalConfiguration) type {
}

return @Type(.{
.Struct = .{
.@"struct" = .{
.layout = .auto,
.is_tuple = false,
.fields = fields,
Expand All @@ -110,14 +110,14 @@ fn PortConfiguration() type {
.is_comptime = false,
.name = std.fmt.comptimePrint("P{c}{d}", .{ gpio_port_id, gpio_pin_number_int }),
.type = ?PinConfiguration,
.default_value = &@as(?PinConfiguration, null),
.default_value_ptr = &@as(?PinConfiguration, null),
.alignment = @alignOf(?PinConfiguration),
}};
}
}

return @Type(.{
.Struct = .{
.@"struct" = .{
.layout = .auto,
.is_tuple = false,
.fields = fields,
Expand All @@ -136,12 +136,12 @@ pub const GlobalConfiguration = struct {
pub fn apply(comptime config: @This()) Pins(config) {
const pins: Pins(config) = undefined; // Later: something seems incomplete here...

inline for (@typeInfo(@This()).Struct.fields) |port_field| {
inline for (@typeInfo(@This()).@"struct".fields) |port_field| {
const gpio_port_name = port_field.name;
if (@field(config, gpio_port_name)) |port_config| {
peripherals.RCC.AHBENR.modify_one(gpio_port_name ++ "EN", 1);

inline for (@typeInfo(PortConfiguration()).Struct.fields) |pin_field| {
inline for (@typeInfo(PortConfiguration()).@"struct".fields) |pin_field| {
if (@field(port_config, pin_field.name)) |pin_config| {
@field(pins, pin_field.name).configure(pin_config);
}
Expand Down
2 changes: 1 addition & 1 deletion port/wch/ch32v/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ pub fn init(dep: *std.Build.Dependency) Self {
.abi = .eabi,
};

const qingkev4f = .{
const qingkev4f = std.Target.Query{
.cpu_arch = .riscv32,
.cpu_model = .{ .explicit = &std.Target.riscv.cpu.generic_rv32 },
// generic_rv32 has feature I.
Expand Down
4 changes: 2 additions & 2 deletions tools/package-test/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const MicroBuild = microzig.MicroBuild(.{
.rp2xxx = true,
.gd32 = true,
.atsam = true,
.avr = true,
//.avr = true,
.nrf5x = true,
.lpc = true,
.stm32 = true,
Expand All @@ -21,7 +21,7 @@ pub fn build(b: *std.Build) void {
.{ .target = mb.ports.rp2xxx.boards.raspberrypi.pico, .name = "rp2xxx" },
.{ .target = mb.ports.gd32.boards.sipeed.longan_nano, .name = "gd32" },
.{ .target = mb.ports.atsam.chips.atsamd51j19, .name = "atsam" },
.{ .target = mb.ports.avr.boards.arduino.nano, .name = "avr" },
//.{ .target = mb.ports.avr.boards.arduino.nano, .name = "avr" },
.{ .target = mb.ports.nrf5x.boards.nordic.nrf52840_dongle, .name = "nrf5x" },
.{ .target = mb.ports.lpc.boards.mbed.lpc1768, .name = "lpc" },
.{ .target = mb.ports.stm32.boards.stm32f3discovery, .name = "stm32" },
Expand Down
4 changes: 2 additions & 2 deletions website/build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
.paths = .{"."},
.dependencies = .{
.zine = .{
.url = "git+https://github.com/kristoff-it/zine.git#cab82f550162f31266127efc04c33e4eb0abaf04",
.hash = "12209f265bb6e162e030fce17475cd45ea9dac06064ee9553c037635f2890e0b4fbc",
.url = "git+https://github.com/kristoff-it/zine.git#e59e4a933e92eb522582155f2fd765940bc33e2c",
.hash = "1220415ab2115a927a6bfb1a1a21cda2ab10f01fdae9f781af12284ea06fcf04648b",
},
},
}
Loading