本人以太网方面菜鸟,最近看了KEIL下MCB1700 easyWEB例程
不懂函数void CopyFromFrame_EMAC(void *Dest, unsigned short Size)是怎么实现的,请大神们结合以太网包格式讲解以下代码的具体实现步骤,越详细越好
先谢谢了!!
void CopyFromFrame_EMAC(void *Dest, unsigned short Size)
{
unsigned short * piDest; // Keil: Pointer added to correct expression
piDest = Dest; // Keil: Line added
while (Size > 1) {
*piDest++ = ReadFrame_EMAC(); //(*rptr++) 读帧数据
Size -= 2;
}
if (Size) { // check for leftover byte...
*(unsigned char *)piDest = (char)ReadFrame_EMAC();// the LAN-Controller will return 0
} // for the highbyte
}
此帖出自
小平头技术问答
一周热门 更多>