📄 fs_confdefaults.h
字号:
/*
**********************************************************************
* Micrium, Inc.
* 949 Crestview Circle
* Weston, FL 33327-1848
*
* uC/FS
*
* (c) Copyright 2001 - 2003, Micrium, Inc.
* All rights reserved.
*
***********************************************************************
----------------------------------------------------------------------
File : FS_ConfDefault.h
Purpose : File system configuration defaults
-------- END-OF-HEADER ---------------------------------------------
*/
#ifndef _FS_CONFDEFAULT_H_
#define _FS_CONFDEFAULT_H_
#include "fs_conf.h"
/*********************************************************************
*
* define global data types
*
**********************************************************************
*/
#ifndef FS_U32
#define FS_U32 unsigned long /* 32 bit unsigned */
#endif
#ifndef FS_I32
#define FS_I32 signed long /* 32 bit signed */
#endif
#ifndef FS_U16
#define FS_U16 unsigned short /* 16 bit unsigned */
#endif
#ifndef FS_I16
#define FS_I16 signed short /* 16 bit signed */
#endif
#ifndef FS_U8
#define FS_U8 unsigned char /* 8 bit unsigned */
#endif
#ifndef FS_SIZE_T
#define FS_SIZE_T FS_U32
#endif
/*********************************************************************
*
* Defaults for optimizations
*
**********************************************************************
*/
#ifndef FS_IS_LITTLE_ENDIAN
#define FS_IS_LITTLE_ENDIAN 0
#endif
#if FS_IS_LITTLE_ENDIAN
#define FS_WRITE_U16(pBuffer, Data) *(FS_U16*)pBuffer = Data
#define FS_READ_U16(pBuffer) (*(FS_U16*)pBuffer)
#else
#define FS_WRITE_U16(pBuffer, Data) \
* (FS_U8*)pBuffer = Data; \
*((FS_U8*)pBuffer + 1) = Data >> 8;
#define FS_READ_U16(pBuffer) ((*(FS_U8*)pBuffer) | (*((FS_U8*)pBuffer + 1) << 8))
#endif
/*********************************************************************
*
* Device Driver Support
*
**********************************************************************
*/
#ifndef FS_USE_SMC_DRIVER
#define FS_USE_SMC_DRIVER 0 /* SmartMedia card driver */
#endif
#ifndef FS_USE_IDE_DRIVER
#define FS_USE_IDE_DRIVER 0 /* IDE driver */
#endif
#ifndef FS_USE_WINDRIVE_DRIVER
#define FS_USE_WINDRIVE_DRIVER 0 /* Windows Logical Drive driver */
#endif
#ifndef FS_USE_RAMDISK_DRIVER
#define FS_USE_RAMDISK_DRIVER 0 /* RAM Disk driver */
#endif
#ifndef FS_USE_MMC_DRIVER
#define FS_USE_MMC_DRIVER 0 /* MMC/SD card driver */
#endif
#ifndef FS_USE_FLASH_DRIVER
#define FS_USE_FLASH_DRIVER 0 /* Generic flash driver */
#endif
#ifndef FS_USE_GENDEV_DRIVER
#define FS_USE_GENDEV_DRIVER 0 /* Generic device driver */
#endif
#ifndef FS_USE_SFLASH_DRIVER
#define FS_USE_SFLASH_DRIVER 0
#endif
#if (FS_USE_SMC_DRIVER == 0) && (FS_USE_IDE_DRIVER == 0) && \
(FS_USE_RAMDISK_DRIVER == 0) && (FS_USE_MMC_DRIVER == 0) && \
(FS_USE_FLASH_DRIVER == 0) && (FS_USE_WINDRIVE_DRIVER == 0) && \
(FS_USE_GENDEV_DRIVER == 0) && (FS_USE_SFLASH_DRIVER == 0)
#error Please define which Medium you want to use
#endif
#if (!defined(_WIN32) && (FS_USE_WINDRIVE_DRIVER))
#error Windows Logical Drive driver needs Windows API
#endif
/*********************************************************************
*
* File system defaults
*
**********************************************************************
*/
#ifndef FS_MAXOPEN
#define FS_MAXOPEN 2 /* Maximum number of file handles */
#endif
#ifndef FS_POSIX_DIR_SUPPORT
#define FS_POSIX_DIR_SUPPORT 1 /* POSIX 1003.1 like directory support */
#endif
#ifndef FS_DIR_MAXOPEN /* Maximum number of directory handles */
#define FS_DIR_MAXOPEN FS_POSIX_DIR_SUPPORT
#endif
#ifndef FS_SUPPORT_FAT
#define FS_SUPPORT_FAT 1 /* Support the FAT file system if enabled */
#endif
#ifndef FS_SUPPORT_EFS
#define FS_SUPPORT_EFS 0 /* Support the EFS file system if enabled */
#endif
#ifndef FS_SUPPORT_MULTIPLE_FS
#define FS_SUPPORT_MULTIPLE_FS 0 /* Currently, only FAT is supported -> No need to switch it on */
#endif
#ifndef FS_SUPPORT_BURST /* Burst support, allows read/write of multiple sectors at a time (speed opt.) */
#define FS_SUPPORT_BURST (FS_USE_IDE_DRIVER || FS_USE_SMC_DRIVER || FS_USE_WINDRIVE_DRIVER || FS_USE_RAMDISK_DRIVER)
#endif
#ifndef FS_SUPPORT_VAR_SECTOR_SIZE
#define FS_SUPPORT_VAR_SECTOR_SIZE 0 /* Support for variabled, non standard sector sizes (!= 512) */
#endif
#ifndef FS_SUPPORT_FREE_SECTOR
#define FS_SUPPORT_FREE_SECTOR FS_USE_FLASH_DRIVER /* Informs lower layer of unused sectors ... Makes sense only for drivers which use it */
#endif
#ifndef FS_SUPPORT_CACHE
#define FS_SUPPORT_CACHE 0
#endif
#if (FS_SUPPORT_EFS==1) && (FS_SUPPORT_FAT==1)
#error EFS and FAT can not be used simultaneously
#endif
/*********************************************************************
*
* FAT File System Layer defines
*
* For each media in your system using FAT, the file system reserves
* memory to keep required information of the boot sector of that media.
* FS_MAXDEV is the number of device drivers in your system used
* with FAT, FS_FAT_MAXUNIT is the maximum number of logical units
* supported by one of the activated drivers.
*/
/* For compatibility */
#ifdef FS_FAT_NOFORMAT /* 1 disables code for formatting a media */
#define FS_FAT_SUPPORT_FORMAT (!FS_FAT_NOFORMAT)
#endif
/* For compatibility */
#ifdef FS_FAT_NOFAT32 /* 1 disables FAT32 support */
#define FS_FAT_SUPPORT_FAT32 (!FS_FAT_NOFAT32)
#endif
#ifndef FS_FAT_SUPPORT_FORMAT /* 0 disables code for formatting a media */
#define FS_FAT_SUPPORT_FORMAT 1
#endif
#ifndef FS_FAT_SUPPORT_FAT32 /* 0 disables FAT32 support */
#define FS_FAT_SUPPORT_FAT32 1
#endif
#ifndef FS_FAT_DISKINFO /* 0 disables command FS_CMD_GET_DISKFREE */
#define FS_FAT_DISKINFO 1
#endif
#ifndef FS_FAT_SUPPORT_LFN /* 1 enables long file name support */
#define FS_FAT_SUPPORT_LFN 0
#endif
#ifndef FS_FAT_FWRITE_UPDATE_DIR /* 1: FS_FWrite updates directory entry (safer, but slower) */
/* 0: Directory entry is updated by FS_FClose (faster) */
#define FS_FAT_FWRITE_UPDATE_DIR 1
#endif
#ifndef FS_SEC_SIZE
#define FS_SEC_SIZE 512 /* standard value for FAT system. */
#endif
#ifndef FS_MAINTAIN_FAT_COPY
#define FS_MAINTAIN_FAT_COPY 0
#endif
/*********************************************************************
*
* EFS File System Layer defines
*
*/
#ifndef FS_EFS_SUPPORT_FORMAT /* 0 disables code for formatting a media */
#define FS_EFS_SUPPORT_FORMAT 1
#endif
#ifndef FS_EFS_SUPPORT_DISKINFO /* 0 disables command FS_CMD_GET_DISKFREE */
#define FS_EFS_SUPPORT_DISKINFO 1
#endif
#ifndef FS_EFS_FWRITE_UPDATE_DIR /* 1 FS_FWrite modifies directory (default), 0 directory is modified by FS_FClose */
#define FS_EFS_FWRITE_UPDATE_DIR 0
#endif
#ifndef FS_EFS_CASE_SENSITIVE
#define FS_EFS_CASE_SENSITIVE 0 /* Should the file/directory names be case sensitively compared */
#endif
/*********************************************************************
*
* File system support sector access
*/
#ifndef FS_SUPPORT_SEC_ACCESS
#define FS_SUPPORT_SEC_ACCESS 1
#endif
/*********************************************************************
*
* Directory name length
*/
#ifndef FS_DIRNAME_MAX
#if FS_SUPPORT_FAT
#if FS_FAT_SUPPORT_LFN
#define FS_DIRNAME_MAX 150 /* Maximum size of a directory name */
#else
#define FS_DIRNAME_MAX 13 /* Maximum size of a directory name */
#endif
#endif
#if FS_SUPPORT_EFS
#define FS_DIRNAME_MAX 150 /* Maximum size of a directory name */
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -