Skip to content

Commit

Permalink
update(class/msc/usbh_msc): add retry macro
Browse files Browse the repository at this point in the history
Signed-off-by: sakumisu <[email protected]>
  • Loading branch information
sakumisu committed Jan 16, 2025
1 parent 0a295ee commit 6c3b828
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion class/msc/usbh_msc.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@

#define DEV_FORMAT "/dev/sd%c"

#ifndef CONFIG_USBHOST_MSC_READY_CHECK_TIMES
#define CONFIG_USBHOST_MSC_READY_CHECK_TIMES 10
#endif

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)];
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)];

Expand Down Expand Up @@ -323,7 +327,7 @@ static int usbh_msc_connect(struct usbh_hubport *hport, uint8_t intf)
USB_LOG_ERR("Fail to scsi_testunitready\r\n");
}
cnt++;
if (cnt > 10) {
if (cnt > CONFIG_USBHOST_MSC_READY_CHECK_TIMES) {
return -USB_ERR_BUSY;
}
}
Expand Down

0 comments on commit 6c3b828

Please sign in to comment.