本帖最后由 hpdell 于 2017-5-5 09:58 编辑
请教下,
我现在想把fatfs v0.12版本改成 使用 fatfs v0.11,出现下面的情况,该如何修改啊 ??
fatfs v0.12 的版本里面有个
if(totsize == 0) //仅仅是单个文件复制
{
totsize = fsrc->obj.objsize; // 这个是 fatfs v0.12 版本里面的,但是在 fatfs v0.11里面没有,那么此处应该对应 v0.11版本里面的哪个变量啊 ???
lcpdsize = 0;
curpct = 0;
}
在fatfs v0.11 里面找到 DWORD fsize; /* File size */
对应 fatfs v0.11 fsrc->fsize; // 如果改成这样,不知道对不对 ??????????????????????????????
/* 下面这个是 fatfs v0.11 版本 */
/* File object structure (FIL) */
typedef struct {
#if !_FS_TINY
union{
UINT d32[_MAX_SS/4]; /* Force 32bits alignement */
BYTE d8[_MAX_SS]; /* File data read/write buffer */
}buf;
#endif
FATFS* fs; /* Pointer to the related file system object (**do not change order**) */
WORD id; /* Owner file system mount ID (**do not change order**) */
BYTE flag; /* Status flags */
BYTE err; /* Abort flag (error code) */
DWORD fptr; /* File read/write pointer (Zeroed on file open) */
DWORD fsize; /* File size */
DWORD sclust; /* File start cluster (0:no cluster chain, always 0 when fsize is 0) */
DWORD clust; /* Current cluster of fpter (not valid when fprt is 0) */
DWORD dsect; /* Sector number appearing in buf[] (0:invalid) */
#if !_FS_READONLY
DWORD dir_sect; /* Sector number containing the directory entry */
BYTE* dir_ptr; /* Pointer to the directory entry in the win[] */
#endif
#if _USE_FASTSEEK
DWORD* cltbl; /* Pointer to the cluster link map table (Nulled on file open) */
#endif
#if _FS_LOCK
UINT lockid; /* File lock ID origin from 1 (index of file semaphore table Files[]) */
#endif
} FIL;
// ==================================================================
// ==================================================================// ==================================================================
// ==================================================================
// 下面这个是 fatfs v0.12 版本里面的
typedef struct {
FATFS* fs; /* Pointer to the owner file system object */
WORD id; /* Owner file system mount ID */
BYTE attr; /* Object attribute */
BYTE stat; /* Object chain status (b1-0: =0:not contiguous, =2:contiguous (no data on FAT), =3:got flagmented, b2:sub-directory stretched) */
DWORD sclust; /* Object start cluster (0:no cluster or root directory) */
FSIZE_t objsize; /* Object size (valid when sclust != 0) */
#if _FS_EXFAT
DWORD n_cont; /* Size of coutiguous part, clusters - 1 (valid when stat == 3) */
DWORD c_scl; /* Containing directory start cluster (valid when sclust != 0) */
DWORD c_size; /* b31-b8:Size of containing directory, b7-b0: Chain status (valid when c_scl != 0) */
DWORD c_ofs; /* Offset in the containing directory (valid when sclust != 0) */
#endif
#if _FS_LOCK != 0
UINT lockid; /* File lock ID origin from 1 (index of file semaphore table Files[]) */
#endif
} _FDID;
/* File object structure (FIL) */
typedef struct {
_FDID obj; /* Object identifier (must be the 1st member to detect invalid object pointer) */
BYTE flag; /* File status flags */
BYTE err; /* Abort flag (error code) */
FSIZE_t fptr; /* File read/write pointer (Zeroed on file open) */
DWORD clust; /* Current cluster of fpter (invalid when fprt is 0) */
DWORD sect; /* Sector number appearing in buf[] (0:invalid) */
#if !_FS_READONLY
DWORD dir_sect; /* Sector number containing the directory entry */
BYTE* dir_ptr; /* Pointer to the directory entry in the win[] */
#endif
#if _USE_FASTSEEK
DWORD* cltbl; /* Pointer to the cluster link map table (nulled on open, set by application) */
#endif
#if !_FS_TINY
BYTE buf[_MAX_SS]; /* File private data read/write window */
#endif
} FIL;
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
貌似没有找到关于这个 函数的应用,f407里面木有,f429, f767里面使用的都是一样的,使用的都是fatfs v0.12版本,
你能否提供一下下载地址啊 ??
一周热门 更多>