@@ -119,7 +119,6 @@ func handleEndpointRx(ep uint32) []byte {
119119
120120// AckUsbOutTransfer is called to acknowledge the completion of a USB OUT transfer.
121121func AckUsbOutTransfer (ep uint32 ) {
122- ep = ep & 0x7F
123122 setOutEPDataPID (ep , ! outEpXdata0 [ep ])
124123}
125124
@@ -131,7 +130,7 @@ func setInEPDataPID(ep uint32, dataOne usbPID) {
131130 _usbDPSRAM .EPxBufferControl [ep ].In .SetBits (usbBuf0CtrlData1Pid )
132131 }
133132
134- _usbDPSRAM .EPxBufferControl [ep ].Out .SetBits (usbBuf0CtrlAvail )
133+ _usbDPSRAM .EPxBufferControl [ep ].In .SetBits (usbBuf0CtrlAvail )
135134}
136135
137136// Set the USB endpoint Packet ID to DATA0 or DATA1.
@@ -169,6 +168,7 @@ func sendViaEPIn(ep uint32, data []byte, count int) {
169168
170169// Set ENDPOINT_HALT/stall status on a USB IN endpoint.
171170func (dev * USBDevice ) SetStallEPIn (ep uint32 ) {
171+ // Drop the endpoint in bit (0x80)
172172 ep = ep & 0x7F
173173 // Prepare buffer control register value
174174 if ep == 0 {
@@ -182,7 +182,6 @@ func (dev *USBDevice) SetStallEPIn(ep uint32) {
182182
183183// Set ENDPOINT_HALT/stall status on a USB OUT endpoint.
184184func (dev * USBDevice ) SetStallEPOut (ep uint32 ) {
185- ep = ep & 0x7F
186185 if ep == 0 {
187186 panic ("SetStallEPOut: EP0 OUT not valid" )
188187 }
@@ -192,6 +191,7 @@ func (dev *USBDevice) SetStallEPOut(ep uint32) {
192191
193192// Clear the ENDPOINT_HALT/stall on a USB IN endpoint.
194193func (dev * USBDevice ) ClearStallEPIn (ep uint32 ) {
194+ // Drop the endpoint in bit (0x80)
195195 ep = ep & 0x7F
196196 val := uint32 (usbBuf0CtrlStall )
197197 _usbDPSRAM .EPxBufferControl [ep ].In .ClearBits (val )
@@ -203,7 +203,6 @@ func (dev *USBDevice) ClearStallEPIn(ep uint32) {
203203
204204// Clear the ENDPOINT_HALT/stall on a USB OUT endpoint.
205205func (dev * USBDevice ) ClearStallEPOut (ep uint32 ) {
206- ep = ep & 0x7F
207206 val := uint32 (usbBuf0CtrlStall )
208207 _usbDPSRAM .EPxBufferControl [ep ].Out .ClearBits (val )
209208 if outEpXPIDReset [ep ] {
0 commit comments