8
8
9
9
mod errata;
10
10
11
- use crate :: {
12
- clocks:: { Clocks , ExternalOscillator } ,
13
- target:: USBD ,
14
- } ;
11
+ use crate :: target:: USBD ;
15
12
use core:: sync:: atomic:: { compiler_fence, Ordering } ;
16
13
use core:: { cell:: Cell , mem, ptr, slice} ;
17
14
use cortex_m:: interrupt:: { self , Mutex } ;
@@ -53,7 +50,7 @@ impl Buffers {
53
50
unsafe impl Sync for Buffers { }
54
51
55
52
/// USB device implementation.
56
- pub struct Usbd < ' c > {
53
+ pub struct Usbd {
57
54
periph : Mutex < USBD > ,
58
55
// argument passed to `UsbDeviceBuilder.max_packet_size_0`
59
56
max_packet_size_0 : u16 ,
@@ -70,12 +67,9 @@ pub struct Usbd<'c> {
70
67
/// is finished (or at least DMA from the buffer has finished). While the bit is 1, `write`
71
68
/// returns `WouldBlock`.
72
69
in_bufs_in_use : Mutex < Cell < u16 > > ,
73
-
74
- // used to freeze `Clocks` and ensure they remain in the `ExternalOscillator` state
75
- _clocks : & ' c ( ) ,
76
70
}
77
71
78
- impl < ' c > Usbd < ' c > {
72
+ impl Usbd {
79
73
/// Creates a new USB bus, taking ownership of the raw peripheral.
80
74
///
81
75
/// # Parameters
@@ -85,11 +79,7 @@ impl<'c> Usbd<'c> {
85
79
/// needs to be big enough to accomodate all buffers of all endpoints, or
86
80
/// `alloc_ep` will fail.
87
81
#[ 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 > {
93
83
UsbBusAllocator :: new ( Self {
94
84
periph : Mutex :: new ( periph) ,
95
85
max_packet_size_0 : 0 ,
@@ -100,7 +90,6 @@ impl<'c> Usbd<'c> {
100
90
iso_in_used : false ,
101
91
iso_out_used : false ,
102
92
in_bufs_in_use : Mutex :: new ( Cell :: new ( 0 ) ) ,
103
- _clocks : & ( ) ,
104
93
} )
105
94
}
106
95
@@ -193,7 +182,7 @@ impl<'c> Usbd<'c> {
193
182
}
194
183
}
195
184
196
- impl UsbBus for Usbd < ' _ > {
185
+ impl UsbBus for Usbd {
197
186
fn alloc_ep (
198
187
& mut self ,
199
188
ep_dir : UsbDirection ,
0 commit comments