diff --git a/rtt-target/Cargo.toml b/rtt-target/Cargo.toml index 14b45fc..a2a233e 100644 --- a/rtt-target/Cargo.toml +++ b/rtt-target/Cargo.toml @@ -11,6 +11,7 @@ repository = "https://github.com/mvirkkunen/rtt-target" [dependencies] ufmt-write = "0.1.0" +atomic-polyfill = "0.1.4" # Platform specific stuff cortex-m = { version = "0.7.1", optional = true } diff --git a/rtt-target/src/print.rs b/rtt-target/src/print.rs index 0206135..a5fad48 100644 --- a/rtt-target/src/print.rs +++ b/rtt-target/src/print.rs @@ -2,7 +2,7 @@ use crate::{TerminalChannel, TerminalWriter, UpChannel}; use core::fmt::{self, Write as _}; use core::mem::MaybeUninit; use core::ptr; -use core::sync::atomic::{AtomicPtr, Ordering}; +use atomic_polyfill::{AtomicPtr, Ordering}; static CRITICAL_SECTION: AtomicPtr = AtomicPtr::new(core::ptr::null_mut()); static mut PRINT_TERMINAL: MaybeUninit = MaybeUninit::uninit(); diff --git a/rtt-target/src/rtt.rs b/rtt-target/src/rtt.rs index 95b3999..0eaf774 100644 --- a/rtt-target/src/rtt.rs +++ b/rtt-target/src/rtt.rs @@ -6,7 +6,7 @@ use crate::ChannelMode; use core::cmp::min; use core::fmt; use core::ptr; -use core::sync::atomic::{fence, AtomicUsize, Ordering::SeqCst}; +use atomic_polyfill::{fence, AtomicUsize, Ordering::SeqCst}; // Note: this is zero-initialized in the initialization macro so all zeros must be a valid value #[repr(C)]