Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support architectures without atomics with polyfill #115

Merged
merged 7 commits into from
Apr 25, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ authors = ["Matti Virkkunen <[email protected]>"]
repository = "https://github.com/mvirkkunen/usb-device"

[dependencies]
atomic-polyfill = "1.0.2"
defmt = { version = "0.3", optional = true }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion src/bus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ use crate::endpoint::{
IsochronousUsageType,
};
use crate::{Result, UsbDirection, UsbError};
use atomic_polyfill::{AtomicPtr, Ordering};
use core::cell::RefCell;
use core::mem;
use core::ptr;
use core::sync::atomic::{AtomicPtr, Ordering};

/// A trait for device-specific USB peripherals. Implement this to add support for a new hardware
/// platform.
Expand Down
2 changes: 1 addition & 1 deletion src/endpoint.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::bus::UsbBus;
use crate::{Result, UsbDirection};
use atomic_polyfill::{AtomicPtr, Ordering};
use core::marker::PhantomData;
use core::sync::atomic::{AtomicPtr, Ordering};

/// Trait for endpoint type markers.
pub trait EndpointDirection {
Expand Down