File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
src/r3_support_rp2040/src Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ impl usb_device::bus::UsbBus for UsbBus {
152
152
. set ( EP_BUF_CTRL_AVAIL | max_packet_size as u32 ) ;
153
153
self . ep_max_packet_size [ ep. index ( ) ] = max_packet_size;
154
154
} else {
155
- self . ep_buf_ctrl ( ep) . set ( 0 ) ;
155
+ self . ep_buf_ctrl ( ep) . set ( EP_BUF_CTRL_PID_DATA1 ) ;
156
156
}
157
157
158
158
self . ep_buffer_offset [ address_to_index ( ep) ] = buffer_offset as _ ;
@@ -214,7 +214,19 @@ impl usb_device::bus::UsbBus for UsbBus {
214
214
215
215
self . ep_in_ready . set ( 0xffff ) ;
216
216
217
- // TODO: reset other endpoints
217
+ for i in 1 ..16 {
218
+ if ( self . ep_allocation [ 0 ] & ( 1 << i) ) != 0 {
219
+ let ep = EndpointAddress :: from_parts ( i, UsbDirection :: Out ) ;
220
+ let max_packet_size = self . ep_max_packet_size [ i] ;
221
+ self . ep_buf_ctrl ( ep)
222
+ . set ( EP_BUF_CTRL_AVAIL | max_packet_size as u32 ) ;
223
+ }
224
+
225
+ if ( self . ep_allocation [ 1 ] & ( 1 << i) ) != 0 {
226
+ let ep = EndpointAddress :: from_parts ( i, UsbDirection :: In ) ;
227
+ self . ep_buf_ctrl ( ep) . set ( EP_BUF_CTRL_PID_DATA1 ) ;
228
+ }
229
+ }
218
230
}
219
231
220
232
#[ inline]
You can’t perform that action at this time.
0 commit comments