Browse Source

更新MCU工程(iram版本和sram-nos版本)
优化USB Host驱动的兼容性,解决部分U盘初始化时枚举失败的问题。

helen 3 months ago
parent
commit
09b611262a

+ 2 - 2
amt630hv160-mcu/amt630hv160-mcu-iram/src/App/usbhost.c

@@ -357,9 +357,9 @@ int usb_control_msg(struct usb_device *dev, unsigned int pipe,
 	 * been completed.
 	 */
 	while (timeout--) {
+		TIMER_Mdelay(1);
 		if (!(dev->status & USB_ST_NOT_PROC))
 			break;
-		TIMER_Mdelay(1);
 	}
 	if (dev->status)
 		return -1;
@@ -382,9 +382,9 @@ int usb_bulk_msg(struct usb_device *dev, unsigned int pipe,
 	if (submit_bulk_msg(dev, pipe, data, len) < 0)
 		return -EIO;
 	while (timeout--) {
+		TIMER_Mdelay(1);
 		if (!(dev->status & USB_ST_NOT_PROC))
 			break;
-		TIMER_Mdelay(1);
 	}
 	*actual_length = dev->act_len;
 	if (dev->status == 0)

+ 2 - 2
amt630hv160-mcu/amt630hv160-mcu-sram-nos/src/App/usbhost.c

@@ -357,9 +357,9 @@ int usb_control_msg(struct usb_device *dev, unsigned int pipe,
 	 * been completed.
 	 */
 	while (timeout--) {
+		TIMER_Mdelay(1);
 		if (!(dev->status & USB_ST_NOT_PROC))
 			break;
-		TIMER_Mdelay(1);
 	}
 	if (dev->status)
 		return -1;
@@ -382,9 +382,9 @@ int usb_bulk_msg(struct usb_device *dev, unsigned int pipe,
 	if (submit_bulk_msg(dev, pipe, data, len) < 0)
 		return -EIO;
 	while (timeout--) {
+		TIMER_Mdelay(1);
 		if (!(dev->status & USB_ST_NOT_PROC))
 			break;
-		TIMER_Mdelay(1);
 	}
 	*actual_length = dev->act_len;
 	if (dev->status == 0)