[应用相关] 为什么执行到 *dp++ = *sp++;时就挂了呢?

[复制链接]
1602|0
 楼主| jxmzzr 发表于 2013-4-4 18:58 | 显示全部楼层 |阅读模式
static void rece_frame (U8 *pbuf, U16 length) {
        OS_FRAME *frame;
        U32 *sp,*dp;

        /* Flag 0x80000000 to skip sys_error() call when out of memory. */
        frame = alloc_mem ((length + 8) | 0x80000000);
                /* if 'alloc_mem()' has failed, ignore this packet. */
        if (frame != NULL)
        {
                printf("frame != NULL\r\n");
                frame->length = length;
                printf("sp=%x\r\n",*sp);
                sp = (U32 *)(pbuf);
                dp = (U32 *)&frame->data[0];
                for (length = (length + 3) >> 2; length; length--)
                {
                        printf("length=%d\r\n",length);
                        printf("sp=%x\r\n",*sp);
                        *dp++ = *sp++;
                       
                }
    printf("start to put in queue\r\n");
                put_in_queue (frame);
        }
}
为什么执行到        *dp++ = *sp++;时就挂了呢?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

460

主题

2188

帖子

12

粉丝
快速回复 在线客服 返回列表 返回顶部