在线时间37 小时
UID2087604
注册时间2014-4-22
NXP金币0
该用户从未签到
中级会员
- 积分
- 303
- 最后登录
- 2021-11-15
|
本帖最后由 LuoHG 于 2020-4-17 16:28 编辑
在ENET初始时,在函数ENET_SetRxBufferDescriptors中将最后一个缓存描述控制字置位ENET_BUFFDESCRIPTOR_RX_WRAP_MASK表示回首,
/* Initializes the buffer descriptors with empty bit. */
curBuffDescrip->control = ENET_BUFFDESCRIPTOR_RX_EMPTY_MASK;
/* Sets the last buffer descriptor with the wrap flag. */
if (count == (buffCfg->rxBdNumber - 1U))
{
curBuffDescrip->control |= ENET_BUFFDESCRIPTOR_RX_WRAP_MASK;
}
但在如下相关函数ENET_GetRxFrameSize,ENET_GetRxErrBeforeReadFrame, ENET_UpdateReadBuffers关于环形缓存回首的判断都取不等于取首个,
static void ENET_UpdateReadBuffers(ENET_Type *base, enet_handle_t *handle, uint32_t ringId)
{
assert(handle != NULL);
assert(ringId < (uint32_t)FSL_FEATURE_ENET_QUEUE);
/* Clears status. */
handle->rxBdCurrent[ringId]->control &= ENET_BUFFDESCRIPTOR_RX_WRAP_MASK;
/* Sets the receive buffer descriptor with the empty flag. */
handle->rxBdCurrent[ringId]->control |= ENET_BUFFDESCRIPTOR_RX_EMPTY_MASK;
/* Increase current buffer descriptor to the next one. */
if (0U != (handle->rxBdCurrent[ringId]->control & ENET_BUFFDESCRIPTOR_RX_WRAP_MASK))
{
handle->rxBdCurrent[ringId] = handle->rxBdBase[ringId];
}
else
{
handle->rxBdCurrent[ringId]++;
}
感觉这有大大的问题啊,这样会导致一直使用第一个接收缓存,后面的缓存一直未递增到?
|
|