能够创建文件,但是写文件时发现文件状态错误。
if (fp->flag & FA__DIRTY) { /* Write back data buffer prior to following direct transfer */
if (disk_write(fp->fs->drive, fp->buf, fp->dsect, 1) != RES_OK)
ABORT(fp->fs, FR_DISK_ERR);
fp->flag &= ~FA__DIRTY;
}
经过这一行的时候,发现fp->flag的值为0x02,不能对SD卡进行读写。求帮助。