版主: 51FPGA |
houdong
![]()
最后登陆时间:2010-11-22 22:33:55 |
前辈好!我用的是Xilinx V2Pro开发板,我的想法是把读出的图片数据读出来,处理后以不同的文件名存成另一张图片。sysace_fopen()操作是正确的,但是在numwrite = sysace_fwrite(readBuffer, 1, 2, fptw) 卡主了。测试过, sysace_fwrite(readBuffer, 1, 2, fptw)只能读取一张图片里的部分数据。琢磨了好几天,偶然修改了CONFIG_BUFCACHE_SIZE,把原来的10240改成30000 这样就能存储了。但是让我疑惑的是
for (j=infoheader.height-1;j=0;j--) {
numread = sysace_fread(readBuffer, 1, 1920, infile);
numwrite = sysace_fwrite(readBuffer, 1, 1920, outfile);
}
infoheader.height的初值是580,当循环到571的时候就卡住了,1920*9=17280,这个数也是大于10240的,改成30000后按理论值也不会多循环几次的。这个存储系统的机制我不理解,请前辈赐教!
下面是我在Xilinx“OS and Libraries Document Collection”上查找到CONFIG_BUFCACHE_SIZE的定义并翻译出来的结果:
CONFIG_BUFCACHE_SIZE定义了被调用到System ACE的读写库函数的总的内存(按字节)。它通过数据缓冲提升了读写函数的性能和避免了对CF卡设备的不必要的访问。当sysace_fclose被调用时缓冲区的数据被同步写到设备;因此,如果文件被修改执sysace_fclose变得非常必要。
原文如下:
CONFIG_BUFCACHE_SIZE: defines the amount of memory (in bytes) used by the library for buffering reads and write calls to the System ACE. This improves the performance of both sysace_fread and sysace_fwrite by buffering the data in memory and avoiding unnecessary calls to read the CF device. The buffers are synced up to the device only on a sysace_fclose call; consequently, is essential to perform a sysace_fclose if any file was modified.
关键词:关于 CONFIG BUFCACHE 存储 机制 |
![]() houdong。 |
|
Jason_Zhang
![]()
最后登陆时间:2015-01-20 09:30:43 |
没用过这个板子,帮不上你的忙 |
![]() My Email : zldpublic@gmail.com。 |
|
houdong
![]()
最后登陆时间:2010-11-22 22:33:55 |
学长啊 我今天在公车上想了很久 这个是不是和板子没关系啊 在software platform setting ----software platform---OS&library setting 的OS是standalone; Version:1.00a; library :xilfatfs 1.00a 是不是和操作系统有关啊
|
![]() houdong。 |
|
共3条 1/1 1 |