Skip to content

Commit

Permalink
Replace cortex_m::interrupt::free with critical_section::with
Browse files Browse the repository at this point in the history
  • Loading branch information
jbeaurivage committed Nov 15, 2023
1 parent a9650ef commit 167051d
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ aes = "0.7.5"
bitfield = "0.13"
bitflags = "1.2.1"
cipher = "0.3"
critical-section = "1.1.2"
cortex-m = { version = "0.7", features = ["critical-section-single-core"] }
embedded-hal = "0.2"
fugit = "0.3"
Expand All @@ -54,7 +55,7 @@ void = {version = "1.0", default-features = false}
#===============================================================================

cortex-m-interrupt = {version = "0.2.1-git", git = "https://github.com/datdenkikniet/cortex-m-interrupt.git", rev = "9baa936", optional = true}
embassy-sync = {version = "0.3", optional = true}
embassy-sync = {version = "0.4", optional = true}
embedded-hal-alpha = {package = "embedded-hal", version = "1.0.0-rc.1"}
embedded-hal-async = {version = "1.0.0-rc.1", optional = true, features = ["defmt-03"]}
embedded-sdmmc = {version = "0.3", optional = true}
Expand Down
2 changes: 1 addition & 1 deletion hal/src/async_hal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//
// pub mod interrupt {
// pub use super::irqs::*;
// pub use cortex_m::interrupt::{CriticalSection, Mutex};
// pub use critical_section::{CriticalSection, Mutex};
// pub use embassy::interrupt::{declare, take, Interrupt};
//
// #[cfg(any(feature = "samd11", feature = "samd21"))]
Expand Down
2 changes: 1 addition & 1 deletion hal/src/dmac/async_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ mod impls {
// it was before this function ran.
let dmac = unsafe { crate::pac::Peripherals::steal().DMAC };

cortex_m::interrupt::free(|_| {
critical_section::with(|_| {
let old_id = dmac.chid.read().id().bits();
let pending_interrupts = BitIter(dmac.intstatus.read().bits());

Expand Down
2 changes: 1 addition & 1 deletion hal/src/thumbv6m/usb/bus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ use crate::usb::devicedesc::DeviceDescBank;
use core::cell::{Ref, RefCell, RefMut};
use core::marker::PhantomData;
use core::mem;
use cortex_m::interrupt::{free as disable_interrupts, Mutex};
use cortex_m::singleton;
use critical_section::{with as disable_interrupts, Mutex};
use usb_device::bus::PollResult;
use usb_device::endpoint::{EndpointAddress, EndpointType};
use usb_device::{Result as UsbResult, UsbDirection, UsbError};
Expand Down
2 changes: 1 addition & 1 deletion hal/src/thumbv7em/usb/bus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ use crate::usb::devicedesc::DeviceDescBank;
use core::cell::{Ref, RefCell, RefMut};
use core::marker::PhantomData;
use core::mem;
use cortex_m::interrupt::{free as disable_interrupts, Mutex};
use cortex_m::singleton;
use critical_section::{with as disable_interrupts, Mutex};
use usb_device::bus::PollResult;
use usb_device::endpoint::{EndpointAddress, EndpointType};
use usb_device::{Result as UsbResult, UsbDirection, UsbError};
Expand Down

0 comments on commit 167051d

Please sign in to comment.