rust-embedded / svd2rust

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

Enums no longer re-exported under other names #652

Closed richardeoin closed 6 months ago

richardeoin commented 2 years ago

Previously enums _A used in multiple fields were re-exported under their other names. That was removed in https://github.com/rust-embedded/svd2rust/pull/627, and since then the enums are no longer exported under their other names.

When using the generated PAC, that leads to the manual task of finding the first name and adding a manual re-export like

pub use pac::device::peripheral::FIRST_NAME_A as OTHER_NAME_A;

so that the enum can be named logically with its correct name. This is still not ideal, since the enum OTHER_NAME_A is in the local module scope, not the scope pac::device::peripheral:: where it was previously.

I would propose adding these re-exports, since for PAC users it removes the manual task of identifying the first name for an enum.