Skip to content

Commit 4183e1d

Browse files
Revert "demand a Clocks token"
This reverts commit 9160767.
1 parent a7811a4 commit 4183e1d

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

nrf-hal-common/src/usbd/mod.rs

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@
88
99
mod errata;
1010

11-
use crate::{
12-
clocks::{Clocks, ExternalOscillator},
13-
target::USBD,
14-
};
11+
use crate::target::USBD;
1512
use core::sync::atomic::{compiler_fence, Ordering};
1613
use core::{cell::Cell, mem, ptr, slice};
1714
use cortex_m::interrupt::{self, Mutex};
@@ -53,7 +50,7 @@ impl Buffers {
5350
unsafe impl Sync for Buffers {}
5451

5552
/// USB device implementation.
56-
pub struct Usbd<'c> {
53+
pub struct Usbd {
5754
periph: Mutex<USBD>,
5855
// argument passed to `UsbDeviceBuilder.max_packet_size_0`
5956
max_packet_size_0: u16,
@@ -70,12 +67,9 @@ pub struct Usbd<'c> {
7067
/// is finished (or at least DMA from the buffer has finished). While the bit is 1, `write`
7168
/// returns `WouldBlock`.
7269
in_bufs_in_use: Mutex<Cell<u16>>,
73-
74-
// used to freeze `Clocks` and ensure they remain in the `ExternalOscillator` state
75-
_clocks: &'c (),
7670
}
7771

78-
impl<'c> Usbd<'c> {
72+
impl Usbd {
7973
/// Creates a new USB bus, taking ownership of the raw peripheral.
8074
///
8175
/// # Parameters
@@ -85,11 +79,7 @@ impl<'c> Usbd<'c> {
8579
/// needs to be big enough to accomodate all buffers of all endpoints, or
8680
/// `alloc_ep` will fail.
8781
#[inline]
88-
pub fn new_alloc<L, LSTAT>(
89-
periph: USBD,
90-
endpoint_buffers: &'static mut [u8],
91-
_clocks: &'c Clocks<ExternalOscillator, L, LSTAT>,
92-
) -> UsbBusAllocator<Self> {
82+
pub fn new_alloc(periph: USBD, endpoint_buffers: &'static mut [u8]) -> UsbBusAllocator<Self> {
9383
UsbBusAllocator::new(Self {
9484
periph: Mutex::new(periph),
9585
max_packet_size_0: 0,
@@ -100,7 +90,6 @@ impl<'c> Usbd<'c> {
10090
iso_in_used: false,
10191
iso_out_used: false,
10292
in_bufs_in_use: Mutex::new(Cell::new(0)),
103-
_clocks: &(),
10493
})
10594
}
10695

@@ -193,7 +182,7 @@ impl<'c> Usbd<'c> {
193182
}
194183
}
195184

196-
impl UsbBus for Usbd<'_> {
185+
impl UsbBus for Usbd {
197186
fn alloc_ep(
198187
&mut self,
199188
ep_dir: UsbDirection,

0 commit comments

Comments
 (0)