Ignore:
Timestamp:
Apr 5, 2019, 9:26:53 PM (5 years ago)
Author:
coas-nagasima
Message:

mbed関連を更新
シリアルドライバをmbedのHALを使うよう変更
ファイルディスクリプタの処理を更新

File:
1 edited

Legend:

Unmodified
Added
Removed
  • asp3_tinet_ecnl_arm/trunk/ntshell/fatfs/ff.h

    r352 r374  
    2828#include "ffconf.h"             /* FatFs configuration options */
    2929#include "diskio.h"
    30 #if _FATFS != _FFCONF
     30#if _FATFS != FFCONF_DEF
    3131#error Wrong configuration file (ffconf.h).
    3232#endif
     
    3636/* Definitions of volume management */
    3737
    38 #if _MULTI_PARTITION            /* Multiple partition configuration */
     38#if FF_MULTI_PARTITION          /* Multiple partition configuration */
    3939typedef struct {
    4040        BYTE pd;        /* Physical drive number */
     
    5555/* Type of path name strings on FatFs API */
    5656
    57 #if _LFN_UNICODE                        /* Unicode string */
    58 #if !_USE_LFN
    59 #error _LFN_UNICODE must be 0 at non-LFN cfg.
     57#if FF_LFN_UNICODE                      /* Unicode string */
     58#if !FF_USE_LFN
     59#error FF_LFN_UNICODE must be 0 at non-LFN cfg.
    6060#endif
    6161#ifndef _INC_TCHAR
     
    8787        WORD    id;                             /* File system mount ID */
    8888        WORD    n_rootdir;              /* Number of root directory entries (FAT12/16) */
    89 #if _MAX_SS != _MIN_SS
     89#if FF_MAX_SS != FF_MIN_SS
    9090        WORD    ssize;                  /* Bytes per sector (512, 1024, 2048 or 4096) */
    9191#endif
    92 #if _FS_REENTRANT
    93         _SYNC_t sobj;                   /* Identifier of sync object */
    94 #endif
    95 #if !_FS_READONLY
     92#if FF_FS_REENTRANT
     93        FF_SYNC_t       sobj;                   /* Identifier of sync object */
     94#endif
     95#if !FF_FS_READONLY
    9696        DWORD   last_clust;             /* Last allocated cluster */
    9797        DWORD   free_clust;             /* Number of free clusters */
    9898#endif
    99 #if _FS_RPATH
     99#if FF_FS_RPATH
    100100        DWORD   cdir;                   /* Current directory start cluster (0:root) */
    101101#endif
     
    107107        DWORD   database;               /* Data start sector */
    108108        DWORD   winsect;                /* Current sector appearing in the win[] */
    109         BYTE    win[_MAX_SS];   /* Disk access window for Directory, FAT (and file data at tiny cfg) */
     109        BYTE    win[FF_MAX_SS]; /* Disk access window for Directory, FAT (and file data at tiny cfg) */
    110110} FATFS;
    111111
     
    124124        DWORD   clust;                  /* Current cluster of fpter (not valid when fprt is 0) */
    125125        DWORD   dsect;                  /* Sector number appearing in buf[] (0:invalid) */
    126 #if !_FS_READONLY
     126#if !FF_FS_READONLY
    127127        DWORD   dir_sect;               /* Sector number containing the directory entry */
    128128        BYTE*   dir_ptr;                /* Pointer to the directory entry in the win[] */
    129129#endif
    130 #if _USE_FASTSEEK
     130#if FF_USE_FASTSEEK
    131131        DWORD*  cltbl;                  /* Pointer to the cluster link map table (Nulled on file open) */
    132132#endif
    133 #if _FS_LOCK
     133#if FF_FS_LOCK != 0
    134134        UINT    lockid;                 /* File lock ID origin from 1 (index of file semaphore table Files[]) */
    135135#endif
    136 #if !_FS_TINY
    137         BYTE    buf[_MAX_SS];   /* File private data read/write window */
     136#if !FF_FS_TINY
     137        BYTE    buf[FF_MAX_SS]; /* File private data read/write window */
    138138#endif
    139139} FIL;
     
    141141
    142142
    143 /* Directory object structure (DIR) */
     143/* Directory object structure (FATFS_DIR) */
    144144
    145145typedef struct __dirstream {
     
    152152        BYTE*   dir;                    /* Pointer to the current SFN entry in the win[] */
    153153        BYTE*   fn;                             /* Pointer to the SFN (in/out) {file[8],ext[3],status[1]} */
    154 #if _FS_LOCK
     154#if FF_FS_LOCK != 0
    155155        UINT    lockid;                 /* File lock ID (index of file semaphore table Files[]) */
    156156#endif
    157 #if _USE_LFN
     157#if FF_USE_LFN
    158158        WCHAR*  lfn;                    /* Pointer to the LFN working buffer */
    159159        WORD    lfn_idx;                /* Last matched LFN index number (0xFFFF:No LFN) */
    160160#endif
    161 #if _USE_FIND
     161#if FF_USE_FIND
    162162        const TCHAR*    pat;    /* Pointer to the name matching pattern */
    163163#endif
    164 } DIR;
     164} FATFS_DIR;
    165165
    166166
     
    174174        BYTE    fattrib;                /* Attribute */
    175175        TCHAR   fname[13];              /* Short file name (8.3 format) */
    176 #if _USE_LFN
     176#if FF_USE_LFN
    177177        TCHAR*  lfname;                 /* Pointer to the LFN buffer */
    178178        UINT    lfsize;                 /* Size of LFN buffer in TCHAR */
     
    203203        FR_LOCKED,                              /* (16) The operation is rejected according to the file sharing policy */
    204204        FR_NOT_ENOUGH_CORE,             /* (17) LFN working buffer could not be allocated */
    205         FR_TOO_MANY_OPEN_FILES, /* (18) Number of open files > _FS_LOCK */
     205        FR_TOO_MANY_OPEN_FILES, /* (18) Number of open files > FF_FS_LOCK */
    206206        FR_INVALID_PARAMETER    /* (19) Given parameter is invalid */
    207207} FRESULT;
     
    220220FRESULT f_truncate (FIL* fp);                                                                           /* Truncate file */
    221221FRESULT f_sync (FIL* fp);                                                                                       /* Flush cached data of a writing file */
    222 FRESULT f_opendir (DIR* dp, const TCHAR* path);                                         /* Open a directory */
    223 FRESULT f_closedir (DIR* dp);                                                                           /* Close an open directory */
    224 FRESULT f_readdir (DIR* dp, FILINFO* fno);                                                      /* Read a directory item */
    225 FRESULT f_findfirst (DIR* dp, FILINFO* fno, const TCHAR* path, const TCHAR* pattern);   /* Find first file */
    226 FRESULT f_findnext (DIR* dp, FILINFO* fno);                                                     /* Find next file */
     222FRESULT f_opendir (FATFS_DIR* dp, const TCHAR* path);                                           /* Open a directory */
     223FRESULT f_closedir (FATFS_DIR* dp);                                                                             /* Close an open directory */
     224FRESULT f_readdir (FATFS_DIR* dp, FILINFO* fno);                                                        /* Read a directory item */
     225FRESULT f_findfirst (FATFS_DIR* dp, FILINFO* fno, const TCHAR* path, const TCHAR* pattern);     /* Find first file */
     226FRESULT f_findnext (FATFS_DIR* dp, FILINFO* fno);                                                       /* Find next file */
    227227FRESULT f_mkdir (const TCHAR* path);                                                            /* Create a sub directory */
    228228FRESULT f_unlink (const TCHAR* path);                                                           /* Delete an existing file or directory */
     
    270270
    271271/* RTC function */
    272 #if !_FS_READONLY && !_FS_NORTC
     272#if !FF_FS_READONLY && !FF_FS_NORTC
    273273DWORD get_fattime (void);
    274274#endif
    275275
    276276/* Unicode support functions */
    277 #if _USE_LFN                                                    /* Unicode - OEM code conversion */
     277#if FF_USE_LFN                                                  /* Unicode - OEM code conversion */
    278278WCHAR ff_convert (WCHAR chr, UINT dir); /* OEM-Unicode bidirectional conversion */
    279279WCHAR ff_wtoupper (WCHAR chr);                  /* Unicode upper-case conversion */
    280 #if _USE_LFN == 3                                               /* Memory functions */
     280#if FF_USE_LFN == 3                                             /* Memory functions */
    281281void* ff_memalloc (UINT msize);                 /* Allocate memory block */
    282282void ff_memfree (void* mblock);                 /* Free memory block */
     
    285285
    286286/* Sync functions */
    287 #if _FS_REENTRANT
    288 int ff_cre_syncobj (BYTE vol, _SYNC_t* sobj);   /* Create a sync object */
    289 int ff_req_grant (_SYNC_t sobj);                                /* Lock sync object */
    290 void ff_rel_grant (_SYNC_t sobj);                               /* Unlock sync object */
    291 int ff_del_syncobj (_SYNC_t sobj);                              /* Delete a sync object */
     287#if FF_FS_REENTRANT
     288int ff_cre_syncobj (BYTE vol, FF_SYNC_t* sobj); /* Create a sync object */
     289int ff_req_grant (FF_SYNC_t sobj);                              /* Lock sync object */
     290void ff_rel_grant (FF_SYNC_t sobj);                             /* Unlock sync object */
     291int ff_del_syncobj (FF_SYNC_t sobj);                            /* Delete a sync object */
    292292#endif
    293293
     
    304304#define FA_OPEN_EXISTING        0x00
    305305
    306 #if !_FS_READONLY
     306#if !FF_FS_READONLY
    307307#define FA_WRITE                        0x02
    308308#define FA_CREATE_NEW           0x04
    309309#define FA_CREATE_ALWAYS        0x08
    310310#define FA_OPEN_ALWAYS          0x10
    311 #define FA__WRITTEN                     0x20
    312 #define FA__DIRTY                       0x40
     311#define FA_OPEN_APPEND          0x30
     312#define FA_MODIFIED                     0x20
     313#define FA_DIRTY                        0x40
    313314#endif
    314315
     
    341342/* Multi-byte word access macros  */
    342343
    343 #if _WORD_ACCESS == 1   /* Enable word access to the FAT structure */
     344#if FF_WORD_ACCESS == 1 /* Enable word access to the FAT structure */
    344345#define LD_WORD(ptr)            (WORD)(*(WORD*)(BYTE*)(ptr))
    345346#define LD_DWORD(ptr)           (DWORD)(*(DWORD*)(BYTE*)(ptr))
Note: See TracChangeset for help on using the changeset viewer.