ZigEmbeddedGroup / regz

Generate zig code from ATDF or SVD files for microcontrollers.
MIT License
82 stars 29 forks source link

removing some used "unused" variables #55

Closed freiguy1 closed 1 year ago

freiguy1 commented 1 year ago

On the newest version of the zig compiler, it doesn't like params which are used looking like unused variables. I was getting

/dev/git/regz/src/svd.zig:427:13: error: pointless discard of function parameter
        _ = arena;
            ^~~~~
/dev/git/regz/src/svd.zig:431:55: note: used here
            .reset_mask = try xml.parseIntForKey(u64, arena.child_allocator, nodes, "resetMask"),
                                                      ^~~~~
/dev/git/regz/src/Database.zig:1707:9: error: pointless discard of function parameter
    _ = db;
        ^~
/home/freied/dev/git/regz/src/Database.zig:1731:14: note: used here
        for (db.fields.items) |field, i|
             ^~
error: regz...
d-mironov commented 1 year ago

Just fixed it and saw your pull request xD

freiguy1 commented 1 year ago

Just fixed it and saw your pull request xD

Ha, sorry! I thought I'd be in your place. Hey, I saw your post on reddit. Glad you're checking out some of ZEG's stuff. They also have some generic HAL stuff which you can implement for your chip/board in their microzig project.

Lastly, sorry for the digression, but there's a new post on zig news which talks about how they got UART working with an "unsupported" uC using microzig. Using that as a template, you could probably get gpio working as well!

d-mironov commented 1 year ago

Just fixed it and saw your pull request xD

Ha, sorry! I thought I'd be in your place. Hey, I saw your post on reddit. Glad you're checking out some of ZEG's stuff. They also have some generic HAL stuff which you can implement for your chip/board in their microzig project.

Lastly, sorry for the digression, but there's a new post on zig news which talks about how they got UART working with an "unsupported" uC using microzig. Using that as a template, you could probably get gpio working as well!

Yeah. I read some of the comments on the Reddit post and will rewrite my "HAL" with regz for STM32. Did not know that this existed and wanted to write my own svd2zig.
I definitely will try and create an STM32 HAL to work with microzig :D

mattnite commented 1 year ago

🙏