@@ -119,7 +119,6 @@ func handleEndpointRx(ep uint32) []byte {
119
119
120
120
// AckUsbOutTransfer is called to acknowledge the completion of a USB OUT transfer.
121
121
func AckUsbOutTransfer (ep uint32 ) {
122
- ep = ep & 0x7F
123
122
setOutEPDataPID (ep , ! outEpXdata0 [ep ])
124
123
}
125
124
@@ -131,7 +130,7 @@ func setInEPDataPID(ep uint32, dataOne usbPID) {
131
130
_usbDPSRAM .EPxBufferControl [ep ].In .SetBits (usbBuf0CtrlData1Pid )
132
131
}
133
132
134
- _usbDPSRAM .EPxBufferControl [ep ].Out .SetBits (usbBuf0CtrlAvail )
133
+ _usbDPSRAM .EPxBufferControl [ep ].In .SetBits (usbBuf0CtrlAvail )
135
134
}
136
135
137
136
// Set the USB endpoint Packet ID to DATA0 or DATA1.
@@ -169,6 +168,7 @@ func sendViaEPIn(ep uint32, data []byte, count int) {
169
168
170
169
// Set ENDPOINT_HALT/stall status on a USB IN endpoint.
171
170
func (dev * USBDevice ) SetStallEPIn (ep uint32 ) {
171
+ // Drop the endpoint in bit (0x80)
172
172
ep = ep & 0x7F
173
173
// Prepare buffer control register value
174
174
if ep == 0 {
@@ -182,7 +182,6 @@ func (dev *USBDevice) SetStallEPIn(ep uint32) {
182
182
183
183
// Set ENDPOINT_HALT/stall status on a USB OUT endpoint.
184
184
func (dev * USBDevice ) SetStallEPOut (ep uint32 ) {
185
- ep = ep & 0x7F
186
185
if ep == 0 {
187
186
panic ("SetStallEPOut: EP0 OUT not valid" )
188
187
}
@@ -192,6 +191,7 @@ func (dev *USBDevice) SetStallEPOut(ep uint32) {
192
191
193
192
// Clear the ENDPOINT_HALT/stall on a USB IN endpoint.
194
193
func (dev * USBDevice ) ClearStallEPIn (ep uint32 ) {
194
+ // Drop the endpoint in bit (0x80)
195
195
ep = ep & 0x7F
196
196
val := uint32 (usbBuf0CtrlStall )
197
197
_usbDPSRAM .EPxBufferControl [ep ].In .ClearBits (val )
@@ -203,7 +203,6 @@ func (dev *USBDevice) ClearStallEPIn(ep uint32) {
203
203
204
204
// Clear the ENDPOINT_HALT/stall on a USB OUT endpoint.
205
205
func (dev * USBDevice ) ClearStallEPOut (ep uint32 ) {
206
- ep = ep & 0x7F
207
206
val := uint32 (usbBuf0CtrlStall )
208
207
_usbDPSRAM .EPxBufferControl [ep ].Out .ClearBits (val )
209
208
if outEpXPIDReset [ep ] {
0 commit comments