Skip to content

Commit e14c45c

Browse files
Merge #4
4: Remove clock lifetime r=Dirbaio a=jonas-schievink This isn't enforced in nrf-usbd, but instead in the HAL Co-authored-by: Jonas Schievink <[email protected]>
2 parents 2d6ca17 + 4208283 commit e14c45c

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/usbd.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ struct EP0State {
5757
}
5858

5959
/// USB device implementation.
60-
pub struct Usbd<'c, T: UsbPeripheral> {
60+
pub struct Usbd<T: UsbPeripheral> {
6161
_periph: Mutex<T>,
6262
// argument passed to `UsbDeviceBuilder.max_packet_size_0`
6363
max_packet_size_0: u16,
@@ -68,12 +68,9 @@ pub struct Usbd<'c, T: UsbPeripheral> {
6868
iso_out_used: bool,
6969
ep0_state: Mutex<Cell<EP0State>>,
7070
busy_in_endpoints: Mutex<Cell<u16>>,
71-
72-
// used to freeze `Clocks` and ensure they remain in the `ExternalOscillator` state
73-
_clocks: &'c (),
7471
}
7572

76-
impl<'c, T: UsbPeripheral> Usbd<'c, T> {
73+
impl<T: UsbPeripheral> Usbd<T> {
7774
/// Creates a new USB bus, taking ownership of the raw peripheral.
7875
///
7976
/// # Parameters
@@ -96,7 +93,6 @@ impl<'c, T: UsbPeripheral> Usbd<'c, T> {
9693
is_set_address: false,
9794
})),
9895
busy_in_endpoints: Mutex::new(Cell::new(0)),
99-
_clocks: &(),
10096
})
10197
}
10298

@@ -172,7 +168,7 @@ impl<'c, T: UsbPeripheral> Usbd<'c, T> {
172168
}
173169
}
174170

175-
impl<T: UsbPeripheral> UsbBus for Usbd<'_, T> {
171+
impl<T: UsbPeripheral> UsbBus for Usbd<T> {
176172
fn alloc_ep(
177173
&mut self,
178174
ep_dir: UsbDirection,

0 commit comments

Comments
 (0)