rust-embedded / svd2rust

Generate Rust register maps (`struct`s) from SVD files
Apache License 2.0
687 stars 149 forks source link

fix field derive in same register #628

Closed burrbull closed 2 years ago

burrbull commented 2 years ago

Fixes #625

rust-highfive commented 2 years ago

r? @therealprof

(rust-highfive has picked a reviewer for you, use r? to override)

burrbull commented 2 years ago

сс @qwandor Can you make fixed link to SVDs to add them to CI?

qwandor commented 2 years ago

I'm not quite sure what you mean by that, what exactly do you want me to do? The SVD files in https://github.com/gd32-rust/gd32-rs are extensively patched with svdtools before running them through svd2rust. The file I linked in #625 is with the patches applied.

burrbull commented 2 years ago

what exactly do you want me to do

Just don't delete this file.

Emilgardis commented 2 years ago

if it's troublesome to host it, we can upload it as a gist if we're allowed

qwandor commented 2 years ago

Okay, I'll keep it up there for now, and let you know if anything changes.

burrbull commented 2 years ago

@qwandor There is still remains 16 broken fields with too complicate derive paths. I'm not sure I'm able to solve this without full rewrite of derive path resolving (#623). There is 2 fast ways for you: downgrade to 0.23.1 which generates separate structs for each field or make derive paths of those fields shorter without cross-peripheral dependencies.

qwandor commented 2 years ago

Is there an advantage of 0.23.1 over 0.24.0 here?

burrbull commented 2 years ago

Is there an advantage of 0.23.1 over 0.24.0 here?

No advantage, but 0.24.0 is broken and generates incorrect code in some cases.

burrbull commented 2 years ago

Close in favor of #631