最新版FatFS底层disk_ioctl()多了命令CTRL_ERASE_SECTOR怎么用?

[复制链接]
 楼主| aoshi0603 发表于 2011-8-16 15:24 | 显示全部楼层 |阅读模式
本帖最后由 aoshi0603 于 2011-8-16 15:35 编辑

最新版FatFs R0.08b底层diskio.c文件里的函数disk_ioctl()多了几个命令,其中一个是:
CTRL_ERASE_SECTOR,含义为:
/* Erases a part of the flash memory specified by a DWORD array {<start sector>, <end sector>} pointed by Buffer.
When this feature is not supported or not a flash memory media, this command has no effect.
The FatFs does not check the result code and the file function is not affected even if the sectors are not erased well.
This command is called on removing a cluster chain when _USE_ERASE is 1.
*/
大致意思为:擦除由数组指针Buffer{<起始页>, <结束页>}指定的一部分闪存。

有了这个命令, 是不是在disk_write()中不用写sector擦除代码啦?可以直接写?
补充一下,我用的NAND Flash。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

6

主题

113

帖子

3

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