|
发表于 2025-9-1 10:45:04
|
显示全部楼层
/* Get the Frame size */
status = ENET_GetRxFrameSize(&g_handle, &length);
/* Call ENET_ReadFrame when there is a received frame. */
if (length != 0)
{
/* Received valid frame. Deliver the rx buffer with the size equal to length. */
uint8_t *data = (uint8_t *)malloc(length);
status = ENET_ReadFrame(EXAMPLE_ENET, &g_handle, data, length);
if (status == kStatus_Success)
{
frame = (void *)malloc(length);
if (frame != NULL)
{
sp = (U32 *)(data);
dp = (U32 *)&frame->data[0];
for (length = (length + 3) >> 2; length; length--)
{
*dp++ = *sp++;
}
put_in_queue (frame);
}
free(data);
}
}
可以帮忙看下这块代码有无问题吗,每次将数据放入队列时,就会报错“ERR_MEM_CORRUPT” |
|