Skip to content

Commit 0ed201f

Browse files
committed
remove need for critical section dependency
1 parent 11c5b5a commit 0ed201f

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ vcell = "0.1"
2020
static_assertions = "1.1"
2121
fugit = "0.3.5"
2222
stm32-usbd = { version = "0.7.0", optional = true }
23-
critical-section = "1.1.2"
2423
fixed = { version = "1.28.0", optional = true }
2524

2625
[dependencies.cortex-m]

src/usb.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ unsafe impl<Dm: DmPin + Send, Dp: DpPin + Send> UsbPeripheral for Peripheral<Dm,
5656
const EP_MEMORY_ACCESS_2X16: bool = true;
5757

5858
fn enable() {
59-
critical_section::with(|_| unsafe {
59+
cortex_m::interrupt::free(|_| unsafe {
6060
let rcc_ptr = &(*RCC::ptr());
6161
USB::enable(rcc_ptr);
6262
USB::reset(rcc_ptr);

0 commit comments

Comments
 (0)