machine/atsamd21,atsamd51: clear the USB packet size before setting it again when sending
Signed-off-by: Ron Evans <ron@hybridgroup.com>
Этот коммит содержится в:
		
							родитель
							
								
									ccf8b378b3
								
							
						
					
					
						коммит
						5d539df216
					
				
					 2 изменённых файлов: 2 добавлений и 4 удалений
				
			
		| 
						 | 
					@ -1477,8 +1477,6 @@ func handleUSB(intr interrupt.Interrupt) {
 | 
				
			||||||
			// clear stall request
 | 
								// clear stall request
 | 
				
			||||||
			setEPINTENCLR(0, sam.USB_DEVICE_EPINTENCLR_STALL1)
 | 
								setEPINTENCLR(0, sam.USB_DEVICE_EPINTENCLR_STALL1)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
		sendZlp()
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Now the actual transfer handlers, ignore endpoint number 0 (setup)
 | 
						// Now the actual transfer handlers, ignore endpoint number 0 (setup)
 | 
				
			||||||
| 
						 | 
					@ -1749,6 +1747,7 @@ func sendUSBPacket(ep uint32, data []byte) {
 | 
				
			||||||
	usbEndpointDescriptors[ep].DeviceDescBank[1].PCKSIZE.ClearBits(usb_DEVICE_PCKSIZE_MULTI_PACKET_SIZE_Mask << usb_DEVICE_PCKSIZE_MULTI_PACKET_SIZE_Pos)
 | 
						usbEndpointDescriptors[ep].DeviceDescBank[1].PCKSIZE.ClearBits(usb_DEVICE_PCKSIZE_MULTI_PACKET_SIZE_Mask << usb_DEVICE_PCKSIZE_MULTI_PACKET_SIZE_Pos)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// set byte count, which is total number of bytes to be sent
 | 
						// set byte count, which is total number of bytes to be sent
 | 
				
			||||||
 | 
						usbEndpointDescriptors[ep].DeviceDescBank[1].PCKSIZE.ClearBits(usb_DEVICE_PCKSIZE_BYTE_COUNT_Mask << usb_DEVICE_PCKSIZE_BYTE_COUNT_Pos)
 | 
				
			||||||
	usbEndpointDescriptors[ep].DeviceDescBank[1].PCKSIZE.SetBits(uint32((len(data) & usb_DEVICE_PCKSIZE_BYTE_COUNT_Mask) << usb_DEVICE_PCKSIZE_BYTE_COUNT_Pos))
 | 
						usbEndpointDescriptors[ep].DeviceDescBank[1].PCKSIZE.SetBits(uint32((len(data) & usb_DEVICE_PCKSIZE_BYTE_COUNT_Mask) << usb_DEVICE_PCKSIZE_BYTE_COUNT_Pos))
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1648,8 +1648,6 @@ func handleUSBIRQ(interrupt.Interrupt) {
 | 
				
			||||||
			// clear stall request
 | 
								// clear stall request
 | 
				
			||||||
			setEPINTENCLR(0, sam.USB_DEVICE_ENDPOINT_EPINTENCLR_STALL1)
 | 
								setEPINTENCLR(0, sam.USB_DEVICE_ENDPOINT_EPINTENCLR_STALL1)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
		sendZlp()
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Now the actual transfer handlers, ignore endpoint number 0 (setup)
 | 
						// Now the actual transfer handlers, ignore endpoint number 0 (setup)
 | 
				
			||||||
| 
						 | 
					@ -1920,6 +1918,7 @@ func sendUSBPacket(ep uint32, data []byte) {
 | 
				
			||||||
	usbEndpointDescriptors[ep].DeviceDescBank[1].PCKSIZE.ClearBits(usb_DEVICE_PCKSIZE_MULTI_PACKET_SIZE_Mask << usb_DEVICE_PCKSIZE_MULTI_PACKET_SIZE_Pos)
 | 
						usbEndpointDescriptors[ep].DeviceDescBank[1].PCKSIZE.ClearBits(usb_DEVICE_PCKSIZE_MULTI_PACKET_SIZE_Mask << usb_DEVICE_PCKSIZE_MULTI_PACKET_SIZE_Pos)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// set byte count, which is total number of bytes to be sent
 | 
						// set byte count, which is total number of bytes to be sent
 | 
				
			||||||
 | 
						usbEndpointDescriptors[ep].DeviceDescBank[1].PCKSIZE.ClearBits(usb_DEVICE_PCKSIZE_BYTE_COUNT_Mask << usb_DEVICE_PCKSIZE_BYTE_COUNT_Pos)
 | 
				
			||||||
	usbEndpointDescriptors[ep].DeviceDescBank[1].PCKSIZE.SetBits(uint32((len(data) & usb_DEVICE_PCKSIZE_BYTE_COUNT_Mask) << usb_DEVICE_PCKSIZE_BYTE_COUNT_Pos))
 | 
						usbEndpointDescriptors[ep].DeviceDescBank[1].PCKSIZE.SetBits(uint32((len(data) & usb_DEVICE_PCKSIZE_BYTE_COUNT_Mask) << usb_DEVICE_PCKSIZE_BYTE_COUNT_Pos))
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Загрузка…
	
	Создание таблицы
		
		Сослаться в новой задаче