Skip to content

Incorrect usage of cm7 feature #517

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

Closed
Almeida-Oco opened this issue Mar 15, 2024 · 0 comments · Fixed by #518
Closed

Incorrect usage of cm7 feature #517

Almeida-Oco opened this issue Mar 15, 2024 · 0 comments · Fixed by #518

Comments

@Almeida-Oco
Copy link
Contributor

Almeida-Oco commented Mar 15, 2024

I believe in #352, the incorrect #[cfg(...)] was used for the cm7 feature. The cm7 feature was added but it doesn't actually activate anything because #[cfg(cm7)] instead of #[cfg(feature = "cm7")]
For example:

pub struct Peripherals {
/// Cortex-M7 TCM and cache access control.
#[cfg(cm7)]
pub AC: AC,

This is fairly easy to workaround at the moment by simply defining the cfg either by:

  1. println!("cargo:rustc-cfg=cm7")
    • in the build.rs script
  2. rustflags = [ "--cfg", "cm7"]
    • in Cargo config.toml

Maybe this behavior was changed in some Rust version and I'm not aware of it, but at least for me with the "rustc 1.78.0-nightly (f4b771bf1 2024-03-14)" version its how I described and by activating the cm7 feature it fails to compile when trying to access the AC field or module.

Fix is very simply, just replacing #[cfg(cm7)] -> #[cfg(feature = "cm7")], I can open PR for it, would just need to figure out what's the PR process here :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant