打印
[应用相关]

为什么执行到 *dp++ = *sp++;时就挂了呢?

[复制链接]
1308|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

粉丝