mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-22 05:19:03 +00:00
machine/atsamd51: remove extra BK0RDY clear
This commit is contained in:
@@ -142,8 +142,9 @@ func handleUSBIRQ(intr interrupt.Interrupt) {
|
|||||||
setup := usb.NewSetup(udd_ep_out_cache_buffer[0][:])
|
setup := usb.NewSetup(udd_ep_out_cache_buffer[0][:])
|
||||||
|
|
||||||
// Clear the Bank 0 ready flag on Control OUT
|
// Clear the Bank 0 ready flag on Control OUT
|
||||||
setEPSTATUSCLR(0, sam.USB_DEVICE_ENDPOINT_EPSTATUSCLR_BK0RDY)
|
usbEndpointDescriptors[0].DeviceDescBank[0].ADDR.Set(uint32(uintptr(unsafe.Pointer(&udd_ep_out_cache_buffer[0]))))
|
||||||
usbEndpointDescriptors[0].DeviceDescBank[0].PCKSIZE.ClearBits(usb_DEVICE_PCKSIZE_BYTE_COUNT_Mask << usb_DEVICE_PCKSIZE_BYTE_COUNT_Pos)
|
usbEndpointDescriptors[0].DeviceDescBank[0].PCKSIZE.ClearBits(usb_DEVICE_PCKSIZE_BYTE_COUNT_Mask << usb_DEVICE_PCKSIZE_BYTE_COUNT_Pos)
|
||||||
|
setEPSTATUSCLR(0, sam.USB_DEVICE_ENDPOINT_EPSTATUSCLR_BK0RDY)
|
||||||
|
|
||||||
ok := false
|
ok := false
|
||||||
if (setup.BmRequestType & usb.REQUEST_TYPE) == usb.REQUEST_STANDARD {
|
if (setup.BmRequestType & usb.REQUEST_TYPE) == usb.REQUEST_STANDARD {
|
||||||
@@ -347,15 +348,6 @@ func sendUSBPacket(ep uint32, data []byte, maxsize uint16) {
|
|||||||
func ReceiveUSBControlPacket() ([cdcLineInfoSize]byte, error) {
|
func ReceiveUSBControlPacket() ([cdcLineInfoSize]byte, error) {
|
||||||
var b [cdcLineInfoSize]byte
|
var b [cdcLineInfoSize]byte
|
||||||
|
|
||||||
// address
|
|
||||||
usbEndpointDescriptors[0].DeviceDescBank[0].ADDR.Set(uint32(uintptr(unsafe.Pointer(&udd_ep_out_cache_buffer[0]))))
|
|
||||||
|
|
||||||
// set byte count to zero
|
|
||||||
usbEndpointDescriptors[0].DeviceDescBank[0].PCKSIZE.ClearBits(usb_DEVICE_PCKSIZE_BYTE_COUNT_Mask << usb_DEVICE_PCKSIZE_BYTE_COUNT_Pos)
|
|
||||||
|
|
||||||
// set ready for next data
|
|
||||||
setEPSTATUSCLR(0, sam.USB_DEVICE_ENDPOINT_EPSTATUSCLR_BK0RDY)
|
|
||||||
|
|
||||||
// Wait until OUT transfer is ready.
|
// Wait until OUT transfer is ready.
|
||||||
timeout := 300000
|
timeout := 300000
|
||||||
for (getEPSTATUS(0) & sam.USB_DEVICE_ENDPOINT_EPSTATUS_BK0RDY) == 0 {
|
for (getEPSTATUS(0) & sam.USB_DEVICE_ENDPOINT_EPSTATUS_BK0RDY) == 0 {
|
||||||
|
|||||||
Reference in New Issue
Block a user