在用FATFS文件系统,一直死在这儿,过不去....

2019-10-15 21:12发布

[mw_shl_code=c,true]/*-----------------------------------------------------------------------*/ /* Load a sector and check if it is an FAT Volume Boot Record */ /*-----------------------------------------------------------------------*/ static BYTE check_fs ( /* 0:FAT-VBR, 1:Valid BR but not FAT, 2:Not a BR, 3isk error */ FATFS *fs, /* File system object */ DWORD sect /* Sector# (lba) to check if it is an FAT boot record or not */ ) { if (disk_read(fs->drv, fs->win, sect, 1) != RES_OK) /* Load boot record */ return 3; if (LD_WORD(&fs->win[BS_55AA]) != 0xAA55) /* Check record signature (always placed at offset 510 even if the sector size is >512) */ return 2; if ((LD_DWORD(&fs->win[BS_FilSysType]) & 0xFFFFFF) == 0x544146) /* Check "FAT" string */ return 0; if ((LD_DWORD(&fs->win[BS_FilSysType32]) & 0xFFFFFF) == 0x544146) return 0; return 1; }[/mw_shl_code] 走了这步之后if (LD_WORD(&fs->win[BS_55AA]) != 0xAA55)
就return 2了;
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。