diff --git a/deps/microzig b/deps/microzig index 15bc1fc..4f0d252 160000 --- a/deps/microzig +++ b/deps/microzig @@ -1 +1 @@ -Subproject commit 15bc1fc06da3b6c622a21fa438e40be247d9dee1 +Subproject commit 4f0d25220ec8f0501f8e0e9f6765689eb32faa5f diff --git a/src/hal/multicore.zig b/src/hal/multicore.zig index 76811cf..f1bcfe0 100644 --- a/src/hal/multicore.zig +++ b/src/hal/multicore.zig @@ -55,18 +55,18 @@ pub const fifo = struct { var core1_stack: [128]u32 = undefined; /// Runs `entrypoint` on the second core. -pub fn launchCore1(entrypoint: fn () void) void { +pub fn launchCore1(entrypoint: *const fn () void) void { launchCore1WithStack(entrypoint, &core1_stack); } -pub fn launchCore1WithStack(entrypoint: fn () void, stack: []u32) void { +pub fn launchCore1WithStack(entrypoint: *const fn () void, stack: []u32) void { // TODO: disable SIO interrupts - const wrapper = struct { + const wrapper = &struct { fn wrapper(_: u32, _: u32, _: u32, _: u32, entry: u32, stack_base: [*]u32) callconv(.C) void { // TODO: protect stack using MPU _ = stack_base; - @intToPtr(fn () void, entry)(); + @intToPtr(*const fn () void, entry)(); } }.wrapper; diff --git a/src/hal/pins.zig b/src/hal/pins.zig index 94f6caa..dce1c24 100644 --- a/src/hal/pins.zig +++ b/src/hal/pins.zig @@ -347,19 +347,19 @@ pub fn Pins(comptime config: GlobalConfiguration) type { // initialized below: .name = undefined, - .field_type = undefined, + .type = undefined, .alignment = undefined, }; if (pin_config.function == .SIO) { pin_field.name = pin_config.name orelse field.name; - pin_field.field_type = GPIO(@enumToInt(@field(Pin, field.name)), pin_config.direction orelse .in); + pin_field.type = GPIO(@enumToInt(@field(Pin, field.name)), pin_config.direction orelse .in); } else if (pin_config.function.isPwm()) { pin_field.name = pin_config.name orelse @tagName(pin_config.function); - pin_field.field_type = pwm.PWM(pin_config.function.pwmSlice(), pin_config.function.pwmChannel()); + pin_field.type = pwm.PWM(pin_config.function.pwmSlice(), pin_config.function.pwmChannel()); } else if (pin_config.function.isAdc()) { pin_field.name = pin_config.name orelse @tagName(pin_config.function); - pin_field.field_type = adc.Input; + pin_field.type = adc.Input; pin_field.default_value = @ptrCast(?*const anyopaque, switch (pin_config.function) { .ADC0 => &adc.Input.ain0, .ADC1 => &adc.Input.ain1, @@ -382,7 +382,7 @@ pub fn Pins(comptime config: GlobalConfiguration) type { // } // } - pin_field.alignment = @alignOf(field.field_type); + pin_field.alignment = @alignOf(field.type); fields = fields ++ &[_]StructField{pin_field}; } @@ -498,11 +498,11 @@ pub const GlobalConfiguration = struct { } else if (comptime func.isPwm()) { gpio.setFunction(gpio_num, .pwm); } else if (comptime func.isAdc()) { - gpio.setFunction(gpio_num, .@"null"); + gpio.setFunction(gpio_num, .null); } else if (comptime func.isUartTx() or func.isUartRx()) { gpio.setFunction(gpio_num, .uart); } else { - @compileError(comptime std.fmt.comptimePrint("Unimplemented pin function. Please implement setting pin function {s} for GPIO {}", .{ + @compileError(std.fmt.comptimePrint("Unimplemented pin function. Please implement setting pin function {s} for GPIO {}", .{ @tagName(func), gpio_num, })); diff --git a/src/rp2040.zig b/src/rp2040.zig index 6301bf2..d3c2e18 100644 --- a/src/rp2040.zig +++ b/src/rp2040.zig @@ -28780,8 +28780,8 @@ pub fn mmioInt(addr: usize, comptime size: usize, comptime T: type) *volatile Mm } pub const InterruptVector = extern union { - C: fn () callconv(.C) void, - Naked: fn () callconv(.Naked) void, + C: *const fn () callconv(.C) void, + Naked: *const fn () callconv(.Naked) void, // Interrupt is not supported on arm };