FatFS源代码中的函数逻辑关系
第一 调用函数 f_mount()
result = f_mount(&fs, FS_VOLUME_NAND, 0); /* Mount a logical drive */
FS_VOLUME_NAND 代表 “路径”
第二 进入函数 f_mount()内
1 /*-----------------------------------------------------------------------*/ 2 /* Mount/Unmount a Logical Drive */ 3 /*-----------------------------------------------------------------------*/ 4 5 FRESULT f_mount ( 6 FATFS* fs, /* Pointer to the file system object (NULL:unmount)*/ 7 const TCHAR* path, /* Logical drive number to be mounted/unmounted */ 8 BYTE opt /* 0:Do not mount (delayed mount), 1:Mount immediately */ 9 ) 10 { 11 FATFS *cfs; 12 int vol; 13 FRESULT res; 14 const TCHAR *rp = path; 15 16 17 vol = get_ldnumber(&rp); 18 if (vol < 0) return FR_INVALID_DRIVE; 19 cfs = FatFs[vol]; /* Pointer to fs object */ 20 21 if (cfs) { 22 #if _FS_LOCK 23 clear_lock(cfs); 24 #endif 25 #if _FS_REENTRANT /* Discard sync object of the current volume */ 26 if (!ff_del_syncobj(cfs->sobj)) return FR_INT_ERR; 27 #endif 28 cfs->fs_type = 0; /*