mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-31 05:52:55 +08:00
fix/correct the max_loop (upper bound for EHCI & OHCI) endpoint list. This causes multiple devices hub mounting problems previously
This commit is contained in:
parent
b7b1d530f4
commit
5aacc633b4
@ -572,8 +572,8 @@
|
||||
<listOptionValue builtIn="false" value="RTX_CM0"/>
|
||||
</option>
|
||||
<option id="com.crt.advproject.link.gcc.hdrlib.1098185782" name="Library" superClass="com.crt.advproject.link.gcc.hdrlib" value="com.crt.advproject.gcc.link.hdrlib.codered.nohost" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.link.gcc.multicore.slave.1664969067" superClass="com.crt.advproject.link.gcc.multicore.slave"/>
|
||||
<option id="com.crt.advproject.link.gcc.multicore.master.1296103241" superClass="com.crt.advproject.link.gcc.multicore.master"/>
|
||||
<option id="com.crt.advproject.link.gcc.multicore.slave.1664969067" name="Multicore slave" superClass="com.crt.advproject.link.gcc.multicore.slave"/>
|
||||
<option id="com.crt.advproject.link.gcc.multicore.master.1296103241" name="Multicore" superClass="com.crt.advproject.link.gcc.multicore.master"/>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1799133268" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||
|
@ -170,8 +170,8 @@
|
||||
<option id="gnu.c.link.option.paths.1946871342" name="Library search path (-L)" superClass="gnu.c.link.option.paths"/>
|
||||
<option id="gnu.c.link.option.libs.937236410" name="Libraries (-l)" superClass="gnu.c.link.option.libs"/>
|
||||
<option id="com.crt.advproject.link.gcc.hdrlib.1273255587" name="Library" superClass="com.crt.advproject.link.gcc.hdrlib" value="com.crt.advproject.gcc.link.hdrlib.codered.nohost" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.link.gcc.multicore.slave.1321595401" superClass="com.crt.advproject.link.gcc.multicore.slave"/>
|
||||
<option id="com.crt.advproject.link.gcc.multicore.master.871347365" superClass="com.crt.advproject.link.gcc.multicore.master"/>
|
||||
<option id="com.crt.advproject.link.gcc.multicore.slave.1321595401" name="Multicore slave" superClass="com.crt.advproject.link.gcc.multicore.slave"/>
|
||||
<option id="com.crt.advproject.link.gcc.multicore.master.871347365" name="Multicore" superClass="com.crt.advproject.link.gcc.multicore.master"/>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.888929207" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||
|
@ -73,7 +73,7 @@
|
||||
<OPTFL>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
<IsCurrentTarget>0</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>8</CpuCode>
|
||||
<DllOpt>
|
||||
@ -679,7 +679,7 @@
|
||||
<OPTFL>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>0</IsCurrentTarget>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>8</CpuCode>
|
||||
<DllOpt>
|
||||
@ -937,7 +937,7 @@
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>15</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>77</TopLine>
|
||||
<TopLine>78</TopLine>
|
||||
<CurrentLine>86</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\src\main.c</PathWithFileName>
|
||||
@ -1449,7 +1449,7 @@
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>27</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>61</TopLine>
|
||||
<TopLine>62</TopLine>
|
||||
<CurrentLine>64</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\..\boards\board.c</PathWithFileName>
|
||||
@ -1993,7 +1993,7 @@
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>147</TopLine>
|
||||
<TopLine>148</TopLine>
|
||||
<CurrentLine>156</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\..\mcu\lpc43xx\keil\startup_LPC43xx.s</PathWithFileName>
|
||||
@ -2063,10 +2063,10 @@
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>45</ColumnNumber>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>1654</TopLine>
|
||||
<CurrentLine>1662</CurrentLine>
|
||||
<TopLine>1655</TopLine>
|
||||
<CurrentLine>1665</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\..\vendor\freertos\freertos\Source\tasks.c</PathWithFileName>
|
||||
<FilenameWithoutPath>tasks.c</FilenameWithoutPath>
|
||||
|
@ -143,6 +143,7 @@
|
||||
</option>
|
||||
<option id="com.crt.advproject.c.misc.dialect.785308269" name="C Dialect" superClass="com.crt.advproject.c.misc.dialect" value="com.crt.advproject.misc.dialect.gnu99" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gcc.fpu.1722235316" name="Floating point" superClass="com.crt.advproject.gcc.fpu" value="com.crt.advproject.gcc.fpu.fpv4" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gcc.exe.debug.option.optimization.level.1947251713" superClass="com.crt.advproject.gcc.exe.debug.option.optimization.level" value="gnu.c.optimization.level.none" valueType="enumerated"/>
|
||||
<inputType id="com.crt.advproject.compiler.input.772057054" superClass="com.crt.advproject.compiler.input"/>
|
||||
</tool>
|
||||
<tool command="arm-none-eabi-gcc" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG}${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GASErrorParser" id="com.crt.advproject.gas.exe.debug.973267950" name="MCU Assembler" superClass="com.crt.advproject.gas.exe.debug">
|
||||
|
@ -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 )
|
||||
{
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user