Skip to content

Commit

Permalink
Remove atomic-polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
Finomnis committed Dec 1, 2023
1 parent 28aca52 commit f224c61
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
1 change: 0 additions & 1 deletion rtic-time/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ license = "MIT OR Apache-2.0"
critical-section = "1"
futures-util = { version = "0.3.25", default-features = false }
rtic-common = { version = "1.0.0", path = "../rtic-common" }
atomic-polyfill = "1"

[dev-dependencies]
embedded-hal = { version = "1.0.0-rc.2" }
Expand Down
17 changes: 12 additions & 5 deletions rtic-time/src/half_period_counter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
//! ```
//!
use atomic_polyfill::{compiler_fence, AtomicU16, AtomicU32, AtomicU64, AtomicU8, Ordering};
use core::sync::atomic::{compiler_fence, Ordering};

/// A half period overflow counter.
pub trait HalfPeriods {
Expand All @@ -134,10 +134,17 @@ macro_rules! impl_half_periods {
}
};
}
impl_half_periods!(AtomicU8, u8);
impl_half_periods!(AtomicU16, u16);
impl_half_periods!(AtomicU32, u32);
impl_half_periods!(AtomicU64, u64);

#[cfg(target_has_atomic = "8")]
impl_half_periods!(core::sync::atomic::AtomicU8, u8);
#[cfg(target_has_atomic = "16")]
impl_half_periods!(core::sync::atomic::AtomicU16, u16);
#[cfg(target_has_atomic = "32")]
impl_half_periods!(core::sync::atomic::AtomicU32, u32);
#[cfg(target_has_atomic = "64")]
impl_half_periods!(core::sync::atomic::AtomicU64, u64);
#[cfg(target_has_atomic = "128")]
impl_half_periods!(core::sync::atomic::AtomicU128, u128);

/// The value of the timer's count register.
pub trait TimerValue {
Expand Down
2 changes: 1 addition & 1 deletion rtic-time/tests/half_period_time_counter.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use atomic_polyfill::{AtomicU16, AtomicU32, Ordering};
use core::sync::atomic::{AtomicU16, AtomicU32, Ordering};
use rtic_time::half_period_counter::calculate_now;

macro_rules! do_test_u8 {
Expand Down

0 comments on commit f224c61

Please sign in to comment.