调用挂载函数 f_mount(&fsobject,"1:",1)返回值为FR_NO_FILESYSTEM
格式化后,再调用挂载函数,为什么返回值还是FR_NO_FILESYSTEM
以下是我写的代码:
res_mount = f_mount(&fsobject,"1:",1);
printf("\r\nf_mount res=%d",res_mount);
if(res_mount == FR_NO_FILESYSTEM) //挂载文件返回值为无文件系统时,进行格式化
{
res_mkfs = f_mkfs("1:",0,0);
printf("\r\nf_mkfs res=%d",res_mkfs);
//格式化后要取消挂载后重新挂载
res_mount = f_mount(NULL,"1:",1);
res_mount = f_mount(&fsobject,"1:",1);
printf("\r\nsecond res_mount=%d",res_mount);
} |