QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1341|回复: 1

读过sjf2410代码的请帮帮忙

[复制链接]
发表于 2006-3-21 15:05:22 | 显示全部楼层 |阅读模式
以下是 sjf2410_v4程序中 k9s1208.c 文件中的一段代码:
   printf("\nSource size:0h~%xh\n",imageSize-1);
    printf("\nAvailable target block number: 0~2048\n");
    printf("Input target block number:");
    scanf("%d",&targetBlock);
    targetSize=((imageSize+0x4000-1)/0x4000)*0x4000;//why????
    printf("target start block number     =%d\n",targetBlock);
    printf("target size        (0x4000*n) =0x%x\n",targetSize);
    printf("STATUS:");
    blockIndex=targetBlock;


targetSize=((imageSize+0x4000-1)/0x4000)*0x4000;//why????
一句,它的作用是什么?为什么要这样算??

谢了!!!
发表于 2006-3-23 18:56:44 | 显示全部楼层
这个应该是计算出需要占用的块的总容量
相当于“向上取整”



----------------------------
成都博睿——超低价格供应带稳定vga输出的s3c2410开发板
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-5-30 08:29 , Processed in 0.136116 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表