⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 filesys.h

📁 PDA上的CF CARD 文件系统的建立程式
💻 H
字号:
/****************************************************************
;*								*
;*		 INSTUTITE FOR INFORMATION INDUSTRY		*
;*		Generic file system API header file		*
;*			  April. 17, 2001			*
;*								*
;*								*
;* Note: Please define machine type by compiler parameter	*
;*	 e.g. cc68000 -DMACHINE_TYPE_M68EZ328			*
;****************************************************************/
#ifndef _FILE_SYS_H
#define _FILE_SYS_H

#include <pr2k.h>

/**************************************************************
	C++ SUPPORT
**************************************************************/

#ifdef	__cplusplus
extern	"C"	{
#endif
/*
#ifdef _PROCOMP_
  #include "/rtos/driver/filesys/fsutils.h"
#else
  #include "fsutils.h"
#endif
*/

#ifdef __WIN32__
#define  ap_malloc   sc_malloc
#define  ap_free     sc_free
#endif

//******************************** jason
/*#define open		fs_open
#define close		fs_close
#define read		fs_read
#define write		fs_write
#define lseek		fs_lseek
#define filelength	fs_filelength
#define remove		fs_delfile
#define truncate	fs_truncate
#define findfirst	fs_findfirst
#define findnext	fs_findnext
#define eof			fs_eof
*/


//#define     CF_DISK             0
//#define     NF_DISK             1

/**** added by chilong 02/05/2002 ****/
#define CHINESE_CODE_USED
/**** added by chilong 02/05/2002 ****/
                  
#define NAND_FSS_USE_CACHE
// change mode
//#define FS_CHANGE_MODE_ENABLED

#define FAT_WITH_INTERRUPT

// Activate the debug mode. Debug messages are sent via RS232.
//#define FILESYS_DEBUG

// Activate the NAND flash backup functionality.
// If this is activated, please don't use the NAND flash disk.
//#define NAND_BACKUP_ON

// Activate current directory
#define FS_CURRENT_DIRECTORY_ENABLED


// maximum number of device supported
#define DEVICE_NUM	4

// device IDs (currently supports flash disk & RAMDisk
// the device IDs determine the drive name of a device
// 0 ==> 1st drive	1 ==> 2nd drive
// if a ID has not defined or its value is -1, the device is not used
//   also the ID must be smaller than DEVICE_NUM defined above

/*
#if defined(CHIPMOS)||defined(PR2001B)
#define FAT_ID 1
#endif
*/
#define FAT_ID 1     // by zhang xue ping

//#define NOR_FLASH_DISK_ID 1
#ifndef __WIN32__
#define RAMDISK_ID 2
#endif
#define NAND_FLASH_DISK_ID 0	// please comment out this line if NAND_BACKUP_ON is activated


// file system related
#define	BEGIN_DRIVE_NAME		'A'
#define BACKUP_DRIVE_NAME		'A'

#define RESERVED_HANDLE		3	// 0, 1, and 2 are reserved
#define MAX_OPEN_FILE		100
//#define FNAME_LEN		51	// the shortest one among the max file lengths of the file system drivers

/**** modified by chilong ****/
#define FNAME_LEN		50	// the shortest one among the max file lengths of the file system drivers
/**** modified by chilong ****/

#define MAX_PATHNAME_LEN	114	// the maximum length of a pathname

// File permission
#define O_APPEND	(0x01)	/* Write from the end of the file */
#define O_CREATE	(0x02)  /* If file not exist, create it */
#define O_CREAT		(0x02)  /* If file not exist, create it */
#define O_RDONLY	(0x04)  /* The file is Read Only, DOS 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -