diff options
author | 2021-12-15 11:27:04 -0800 | |
---|---|---|
committer | 2021-12-19 12:14:30 -0800 | |
commit | f0dc654951d7aa7910b662c4da61c06bab671729 (patch) | |
tree | 8075ec8495503d9d0e1a21266c10a61bcb9ad91c /src/peripheral/mod.rs | |
parent | 441cb87e4095eafbd8b170d8f0848b99fa1ec72e (diff) | |
download | cortex-m-f0dc654951d7aa7910b662c4da61c06bab671729.tar.gz cortex-m-f0dc654951d7aa7910b662c4da61c06bab671729.tar.zst cortex-m-f0dc654951d7aa7910b662c4da61c06bab671729.zip |
Switch "native" check from being x86_64 only to checking `HOST`
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`.
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 081aa0a..d1e119f 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)))] @@ -411,7 +411,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 _; @@ -423,7 +423,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; |