本帖最后由 rindy 于 2018-4-25 13:20 编辑
原子例程中的函数原型
//打开路径下的文件
//path:路径+文件名
//mode:打开模式
//返回值:执行结果
u8 mf_open(u8*path,u8 mode)
{
u8 res;
res=f_open(file,(const TCHAR*)path,mode);//打开文件夹
return res;
}
我调用这个函数打开我SD卡中文件的时候偶尔打开成功即返回值是0x00,但是有时候返回值确是0x09即失败后来查到0x09代表The file/directory object is invalid 即说明打开的文件是无效的,但是为什么相同一个文件有时候能打开有时候又说此文件是无效的呢?
typedef enum {
FR_OK = 0, /* (0) Succeeded */
FR_DISK_ERR, /* (1) A hard error occurred in the low level disk I/O layer */
FR_INT_ERR, /* (2) Assertion failed */
FR_NOT_READY, /* (3) The physical drive cannot work */
FR_NO_FILE, /* (4) Could not find the file */
<