Closed r4gus closed 2 years ago
Hi, regz creates the following Zig code from ATSAME51J20A.svd:
// ... more code /// Port Module pub const PORT = struct { pub const base_address = 0x41008000; pub const version = "U22102.2.0"; pub const GROUP = @ptrCast(*volatile [2]packed struct { // ... }, base_address + 0x0); };
This leads to the following error:
.\libs\microzig\src\modules\chips\atsame51j20a\registers.zig:10953:12: error: expected pointer, found 'comptime_int' }, base_address + 0x0); ^
I fixed it by initializing base_address with @intToPtr([*]u8, 0x41008000):
base_address
@intToPtr([*]u8, 0x41008000)
// ... more code /// Port Module pub const PORT = struct { pub const base_address = @intToPtr([*]u8, 0x41008000); pub const version = "U22102.2.0"; pub const GROUP = @ptrCast(*volatile [2]packed struct { // ... }, base_address); };
zig: 0.10.0-dev.3445+18440cb23 regz: main (last commit is 4b04e50cf14a3df87662dc79863e9b7e3dfc6591)
0.10.0-dev.3445+18440cb23
main
4b04e50cf14a3df87662dc79863e9b7e3dfc6591
Hi, regz creates the following Zig code from ATSAME51J20A.svd:
This leads to the following error:
I fixed it by initializing
base_address
with@intToPtr([*]u8, 0x41008000)
:zig:
0.10.0-dev.3445+18440cb23
regz:main
(last commit is4b04e50cf14a3df87662dc79863e9b7e3dfc6591
)