diff --git a/demos/device/device_cmsis_rtx/.cproject b/demos/device/device_cmsis_rtx/.cproject
index c3b2ebd2b..59f13efa2 100644
--- a/demos/device/device_cmsis_rtx/.cproject
+++ b/demos/device/device_cmsis_rtx/.cproject
@@ -572,8 +572,8 @@
-
-
+
+
diff --git a/demos/device/device_freertos/.cproject b/demos/device/device_freertos/.cproject
index ff991ee83..28655674d 100644
--- a/demos/device/device_freertos/.cproject
+++ b/demos/device/device_freertos/.cproject
@@ -170,8 +170,8 @@
-
-
+
+
diff --git a/demos/device/device_freertos/device_freertos.uvopt b/demos/device/device_freertos/device_freertos.uvopt
index 8a2e49913..739446e07 100644
--- a/demos/device/device_freertos/device_freertos.uvopt
+++ b/demos/device/device_freertos/device_freertos.uvopt
@@ -73,7 +73,7 @@
1
0
- 1
+ 0
8
@@ -679,7 +679,7 @@
1
0
- 0
+ 1
8
@@ -937,7 +937,7 @@
0
15
0
- 77
+ 78
86
0
..\src\main.c
@@ -1449,7 +1449,7 @@
0
27
0
- 61
+ 62
64
0
..\..\..\boards\board.c
@@ -1993,7 +1993,7 @@
0
0
0
- 147
+ 148
156
0
..\..\..\mcu\lpc43xx\keil\startup_LPC43xx.s
@@ -2063,10 +2063,10 @@
1
0
0
- 45
+ 0
0
- 1654
- 1662
+ 1655
+ 1665
0
..\..\..\vendor\freertos\freertos\Source\tasks.c
tasks.c
diff --git a/demos/host/host_os_none/.cproject b/demos/host/host_os_none/.cproject
index a3f8f00f4..f54877a59 100644
--- a/demos/host/host_os_none/.cproject
+++ b/demos/host/host_os_none/.cproject
@@ -143,6 +143,7 @@
+
diff --git a/tinyusb/host/ehci/ehci.c b/tinyusb/host/ehci/ehci.c
index 2e2ce1001..b3069388a 100644
--- a/tinyusb/host/ehci/ehci.c
+++ b/tinyusb/host/ehci/ehci.c
@@ -592,7 +592,7 @@ static void async_list_xfer_complete_isr(ehci_qhd_t * const async_head)
}
p_qhd = qhd_next(p_qhd);
max_loop++;
- }while(p_qhd != async_head && max_loop < HCD_MAX_ENDPOINT); // async list traversal, stop if loop around
+ }while(p_qhd != async_head && max_loop < HCD_MAX_ENDPOINT*TUSB_CFG_HOST_DEVICE_MAX); // async list traversal, stop if loop around
// TODO abstract max loop guard for async
}
@@ -606,7 +606,7 @@ static void period_list_xfer_complete_isr(uint8_t hostid, uint8_t interval_ms)
// TODO abstract max loop guard for period
while( !next_item.terminate &&
!(interval_ms > 1 && period_1ms_addr == align32(next_item.address)) &&
- max_loop < (HCD_MAX_ENDPOINT + EHCI_MAX_ITD + EHCI_MAX_SITD))
+ max_loop < (HCD_MAX_ENDPOINT + EHCI_MAX_ITD + EHCI_MAX_SITD)*TUSB_CFG_HOST_DEVICE_MAX)
{
switch ( next_item.type )
{
@@ -646,8 +646,8 @@ static void qhd_xfer_error_isr(ehci_qhd_t * p_qhd)
p_qhd->total_xferred_bytes += p_qhd->p_qtd_list_head->expected_bytes - p_qhd->p_qtd_list_head->total_bytes;
- // TODO skip unplugged device
- if ( TUSB_EVENT_XFER_ERROR == error_event ) hal_debugger_breakpoint();
+
+// if ( TUSB_EVENT_XFER_ERROR == error_event ) hal_debugger_breakpoint(); // TODO skip unplugged device
p_qhd->p_qtd_list_head->used = 0; // free QTD
qtd_remove_1st_from_qhd(p_qhd);
@@ -691,7 +691,7 @@ static void xfer_error_isr(uint8_t hostid)
qhd_xfer_error_isr( p_qhd );
p_qhd = qhd_next(p_qhd);
max_loop++;
- }while(p_qhd != async_head && max_loop < HCD_MAX_ENDPOINT); // async list traversal, stop if loop around
+ }while(p_qhd != async_head && max_loop < HCD_MAX_ENDPOINT*TUSB_CFG_HOST_DEVICE_MAX); // async list traversal, stop if loop around
#if EHCI_PERIODIC_LIST
//------------- TODO refractor period list -------------//
@@ -704,7 +704,7 @@ static void xfer_error_isr(uint8_t hostid)
// TODO abstract max loop guard for period
while( !next_item.terminate &&
!(interval_ms > 1 && period_1ms_addr == align32(next_item.address)) &&
- period_max_loop < (HCD_MAX_ENDPOINT + EHCI_MAX_ITD + EHCI_MAX_SITD))
+ period_max_loop < (HCD_MAX_ENDPOINT + EHCI_MAX_ITD + EHCI_MAX_SITD)*TUSB_CFG_HOST_DEVICE_MAX)
{
switch ( next_item.type )
{
diff --git a/tinyusb/host/ohci/ohci.c b/tinyusb/host/ohci/ohci.c
index 128760779..ef6da66d5 100644
--- a/tinyusb/host/ohci/ohci.c
+++ b/tinyusb/host/ohci/ohci.c
@@ -384,7 +384,7 @@ static inline ohci_ed_t * ed_find_free(uint8_t dev_addr)
static ohci_ed_t * ed_list_find_previous(ohci_ed_t const * p_head, ohci_ed_t const * p_ed)
{
- uint32_t max_loop = HCD_MAX_ENDPOINT;
+ uint32_t max_loop = HCD_MAX_ENDPOINT*TUSB_CFG_HOST_DEVICE_MAX;
ohci_ed_t const * p_prev = p_head;