Skip to content

Incorrect usage of cm7 feature #517

Closed
@Almeida-Oco

Description

@Almeida-Oco

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 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions