增加长度接收的限定代码,似乎运行正常了

This commit is contained in:
2025-02-10 15:29:53 +08:00
parent 4d853a29d7
commit 38978594c2
3 changed files with 9 additions and 5 deletions

View File

@@ -125,6 +125,7 @@ uint32_t HLM_poll(uint32_t mode)
else if (mode == WORKMODE_SLAVE)
{
uint32_t rx_index = 0;
uint32_t rx_len;
while (1)
{
if (isr_flag[CDR_INT_TX0_FIFO_DEQ])
@@ -156,12 +157,16 @@ uint32_t HLM_poll(uint32_t mode)
len = (first >> 20U);
*tx1_txLen = len + 8U;
*tx1_txFifo = first;
rx_len = len + 4;
rx_index += 4U;
}
else
{
*tx1_txFifo = *rx0_rxFifo;
rx_index += 4U;
if (rx_len > rx_index)
{
*tx1_txFifo = *rx0_rxFifo;
rx_index += 4U;
}
}
}
@@ -177,7 +182,6 @@ uint32_t HLM_poll(uint32_t mode)
break;
}
}
}
else
{