diff --git a/core/src/mmio.zig b/core/src/mmio.zig index e63b7844..1353beed 100644 --- a/core/src/mmio.zig +++ b/core/src/mmio.zig @@ -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) = diff --git a/port/stmicro/stm32/src/hals/STM32F303/pins.zig b/port/stmicro/stm32/src/hals/STM32F303/pins.zig index 06a66a41..b7211f14 100644 --- a/port/stmicro/stm32/src/hals/STM32F303/pins.zig +++ b/port/stmicro/stm32/src/hals/STM32F303/pins.zig @@ -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), }}; } @@ -87,7 +87,7 @@ pub fn Pins(comptime config: GlobalConfiguration) type { } return @Type(.{ - .Struct = .{ + .@"struct" = .{ .layout = .auto, .is_tuple = false, .fields = fields, @@ -117,7 +117,7 @@ fn PortConfiguration() type { } return @Type(.{ - .Struct = .{ + .@"struct" = .{ .layout = .auto, .is_tuple = false, .fields = fields, @@ -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); } diff --git a/port/wch/ch32v/build.zig b/port/wch/ch32v/build.zig index 71374b88..33b92d41 100644 --- a/port/wch/ch32v/build.zig +++ b/port/wch/ch32v/build.zig @@ -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.