-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move generic.rs
contents to other crate
#427
Comments
I can see one disadvantage: We need to keep the generated code and this new crate in lockstep which makes development a tad more complicated. But other than that I agree in principal. Due to the impact I'm convinced this needs be covered by an RFC, though. |
I agree with @therealprof regarding more complicated development. As an alternative, we may have an option to provide register.rs on demand. For example, in stm32ral such common code exists in repository and is not touched by generator. One can update this file only if generator (svd2rust) version is changed. |
@Disasm, is having a file that is generated occasionally that much simpler than having a crate that is updated occasionally? We can have the extra crate live in this repository the same as cortex-m-rt-macros for instance, and so the git repository would always be consistent. |
@adamgreig That still adds additional complications on top of the already tedious testing procedure, a lot of changes/improvements need to be tested in the context of a HAL to make sense, e.g. binary size. Not saying it can't be done or is not worthwhile, just something to consider. |
Unfortunately, I found serious difficulty in implementing the idea. A lot of:
I apologize for disturbing you. |
We need |
Specialization doesn't cover inherent impls. This does not look implementable by any in-progress language feature. |
467: Allow unused FieldReader r=therealprof a=couchand I'm developing code that's general across AVR chips. I'd like to depend on the shared parts of Rahix/avr-device (see Rahix/avr-device#44). When compiling without any specific device feature enabled, there are no users of the `FieldReader::new` method. This PR skips the lint for this case. This is somewhat related to #427 but not exactly. Co-authored-by: Andrew Dona-Couch <hi@andrewcou.ch>
I don't see sense to built this code in each file that
svd2rust
generates.I propose to move it in new crate with will be dependency for
pac
s.It should have short name. Maybe (
pa
orra
as abbreviation ofPeripheral Access
anRegister Access
).I see only advantages, no disadvantages:
svd2rust
code, remove some tricks instm32-rs
Cargo.toml
for optionally enabling features like atomic operations (Support for atomic bitwise operations in MSP430 PAC API #407)The text was updated successfully, but these errors were encountered: