本帖最后由 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。 |