Skip to content

Commit 6c3b828

Browse files
committed
update(class/msc/usbh_msc): add retry macro
Signed-off-by: sakumisu <1203593632@qq.com>
1 parent 0a295ee commit 6c3b828

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

class/msc/usbh_msc.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313

1414
#define DEV_FORMAT "/dev/sd%c"
1515

16+
#ifndef CONFIG_USBHOST_MSC_READY_CHECK_TIMES
17+
#define CONFIG_USBHOST_MSC_READY_CHECK_TIMES 10
18+
#endif
19+
1620
USB_NOCACHE_RAM_SECTION USB_MEM_ALIGNX uint8_t g_msc_cbw_csw[CONFIG_USBHOST_MAX_MSC_CLASS][USB_ALIGN_UP(64, CONFIG_USB_ALIGN_SIZE)];
1721
USB_NOCACHE_RAM_SECTION USB_MEM_ALIGNX uint8_t g_msc_buf[CONFIG_USBHOST_MAX_MSC_CLASS][USB_ALIGN_UP(64, CONFIG_USB_ALIGN_SIZE)];
1822

@@ -323,7 +327,7 @@ static int usbh_msc_connect(struct usbh_hubport *hport, uint8_t intf)
323327
USB_LOG_ERR("Fail to scsi_testunitready\r\n");
324328
}
325329
cnt++;
326-
if (cnt > 10) {
330+
if (cnt > CONFIG_USBHOST_MSC_READY_CHECK_TIMES) {
327331
return -USB_ERR_BUSY;
328332
}
329333
}

0 commit comments

Comments
 (0)