@@ -4,7 +4,7 @@ use core::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
4
4
use :: { Result , UsbError } ;
5
5
use utils:: AtomicMutex ;
6
6
use bus:: { UsbBusWrapper , UsbBus , PollResult } ;
7
- use endpoint:: { EndpointType , EndpointIn , EndpointOut } ;
7
+ use endpoint:: { EndpointType , EndpointIn , EndpointOut , EndpointAddress , EndpointDirection } ;
8
8
use control;
9
9
use class:: UsbClass ;
10
10
pub use device_builder:: { UsbDeviceBuilder , UsbVidPid } ;
@@ -201,20 +201,23 @@ impl<'a, B: UsbBus + 'a> UsbDevice<'a, B> {
201
201
// Pending events for other endpoints?
202
202
if ( all & !1 ) != 0 {
203
203
let mut bit = 2u16 ;
204
- for i in 1 ..( MAX_ENDPOINTS as u8 ) {
204
+ for i in 1 ..MAX_ENDPOINTS {
205
205
if ( ep_setup & bit) != 0 {
206
206
for cls in self . classes ( ) {
207
- cls. endpoint_setup ( i) ;
207
+ cls. endpoint_setup (
208
+ EndpointAddress :: from_parts ( i, EndpointDirection :: Out ) ) ;
208
209
}
209
210
} else if ( ep_out & bit) != 0 {
210
211
for cls in self . classes ( ) {
211
- cls. endpoint_out ( i) ;
212
+ cls. endpoint_out (
213
+ EndpointAddress :: from_parts ( i, EndpointDirection :: Out ) ) ;
212
214
}
213
215
}
214
216
215
217
if ( ep_in_complete & bit) != 0 {
216
218
for cls in self . classes ( ) {
217
- cls. endpoint_in_complete ( i | 0x80 ) ;
219
+ cls. endpoint_in_complete (
220
+ EndpointAddress :: from_parts ( i, EndpointDirection :: In ) ) ;
218
221
}
219
222
}
220
223
0 commit comments