@@ -139,6 +139,13 @@ impl EndpointIn {
139
139
}
140
140
}
141
141
142
+ #[ cfg( feature = "fs" ) ]
143
+ write_reg ! ( endpoint_in, ep, DIEPTSIZ , PKTCNT : 1 , XFRSIZ : buf. len( ) as u32 ) ;
144
+ #[ cfg( feature = "hs" ) ]
145
+ write_reg ! ( endpoint_in, ep, DIEPTSIZ , MCNT : 1 , PKTCNT : 1 , XFRSIZ : buf. len( ) as u32 ) ;
146
+
147
+ modify_reg ! ( endpoint_in, ep, DIEPCTL , CNAK : 1 , EPENA : 1 ) ;
148
+
142
149
match self . descriptor . ep_type {
143
150
// Isochronous endpoints must set the correct even/odd frame bit to
144
151
// correspond with the next frame's number.
@@ -150,19 +157,12 @@ impl EndpointIn {
150
157
modify_reg ! ( endpoint_in, ep, DIEPCTL , SD0PID_SEVNFRM : 1 ) ;
151
158
} else {
152
159
// Previous frame number is even, so upcoming frame is odd
153
- modify_reg ! ( endpoint_in, ep, DIEPCTL , SODDFRM_SD1PID : 1 ) ;
160
+ modify_reg ! ( endpoint_in, ep, DIEPCTL , SODDFRM : 1 ) ;
154
161
}
155
162
} ,
156
163
_ => { }
157
164
}
158
165
159
- #[ cfg( feature = "fs" ) ]
160
- write_reg ! ( endpoint_in, ep, DIEPTSIZ , PKTCNT : 1 , XFRSIZ : buf. len( ) as u32 ) ;
161
- #[ cfg( feature = "hs" ) ]
162
- write_reg ! ( endpoint_in, ep, DIEPTSIZ , MCNT : 1 , PKTCNT : 1 , XFRSIZ : buf. len( ) as u32 ) ;
163
-
164
- modify_reg ! ( endpoint_in, ep, DIEPCTL , CNAK : 1 , EPENA : 1 ) ;
165
-
166
166
fifo_write ( self . usb , self . index ( ) , buf) ;
167
167
168
168
Ok ( ( ) )
0 commit comments