Merge pull request #1644 from embassy-rs/remove-atompoly

Remove trivial to remove uses of atomic-polyfill.
This commit is contained in:
Dario Nieuwenhuis 2023-07-12 16:35:00 +00:00 committed by GitHub
commit d979841f17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 12 additions and 19 deletions

View File

@ -1,10 +1,9 @@
use core::future::Future; use core::future::Future;
use core::marker::PhantomData; use core::marker::PhantomData;
use core::pin::Pin; use core::pin::Pin;
use core::sync::atomic::{fence, Ordering}; use core::sync::atomic::{fence, AtomicUsize, Ordering};
use core::task::{Context, Poll, Waker}; use core::task::{Context, Poll, Waker};
use atomic_polyfill::AtomicUsize;
use embassy_hal_common::{into_ref, Peripheral, PeripheralRef}; use embassy_hal_common::{into_ref, Peripheral, PeripheralRef};
use embassy_sync::waitqueue::AtomicWaker; use embassy_sync::waitqueue::AtomicWaker;

View File

@ -1,6 +1,6 @@
use core::marker::PhantomData; use core::marker::PhantomData;
use core::sync::atomic::{fence, Ordering};
use atomic_polyfill::{fence, Ordering};
use embassy_hal_common::drop::OnDrop; use embassy_hal_common::drop::OnDrop;
use embassy_hal_common::into_ref; use embassy_hal_common::into_ref;
use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;

View File

@ -1,6 +1,6 @@
use core::marker::PhantomData; use core::marker::PhantomData;
use core::sync::atomic::{fence, Ordering};
use atomic_polyfill::{fence, Ordering};
use embassy_hal_common::drop::OnDrop; use embassy_hal_common::drop::OnDrop;
use embassy_hal_common::{into_ref, PeripheralRef}; use embassy_hal_common::{into_ref, PeripheralRef};
use stm32_metapac::FLASH_BASE; use stm32_metapac::FLASH_BASE;

View File

@ -1,7 +1,6 @@
use core::convert::TryInto; use core::convert::TryInto;
use core::ptr::write_volatile; use core::ptr::write_volatile;
use core::sync::atomic::{fence, Ordering};
use atomic_polyfill::{fence, Ordering};
use super::{FlashRegion, FlashSector, FLASH_REGIONS, WRITE_SIZE}; use super::{FlashRegion, FlashSector, FLASH_REGIONS, WRITE_SIZE};
use crate::flash::Error; use crate::flash::Error;

View File

@ -1,7 +1,6 @@
use core::convert::TryInto; use core::convert::TryInto;
use core::ptr::write_volatile; use core::ptr::write_volatile;
use core::sync::atomic::{fence, Ordering};
use atomic_polyfill::{fence, Ordering};
use super::{FlashRegion, FlashSector, FLASH_REGIONS, WRITE_SIZE}; use super::{FlashRegion, FlashSector, FLASH_REGIONS, WRITE_SIZE};
use crate::flash::Error; use crate::flash::Error;

View File

@ -1,8 +1,7 @@
use core::convert::TryInto; use core::convert::TryInto;
use core::ptr::write_volatile; use core::ptr::write_volatile;
use core::sync::atomic::{fence, Ordering}; use core::sync::atomic::{fence, AtomicBool, Ordering};
use atomic_polyfill::AtomicBool;
use embassy_sync::waitqueue::AtomicWaker; use embassy_sync::waitqueue::AtomicWaker;
use pac::flash::regs::Sr; use pac::flash::regs::Sr;
use pac::FLASH_SIZE; use pac::FLASH_SIZE;

View File

@ -1,7 +1,6 @@
use core::convert::TryInto; use core::convert::TryInto;
use core::ptr::write_volatile; use core::ptr::write_volatile;
use core::sync::atomic::{fence, Ordering};
use atomic_polyfill::{fence, Ordering};
use super::{FlashRegion, FlashSector, BANK1_REGION, FLASH_REGIONS, WRITE_SIZE}; use super::{FlashRegion, FlashSector, BANK1_REGION, FLASH_REGIONS, WRITE_SIZE};
use crate::flash::Error; use crate::flash::Error;

View File

@ -1,6 +1,5 @@
use core::ptr::write_volatile; use core::ptr::write_volatile;
use core::sync::atomic::{fence, Ordering};
use atomic_polyfill::{fence, Ordering};
use super::{FlashRegion, FlashSector, FLASH_REGIONS, WRITE_SIZE}; use super::{FlashRegion, FlashSector, FLASH_REGIONS, WRITE_SIZE};
use crate::flash::Error; use crate::flash::Error;

View File

@ -1,8 +1,7 @@
use core::future::poll_fn; use core::future::poll_fn;
use core::sync::atomic::{compiler_fence, Ordering};
use core::task::Poll; use core::task::Poll;
use atomic_polyfill::{compiler_fence, Ordering};
use self::sealed::Instance; use self::sealed::Instance;
use crate::interrupt; use crate::interrupt;
use crate::interrupt::typelevel::Interrupt; use crate::interrupt::typelevel::Interrupt;

View File

@ -1,8 +1,8 @@
use core::cell::UnsafeCell; use core::cell::UnsafeCell;
use core::marker::PhantomData; use core::marker::PhantomData;
use core::sync::atomic::{AtomicBool, AtomicU16, Ordering};
use core::task::Poll; use core::task::Poll;
use atomic_polyfill::{AtomicBool, AtomicU16, Ordering};
use embassy_hal_common::{into_ref, Peripheral}; use embassy_hal_common::{into_ref, Peripheral};
use embassy_sync::waitqueue::AtomicWaker; use embassy_sync::waitqueue::AtomicWaker;
use embassy_usb_driver::{ use embassy_usb_driver::{

View File

@ -1,10 +1,10 @@
use core::sync::atomic::{AtomicU8, Ordering};
use std::cell::{RefCell, UnsafeCell}; use std::cell::{RefCell, UnsafeCell};
use std::mem::MaybeUninit; use std::mem::MaybeUninit;
use std::sync::{Condvar, Mutex, Once}; use std::sync::{Condvar, Mutex, Once};
use std::time::{Duration as StdDuration, Instant as StdInstant}; use std::time::{Duration as StdDuration, Instant as StdInstant};
use std::{mem, ptr, thread}; use std::{mem, ptr, thread};
use atomic_polyfill::{AtomicU8, Ordering};
use critical_section::Mutex as CsMutex; use critical_section::Mutex as CsMutex;
use crate::driver::{AlarmHandle, Driver}; use crate::driver::{AlarmHandle, Driver};

View File

@ -1,9 +1,9 @@
use core::sync::atomic::{AtomicU8, Ordering};
use std::cell::UnsafeCell; use std::cell::UnsafeCell;
use std::mem::MaybeUninit; use std::mem::MaybeUninit;
use std::ptr; use std::ptr;
use std::sync::{Mutex, Once}; use std::sync::{Mutex, Once};
use atomic_polyfill::{AtomicU8, Ordering};
use wasm_bindgen::prelude::*; use wasm_bindgen::prelude::*;
use wasm_timer::Instant as StdInstant; use wasm_timer::Instant as StdInstant;