diff options
author | 2021-12-29 18:32:38 +0000 | |
---|---|---|
committer | 2021-12-31 17:23:19 +0000 | |
commit | 2f0593ea25023e992acd6e6629ba3727222bee99 (patch) | |
tree | 5aa0a85306f3cca97b53470dd02725ca8413e53d /src/peripheral/mod.rs | |
parent | 9631347812a536f00f00c6698b8da2af98237ce6 (diff) | |
download | cortex-m-2f0593ea25023e992acd6e6629ba3727222bee99.tar.gz cortex-m-2f0593ea25023e992acd6e6629ba3727222bee99.tar.zst cortex-m-2f0593ea25023e992acd6e6629ba3727222bee99.zip |
Merge #369
369: Switch "native" check from being x86_64 only to checking `HOST` r=adamgreig a=TDHolmes
If `HOST==TARGET`, we know we're compiling natively. Set a new `rustc` cfg for this and use it where we previously checked for `x86_64`.
I was trying to run tests on my M1 MacBook Pro and couldn't since it isn't `x86_64`. Also, the currently configured nightly compiler for asm doesn't have M1 support, so I updated that. I'm fine reverting that change though, I can just do that locally, but I'm sure others will hit the same issue and it's a bit old...
Co-authored-by: Tyler Holmes <tyler@holmesengineering.com>
Diffstat (limited to 'src/peripheral/mod.rs')
-rw-r--r-- | src/peripheral/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/peripheral/mod.rs b/src/peripheral/mod.rs index 5c5e7ce..3756553 100644 --- a/src/peripheral/mod.rs +++ b/src/peripheral/mod.rs @@ -71,8 +71,8 @@ pub mod dcb; pub mod dwt; #[cfg(not(armv6m))] pub mod fpb; -// NOTE(target_arch) is for documentation purposes -#[cfg(any(has_fpu, target_arch = "x86_64"))] +// NOTE(native) is for documentation purposes +#[cfg(any(has_fpu, native))] pub mod fpu; pub mod icb; #[cfg(all(not(armv6m), not(armv8m_base)))] @@ -405,7 +405,7 @@ pub struct FPU { unsafe impl Send for FPU {} -#[cfg(any(has_fpu, target_arch = "x86_64"))] +#[cfg(any(has_fpu, native))] impl FPU { /// Pointer to the register block pub const PTR: *const fpu::RegisterBlock = 0xE000_EF30 as *const _; @@ -417,7 +417,7 @@ impl FPU { } } -#[cfg(any(has_fpu, target_arch = "x86_64"))] +#[cfg(any(has_fpu, native))] impl ops::Deref for FPU { type Target = self::fpu::RegisterBlock; |