📄 flchkdef.h
字号:
*
* Starting from TrueFFS 5.1 the LOW_LEVEL was changed to FL_LOW_LEVEL
* The reason was that it clashed with Windows NT LOW_LEVEL macro.
*/
#ifndef FL_LOW_LEVEL
#ifdef LOW_LEVEL
#define FL_LOW_LEVEL
#endif /* LOW_LEVEL */
#endif /* FL_LOW_LEVEL */
/* Validity check for FL_SYS_FUNC_RELEASE
*
* Starting from TrueFFS 6.0 the flExit routine calls this macro in
* order to inform the OS/FS that it is about to leave.
*/
#ifndef FL_SYS_FUNC_RELEASE
#define FL_SYS_FUNC_RELEASE
#endif /* FL_SYS_FUNC_RELEASE */
/* Validity check for FL_LowerPriorityThread and FL_RaisePriorityThread
*
* Starting from TrueFFS 6.0 the MTD waitForReady routine calls these macro
* allowing the OS to lower the driver's priorety during the long wait.
*/
#ifndef FL_LowerPriorityThread
#define FL_LowerPriorityThread(myFlash)
#endif /* FL_LowerPriorityThread */
#ifndef FL_RaisePriorityThread
#define FL_RaisePriorityThread(myFlash)
#endif /* FL_RaisePriorityThread */
/* Validiy check for FL_MALLOC and FL_FREE macroes
*
* Starting from TrueFFS 5.0 the FREE and MALLOC macroes were
* changed to FL_MALLOC and FL_FREE in order to avoid name clashes.
* In order to keep backwards compatibility with previous flsystem.h
* files the following new defintions checks were added.
* if your system uses the FREE and MALLOC defintion simply comment
* them out and customized the FL_MALLOC and FL_FREE macroes in your
* flsystem.h file.
*/
#if (defined(MALLOC) && !defined(FL_MALLOC))
#define FL_MALLOC MALLOC
#endif /* MALLOC && ! FL_MALLOC */
#if (defined(FREE) && !defined(FL_FREE))
#define FL_FREE FREE
#endif /* FREE && ! FL_FREE */
/* Validity check for FL_FAR_MALLOC and FL_FAR_FREE
* Due to the BIOS driver memory limitations a dedicated routine
* is used for allocating the large ram arrays.
*/
#if (defined(FL_MALLOC) && !defined(FL_FAR_MALLOC))
#define FL_FAR_MALLOC FL_MALLOC
#endif /* FL_MALLOC && ! FL_FAR_MALLOC */
#if (defined(FL_FREE) && !defined(FL_FAR_FREE))
#define FL_FAR_FREE FL_FREE
#endif /* FL_MALLOC && ! FL_FAR_MALLOC */
/* Validiy check for debug printing
*
* Starting from TrueFFS 6.0 there are 6 types of debug print
* In case they were not customized in flsystem.h they are defined here
* as NULL.
*/
#ifndef DBG_PRINT_FLOW
#define DBG_PRINT_FLOW(zone,str) /* if (zone & (ACTIVE_DEBUG_ZONE)) printf (str) */
#endif
#ifndef DBG_PRINT_ERR
#define DBG_PRINT_ERR(zone,str) /* if (zone & (ACTIVE_DEBUG_ZONE)) printf (str) */
#endif
#ifndef DBG_PRINT_WRN
#define DBG_PRINT_WRN(zone,str) /* if (zone & (ACTIVE_DEBUG_ZONE)) printf (str) */
#endif
#ifndef DBG_PRINT_FLOW_PRM
#define DBG_PRINT_FLOW_PRM(zone,str) /* if (zone & (ACTIVE_DEBUG_ZONE)) printf str */
#endif
#ifndef DBG_PRINT_ERR_PRM
#define DBG_PRINT_ERR_PRM(zone,str) /* if (zone & (ACTIVE_DEBUG_ZONE)) printf str */
#endif
#ifndef DBG_PRINT_WRN_PRM
#define DBG_PRINT_WRN_PRM(zone,str) /* if (zone & (ACTIVE_DEBUG_ZONE)) printf str */
#endif
#ifndef DFORMAT_PRINT
#define DFORMAT_PRINT(a) DBG_PRINT_WRN_PRM(FLZONE_FORMAT,a)
#endif
#ifndef DEBUG_PRINT
#define DEBUG_PRINT(a) DBG_PRINT_WRN(FLZONE_FULL,a)
#endif
/* TrueFFS used to export several basic types. These type were changed in * TrueFFS 6.0 , but to allows old application based on these type to function * we keep exporting them */#ifndef FL_DISABLE_OLD_TRUEFFS_TYPES
typedef unsigned char byte; /* 8 bit unsigned variable */
typedef unsigned short word; /* 16 bit unsigned variable */
typedef unsigned long dword; /* 32 bit unsigned variable */
typedef signed char Sbyte; /* 8 bit signed variable */
typedef signed short Sword; /* 16 bit signed variable */
typedef signed long Sdword; /* 32 bit signed variable */
#endif /* FL_DISABLE_OLD_TRUEFFS_TYPES */
/* For backwards competability we make sure tffsxxx is defined as flxxx
*
* Versions prior to 6.1 (when ENVIRONMENT_VARS was defined) the user was
* required to customize 2 sets of DiskOnChip memory access routines.
* (flxxx and flmemxxx). One set was for fast memory access and one
* implemented a simple for loop for maximum platform portability. Newer
* versions automatically implement the simple for loop allowing easier
* customization. The new customiation model allows the user to customize
* only the tffsxxx routines regardless of the compilation flag
*/
#ifdef ENVIRONMENT_VARS
#ifndef tffscpy
#define tffscpy flcpy
#endif /* tffscpy */
#ifndef tffscmp
#define tffscmp flcmp
#endif /* tffscmp */
#ifndef tffsset
#define tffsset flset
#endif /* tffsset */
#endif /* ENVIRONMENT_VARS */
/* Macro for converting text to string */
#ifndef FLTXT
#define FLTXT
#endif /* FLTXT */
/*****************************//* M-Systems forced defaults *//*****************************//* define IO memory access macros - must be defined in flsystem.h */
#ifndef FLWRITE_IO_BYTE
#define FLWRITE_IO_BYTE(val,address) *((volatile FLByte FAR0*)(address))=(FLByte)(val)
#endif
#ifndef FLWRITE_IO_WORD
#define FLWRITE_IO_WORD(val,address) *((volatile FLWord FAR0*)(address))=(FLWord)(val)
#endif
#ifndef FLWRITE_IO_DWORD
#define FLWRITE_IO_DWORD(val,address) *((volatile FLDword FAR0*)(address))=(FLDword)(val)
#endif
#ifndef TFFSCPY_FROM_IO_8_BITS
#ifdef TFFSCPY_FROM_IO
#define TFFSCPY_FROM_IO_8_BITS TFFSCPY_FROM_IO
#else
#define TFFSCPY_FROM_IO_8_BITS(dest,src,count) tffscpy(dest,(void FAR0*)(src),count)
#endif
#endif /* TFFSCPY_FROM_IO_8_BITS */
#ifndef TFFSCPY_FROM_IO_16_BITS
#ifdef TFFSCPY_FROM_IO
#define TFFSCPY_FROM_IO_16_BITS TFFSCPY_FROM_IO
#else
#define TFFSCPY_FROM_IO_16_BITS(dest,src,count) tffscpy(dest,(void FAR0*)(src),count)
#endif
#endif /* TFFSCPY_FROM_IO_16_BITS */
#ifndef FLREAD_IO_BYTE
#define FLREAD_IO_BYTE(address) (*((volatile FLByte FAR0*)(address)))
#endif
#ifndef FLREAD_IO_WORD
#define FLREAD_IO_WORD(address) (*((volatile FLWord FAR0*)(address)))
#endif
#ifndef FLREAD_IO_DWORD
#define FLREAD_IO_DWORD(address) (*((volatile FLDword FAR0*)(address)))
#endif
#ifndef TFFSCPY_TO_IO_8_BITS
#ifdef TFFSCPY_TO_IO
#define TFFSCPY_TO_IO_8_BITS TFFSCPY_TO_IO
#else
#define TFFSCPY_TO_IO_8_BITS(dest,src,count) tffscpy((void FAR0*)(dest),src,count)
#endif
#endif /* TFFSCPY_TO_IO_8_BITS */
#ifndef TFFSCPY_TO_IO_16_BITS
#ifdef TFFSCPY_TO_IO
#define TFFSCPY_TO_IO_16_BITS TFFSCPY_TO_IO
#else
#define TFFSCPY_TO_IO_16_BITS(dest,src,count) tffscpy((void FAR0*)(dest),src,count)
#endif
#endif /* TFFSCPY_TO_IO_16_BITS */
#ifndef TFFSSET_IO_8_BITS
#ifdef TFFSSET_IO
#define TFFSSET_IO_8_BITS TFFSSET_IO
#else
#define TFFSSET_IO_8_BITS(dest,val,count) tffsset((void FAR0*)(dest),val,count)
#endif
#endif /* TFFSSET_IO_8_BITS */
#ifndef TFFSSET_IO_16_BITS
#ifdef TFFSSET_IO
#define TFFSSET_IO_16_BITS TFFSSET_IO
#else
#define TFFSSET_IO_16_BITS(dest,val,count) tffsset((void FAR0*)(dest),val,count)
#endif
#endif /* TFFSSET_IO_16_BITS */
/* The FAT-LITE/SURE-FS API definitions were added the FL_ prefix.
*
* Starting from TrueFFS 6.2
*/
#ifndef FL_FILES
#ifdef FILES
#define FL_FILES FILES
#endif /* FILES */#endif /* FL_FILES */
#ifndef FILE_IS_ROOT_DIR
#define FILE_IS_ROOT_DIR FL_FILE_IS_ROOT_DIR
#endif
#ifndef FILE_MODIFIED
#define FILE_MODIFIED FL_FILE_MODIFIED
#endif
#ifndef FILE_IS_OPEN
#define FILE_IS_OPEN FL_FILE_IS_OPEN
#endif
#ifndef FILE_IS_DIRECTORY
#define FILE_IS_DIRECTORY FL_FILE_IS_DIRECTORY
#endif
#ifndef FILE_READ_ONLY
#define FILE_READ_ONLY FL_FILE_READ_ONLY
#endif
#ifndef FILE_MUST_OPEN
#define FILE_MUST_OPEN FL_FILE_MUST_OPEN
#endif
#ifndef ATTR_READ_ONLY
#define ATTR_READ_ONLY FL_ATTR_READ_ONLY
#endif
#ifndef ATTR_HIDDEN
#define ATTR_HIDDEN FL_ATTR_HIDDEN
#endif
#ifndef ATTR_SYSTEM
#define ATTR_SYSTEM FL_ATTR_SYSTEM
#endif
#ifndef ATTR_VOL_LABEL
#define ATTR_VOL_LABEL FL_ATTR_VOL_LABEL
#endif
#ifndef ATTR_DIRECTORY
#define ATTR_DIRECTORY FL_ATTR_DIRECTORY
#endif
#ifndef ATTR_ARCHIVE
#define ATTR_ARCHIVE FL_ATTR_ARCHIVE
#endif
#ifndef SEEK_START
#define SEEK_START FL_SEEK_START
#endif
#ifndef SEEK_CURR
#define SEEK_CURR FL_SEEK_CURR
#endif
#ifndef SEEK_END
#define SEEK_END FL_SEEK_END
#endif
#ifndef SET_DATETIME
#define SET_DATETIME FL_SET_DATETIME
#endif
#ifndef SET_ATTRIBUTES
#define SET_ATTRIBUTES FL_SET_ATTRIBUTES
#endif
#ifndef FIND_BY_HANDLE
#define FIND_BY_HANDLE FL_FIND_BY_HANDLE
#endif
#ifndef SET_CREATE_DATETIME
#define SET_CREATE_DATETIME FL_SET_CREATE_DATETIME
#endif
#ifndef ACCESS_READ_WRITE
#define ACCESS_READ_WRITE FL_ACCESS_READ_WRITE
#endif
#ifndef ACCESS_CREATE
#define ACCESS_CREATE FL_ACCESS_CREATE
#endif
#ifndef OPEN_FOR_READ
#define OPEN_FOR_READ FL_OPEN_FOR_READ
#endif
#ifndef OPEN_FOR_UPDATE
#define OPEN_FOR_UPDATE FL_OPEN_FOR_UPDATE
#endif
#ifndef OPEN_FOR_WRITE
#define OPEN_FOR_WRITE FL_OPEN_FOR_WRITE
#endif
#endif /* _FL_CHK_DEFS_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -