亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? main.i

?? this source is for sd mmc read write in fat file system for atmega64
?? I
?? 第 1 頁 / 共 5 頁
字號:
/  tff.c current Port ver:1.0
/
/---------------------------------------------------------------------------/
/ The FatFs module is an experimenal project to implement FAT file system to
/ cheap microcontrollers. This is a free software and is opened for education,
/ research and development under license policy of following trems.
/
/  Copyright (C) 2007, ChaN, all right reserved.
/
/ * The FatFs module is a free software and there is no warranty.
/ * You can use, modify and/or redistribute it for personal, non-profit or
/   profit use without any restriction under your responsibility.
/ * Redistributions of source code must retain the above copyright notice.
/
/---------------------------------------------------------------------------/
/  Feb 26, 2006  R0.00  Prototype.
/  Apr 29, 2006  R0.01  First stable version.
/  Jun 01, 2006  R0.02  Added FAT12 support.
/                       Removed unbuffered mode.
/                       Fixed a problem on small (<32M) patition.
/  Jun 10, 2006  R0.02a Added a configuration option (_FS_MINIMUM).
/  Sep 22, 2006  R0.03  Added f_rename().
/                       Changed option _FS_MINIMUM to _FS_MINIMIZE.
/  Dec 09, 2006  R0.03a Improved cluster scan algolithm to write files fast.
/  Feb 04, 2007  R0.04  Added FAT32 supprt.
/                       Changed some interfaces incidental to FatFs.
/                       Changed f_mountdrv() to f_mount().
/  Apr 01, 2007  R0.04a Added a capability of extending file size to f_lseek().
/                       Added minimization level 3.
/                       Fixed a problem in FAT32 support.
/  May 05, 2007  R0.04b Added a configuration option _USE_NTFLAG.
/                       Added FSInfo support.
/                       Fixed some problems corresponds to FAT32 support.
/                       Fixed DBCS name can result FR_INVALID_NAME.
/                       Fixed short seek (<= csize) collapses the file object.
/  Aug 25, 2007  R0.05  Changed arguments of f_read() and f_write().
/---------------------------------------------------------------------------*/

// CodeVisionAVR C Compiler
// (C) 1998-2005 Pavel Haiduc, HP InfoTech S.R.L.

// Prototypes for string functions



#pragma used+

char *strcat(char *str1,char *str2);
char *strcatf(char *str1,char flash *str2);
char *strchr(char *str,char c);
signed char strcmp(char *str1,char *str2);
signed char strcmpf(char *str1,char flash *str2);
char *strcpy(char *dest,char *src);
char *strcpyf(char *dest,char flash *src);
unsigned char strcspn(char *str,char *set);
unsigned char strcspnf(char *str,char flash *set);
unsigned int strlenf(char flash *str);
char *strncat(char *str1,char *str2,unsigned char n);
char *strncatf(char *str1,char flash *str2,unsigned char n);
signed char strncmp(char *str1,char *str2,unsigned char n);
signed char strncmpf(char *str1,char flash *str2,unsigned char n);
char *strncpy(char *dest,char *src,unsigned char n);
char *strncpyf(char *dest,char flash *src,unsigned char n);
char *strpbrk(char *str,char *set);
char *strpbrkf(char *str,char flash *set);
signed char strpos(char *str,char c);
char *strrchr(char *str,char c);
char *strrpbrk(char *str,char *set);
char *strrpbrkf(char *str,char flash *set);
signed char strrpos(char *str,char c);
char *strstr(char *str1,char *str2);
char *strstrf(char *str1,char flash *str2);
unsigned char strspn(char *str,char *set);
unsigned char strspnf(char *str,char flash *set);
char *strtok(char *str1,char flash *str2);
 

unsigned int strlen(char *str);
void *memccpy(void *dest,void *src,char c,unsigned n);
void *memchr(void *buf,unsigned char c,unsigned n);
signed char memcmp(void *buf1,void *buf2,unsigned n);
signed char memcmpf(void *buf1,void flash *buf2,unsigned n);
void *memcpy(void *dest,void *src,unsigned n);
void *memcpyf(void *dest,void flash *src,unsigned n);
void *memmove(void *dest,void *src,unsigned n);
void *memset(void *buf,unsigned char c,unsigned n);

#pragma used-
#pragma library string.lib


/*--------------------------------------------------------------------------/
/  Tiny-FatFs - FAT file system module include file  R0.05    (C)ChaN, 2007
/
/  Ported To CodevisionAVR By Behzad Khazama www.khazama.com Sabzevar-IRAN 2007
/  tff.h current Port ver:1.0
/
/---------------------------------------------------------------------------/
/ FatFs module is an experimenal project to implement FAT file system to
/ cheap microcontrollers. This is a free software and is opened for education,
/ research and development under license policy of following trems.
/
/  Copyright (C) 2007, ChaN, all right reserved.
/
/ * The FatFs module is a free software and there is no warranty.
/ * You can use, modify and/or redistribute it for personal, non-profit or
/   profit use without any restriction under your responsibility.
/ * Redistributions of source code must retain the above copyright notice.
/
/---------------------------------------------------------------------------*/


/* The _MCU_ENDIAN defines which access method is used to the FAT structure.
/  1: Enable word access.
/  2: Disable word access and use byte-by-byte access instead.
/  When the architectural byte order of the MCU is big-endian and/or address
/  miss-aligned access results incorrect behavior, the _MCU_ENDIAN must be set
/  to 2. If it is not the case, it can be set to 1 for good code efficiency. */

/* Setting _FS_READONLY to 1 defines read only configuration. This removes
/  writing functions, f_write, f_sync, f_unlink, f_mkdir, f_chmod, f_rename
/  and useless f_getfree. */

/* The _FS_MINIMIZE option defines minimization level to remove some functions.
/  0: Full function.
/  1: f_stat, f_getfree, f_unlink, f_mkdir, f_chmod and f_rename are removed.
/  2: f_opendir and f_readdir are removed in addition to level 1.
/  3: f_lseek is removed in addition to level 2. */

/* To enable FAT32 support in addition of FAT12/16, set _FAT32 to 1. */

/* To enable FSInfo support on FAT32 volume, set _USE_FSINFO to 1. */

/* When _USE_SJIS is set to 1, Shift-JIS code transparency is enabled, otherwise
/  only US-ASCII(7bit) code can be accepted as file/directory name. */

/* When _USE_NTFLAG is set to 1, upper/lower case of the file name is preserved.
/  Note that the files are always accessed in case insensitive. */










/* Type definition for cluster number */
typedef DWORD	CLUST;
typedef DWORD	CLUST;


/* File system object structure */
typedef struct _FATFS {
	WORD	id;				/* File system mount ID */
	WORD	n_rootdir;		/* Number of root directory entries */
	DWORD	winsect;		/* Current sector appearing in the win[] */
	DWORD	fatbase;		/* FAT start sector */
	DWORD	dirbase;		/* Root directory start sector */
	DWORD	database;		/* Data start sector */
	CLUST	sects_fat;		/* Sectors per fat */
	CLUST	max_clust;		/* Maximum cluster# + 1 */
	CLUST	last_clust;		/* Last allocated cluster */
	CLUST	free_clust;		/* Number of free clusters */
	DWORD	fsi_sector;		/* fsinfo sector */
	BYTE	fsi_flag;		/* fsinfo dirty flag (1:must be written back) */
	BYTE	pad1;
	BYTE	fs_type;		/* FAT sub type */
	BYTE	sects_clust;	/* Sectors per cluster */
	BYTE	n_fats;			/* Number of FAT copies */
	BYTE	winflag;		/* win[] dirty flag (1:must be written back) */
	BYTE	win[512];		/* Disk access window for Directory/FAT/File */
} FATFS;


/* Directory object structure */
typedef struct _DIR {
	WORD	id;			/* Owner file system mount ID */
	WORD	index;		/* Current index */
	FATFS*	fs;			/* Pointer to the owner file system object */
	CLUST	sclust;		/* Start cluster */
	CLUST	clust;		/* Current cluster */
	DWORD	sect;		/* Current sector */
} DIR;


/* File object structure */
typedef struct _FIL {
	WORD	id;				/* Owner file system mount ID */
	BYTE	flag;			/* File status flags */
	BYTE	sect_clust;		/* Left sectors in cluster */
	FATFS*	fs;				/* Pointer to owner file system */
	DWORD	fptr;			/* File R/W pointer */
	DWORD	fsize;			/* File size */
	CLUST	org_clust;		/* File start cluster */
	CLUST	curr_clust;		/* Current cluster */
	DWORD	curr_sect;		/* Current sector */
	DWORD	dir_sect;		/* Sector containing the directory entry */
	BYTE*	dir_ptr;		/* Ponter to the directory entry in the window */
} FIL;


/* File status structure */
typedef struct _FILINFO {
	DWORD fsize;			/* Size */
	WORD fdate;				/* Date */
	WORD ftime;				/* Time */
	BYTE fattrib;			/* Attribute */
	char fname[8+1+3+1];	/* Name (8.3 format) */
} FILINFO;


/* File function return code (FRESULT) */

typedef enum {
	FR_OK = 0,			  /* 0 */
	FR_NOT_READY,		  /* 1 */
	FR_NO_FILE,			  /* 2 */
	FR_NO_PATH,			  /* 3 */
	FR_INVALID_NAME,	/* 4 */
	FR_INVALID_DRIVE,	/* 5 */
	FR_DENIED,			  /* 6 */
	FR_EXIST,			    /* 7 */
	FR_RW_ERROR,		  /* 8 */
	FR_WRITE_PROTECTED,/* 9 */
	FR_NOT_ENABLED,		/* 10 */
	FR_NO_FILESYSTEM,	/* 11 */
	FR_INVALID_OBJECT	/* 12 */
} FRESULT;



/*-----------------------------------------------------*/
/* FatFs module application interface                  */

FRESULT f_mount (BYTE, FATFS*);						/* Mount/Unmount a logical drive */
FRESULT f_open (FIL*, const char*, BYTE);			/* Open or create a file */
FRESULT f_read (FIL*, void*, UINT, UINT*);			/* Read data from a file */
FRESULT f_write (FIL*, const void*, UINT, UINT*);	/* Write data to a file */
FRESULT f_lseek (FIL*, DWORD);						/* Move file pointer of a file object */
FRESULT f_close (FIL*);								/* Close an open file object */
FRESULT f_opendir (DIR*, const char*);				/* Open an existing directory */
FRESULT f_readdir (DIR*, FILINFO*);					/* Read a directory item */
FRESULT f_stat (const char*, FILINFO*);				/* Get file status */
FRESULT f_getfree (const char*, DWORD*, FATFS**);	/* Get number of free clusters on the drive */
FRESULT f_sync (FIL*);								/* Flush cached data of a writing file */
FRESULT f_unlink (const char*);						/* Delete an existing file or directory */
FRESULT	f_mkdir (const char*);						/* Create a new directory */
FRESULT f_chmod (const char*, BYTE, BYTE);			/* Change file/dir attriburte */
FRESULT f_rename (const char*, const char*);		/* Rename/Move a file or directory */


/* User defined function to give a current time to fatfs module */

DWORD get_fattime (void);	/* 31-25: Year(0-127 +1980), 24-21: Month(1-12), 20-16: Day(1-31) */
							/* 15-11: Hour(0-23), 10-5: Minute(0-59), 4-0: Second(0-29 *2) */



/* File access control and file status flags (FIL.flag) */

          

/* FAT sub type (FATFS.fs_type) */



/* File attribute bits for directory entry */

/* Offset of FAT structure members */








/* Multi-byte word access macros  */

                                  


/*-----------------------------------------------------------------------
/  Low level disk interface modlue include file  R0.05   (C)ChaN, 2007
/-----------------------------------------------------------------------*/






					














static
static
FATFS *FatFs;			/* Pointer to the file system objects (logical drive) */
static
WORD fsid;				/* File system mount ID */


/*-------------------------------------------------------------------------

  Module Private Functions

-------------------------------------------------------------------------*/


/*-----------------------------------------------------------------------*/
/* Change window offset                                                  */
/*-----------------------------------------------------------------------*/

static
BOOL move_window (		/* TRUE: successful, FALSE: failed */
	DWORD sector		/* Sector number to make apperance in the FatFs->win */
)						/* Move to zero only writes back dirty window */
{
	DWORD wsect;
	FATFS *fs = FatFs;


	wsect = fs->winsect;
	if (wsect != sector) {	/* Changed current window */
		BYTE n;
		if (fs->winflag) {	/* Write back dirty window if needed */
			if (disk_write(0, fs->win, wsect, 1) != RES_OK)
				return FALSE;
			fs->winflag = 0;
			if (wsect < (fs->fatbase + fs->sects_fat)) {	/* In FAT area */
				for (n = fs->n_fats; n >= 2; n--) {	/* Refrect the change to all FAT copies */
					wsect += fs->sects_fat;
					disk_write(0, fs->win, wsect, 1);
				}
			}
		}
		if (sector) {
			if (disk_read(0, fs->win, sector, 1) != RES_OK)
				return FALSE;
			fs->winsect = sector;
		}
	}
	return TRUE;
}




/*-----------------------------------------------------------------------*/
/* Clean-up cached data                                                  */
/*-----------------------------------------------------------------------*/

static
FRESULT sync (void)		/* FR_OK: successful, FR_RW_ERROR: failed */
{
	FATFS *fs = FatFs;


	fs->winflag = 1;
	if (!move_window(0)) return FR_RW_ERROR;
	/* Update FSInfo sector if needed */
	if (fs->fs_type == 3 && fs->fsi_flag) {
		fs->winsect = 0;
		memset(fs->win, 0, 512);
		*(volatile BYTE*)(&fs->win[510])=(BYTE)(0xAA55); *(volatile BYTE*)((&fs->win[510])+1)=(BYTE)((WORD)(0xAA55)>>8);
		*(volatile BYTE*)(&fs->win[0])=(BYTE)(0x41615252); *(volatile BYTE*)((&fs->win[0])+1)=(BYTE)((WORD)(0x41615252)>>8); *(volatile BYTE*)((&fs->win[0])+2)=(BYTE)((DWORD)(0x41615252)>>16); *(volatile BYTE*)((&fs->win[0])+3)=(BYTE)((DWORD)(0x41615252)>>24);
		*(volatile BYTE*)(&fs->win[484])=(BYTE)(0x61417272); *(volatile BYTE*)((&fs->win[484])+1)=(BYTE)((WORD)(0x61417272)>>8); *(volatile BYTE*)((&fs->win[484])+2)=(BYTE)((DWORD)(0x61417272)>>16); *(volatile BYTE*)((&fs->win[484])+3)=(BYTE)((DWORD)(0x61417272)>>24);
		*(volatile BYTE*)(&fs->win[488])=(BYTE)(fs->free_clust); *(volatile BYTE*)((&fs->win[488])+1)=(BYTE)((WORD)(fs->free_clust)>>8); *(volatile BYTE*)((&fs->win[488])+2)=(BYTE)((DWORD)(fs->free_clust)>>16); *(volatile BYTE*)((&fs->win[488])+3)=(BYTE)((DWORD)(fs->free_clust)>>24);
		*(volatile BYTE*)(&fs->win[492])=(BYTE)(fs->last_clust); *(volatile BYTE*)((&fs->win[492])+1)=(BYTE)((WORD)(fs->last_clust)>>8); *(volatile BYTE*)((&fs->win[492])+2)=(BYTE)((DWORD)(fs->last_clust)>>16); *(volatile BYTE*)((&fs->win[492])+3)=(BYTE)((DWORD)(fs->last_clust)>>24);
		disk_write(0, fs->win, fs->fsi_sector, 1);
		fs->fsi_flag = 0;
	}
	/* Make sure that no pending write process in the physical drive */
	if (disk_ioctl(0, 0	, 0) != RES_OK) return FR_RW_ERROR;
	return FR_OK;
}




/*-----------------------------------------------------------------------*/
/* Get a cluster status                                                  */
/*-----------------------------------------------------------------------*/

static
CLUST get_cluster (		/* 0,>=2: successful, 1: failed */
	CLUST clust			/* Cluster# to get the link information */
)
{
	WORD wc, bc;
	DWORD fatsect;
	FATFS *fs = FatFs;


	if (clust >= 2 && clust < fs->max_clust) {		/* Valid cluster# */
		fatsect = fs->fatbase;
		switch (fs->fs_type) {
		case 1 :
			bc = (WORD)clust * 3 / 2;
			if (!move_window(fatsect + bc / 512)) break;
			wc = fs->win[bc % 512]; bc++;
			if (!move_window(fatsect + bc / 512)) break;
			wc |= (WORD)fs->win[bc % 512] << 8;
			return (clust & 1) ? (wc >> 4) : (wc & 0xFFF);

		case 2 :
			if (!move_window(fatsect + clust / 256)) break;
			return ((WORD)(((WORD)*(volatile BYTE*)((&fs->win[((WORD)clust * 2) % 512])+1)<<8)|(WORD)*(volatile BYTE*)(&fs->win[((WORD)clust * 2) % 512])));
		case 3 :
			if (!move_window(fatsect + clust / 128)) break;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久不卡影院| 国产农村妇女毛片精品久久麻豆 | 一本大道久久a久久精品综合| 91黄色免费版| 91精品国产福利在线观看| 国产女人18毛片水真多成人如厕 | 99视频超级精品| 欧美一区二区三区啪啪| 综合分类小说区另类春色亚洲小说欧美 | 亚洲成人av电影在线| 国产成人综合亚洲91猫咪| 欧美精品久久99| 亚洲三级电影网站| 91精彩视频在线| 久久久精品综合| 免费一级片91| 欧美日韩国产一区| 亚洲精品免费视频| 9l国产精品久久久久麻豆| 久久影院视频免费| 精品一区二区三区免费毛片爱| 欧美亚洲国产bt| 亚洲美腿欧美偷拍| 99久久婷婷国产| 欧美经典一区二区| 国产一区二区调教| 日韩免费一区二区| 久久99精品久久久久久| 日韩一卡二卡三卡| 蜜臀精品久久久久久蜜臀 | 国产亚洲综合av| 麻豆成人久久精品二区三区小说| 欧美网站一区二区| 亚洲精品欧美在线| 欧美日韩中字一区| 婷婷综合在线观看| 欧美日韩成人在线| 婷婷成人综合网| 欧美一二三区在线观看| 免费观看成人鲁鲁鲁鲁鲁视频| 欧美精品v国产精品v日韩精品| 亚洲专区一二三| 91国产福利在线| 亚洲一区二区免费视频| 欧美日韩国产精品自在自线| 亚洲第一精品在线| 欧美xxxx老人做受| 成人免费福利片| 一区二区成人在线视频| 欧美老肥妇做.爰bbww视频| 日韩和的一区二区| 久久精品免视看| 波多野结衣视频一区| 亚洲免费观看在线视频| 欧美群妇大交群中文字幕| 免费精品视频最新在线| 久久久不卡网国产精品一区| 成人av电影在线网| 性做久久久久久免费观看| 欧美成人三级在线| 成人午夜大片免费观看| 亚洲国产裸拍裸体视频在线观看乱了| 欧美日韩在线三级| 国产一区二区在线观看视频| 亚洲精品视频在线| 欧美大片日本大片免费观看| 国产91精品在线观看| 亚洲成人一区二区在线观看| 久久嫩草精品久久久精品| 色婷婷亚洲综合| 精品亚洲成av人在线观看| 中文字幕一区免费在线观看| 欧美挠脚心视频网站| 国产黄色成人av| 亚洲成人免费在线| 国产欧美精品国产国产专区| 欧美日韩二区三区| 成人天堂资源www在线| 日韩成人免费在线| 亚洲欧洲国产日本综合| 精品国产一区二区三区不卡| 色香蕉久久蜜桃| 丰满亚洲少妇av| 人人超碰91尤物精品国产| 一区二区三区精品在线观看| 久久只精品国产| 欧美日韩高清不卡| 欧美优质美女网站| 成人综合在线观看| 久久99精品久久久久婷婷| 午夜精品久久久久影视| 国产精品毛片无遮挡高清| 欧美videos大乳护士334| 欧美日韩精品系列| 91丨porny丨国产入口| 国产成a人无v码亚洲福利| 蜜桃视频一区二区| 首页国产欧美久久| 一区二区三区久久| 一区二区三区在线免费| 国产精品欧美精品| 国产亚洲欧美日韩日本| 欧美一级视频精品观看| 欧美日韩国产影片| 欧美丝袜自拍制服另类| 91看片淫黄大片一级在线观看| 国产福利一区二区三区视频| 国产剧情一区二区| 国产在线日韩欧美| 狠狠色丁香婷婷综合| 久久精品国产免费看久久精品| 热久久免费视频| 久久国产精品无码网站| 秋霞午夜鲁丝一区二区老狼| 天天综合天天综合色| 亚洲成人黄色小说| 午夜影视日本亚洲欧洲精品| 亚洲电影第三页| 午夜欧美2019年伦理| 日韩精品成人一区二区在线| 五月天一区二区| 免费人成网站在线观看欧美高清| 麻豆中文一区二区| 国内外成人在线| 成人免费的视频| 99久久综合国产精品| 色嗨嗨av一区二区三区| 欧美日韩三级一区二区| 91精品一区二区三区在线观看| 欧美日韩国产首页| 精品动漫一区二区三区在线观看| 日韩一区二区电影| 国产视频一区二区在线观看| 18欧美亚洲精品| 亚洲电影欧美电影有声小说| 秋霞电影网一区二区| 国产一区二区不卡| 99国产精品久| 欧美天堂亚洲电影院在线播放| 日韩视频在线你懂得| 国产清纯在线一区二区www| 亚洲人成网站色在线观看| 亚洲国产精品久久艾草纯爱 | 日韩午夜电影在线观看| 久久精品在这里| 亚洲美女屁股眼交3| 日韩极品在线观看| 国产一区视频网站| 日本韩国精品一区二区在线观看| 欧美日韩成人综合天天影院| 精品国产凹凸成av人网站| ...av二区三区久久精品| 日韩综合一区二区| 成人在线一区二区三区| 6080国产精品一区二区| 国产精品伦理在线| 日韩高清不卡在线| 成人app软件下载大全免费| 在线成人免费观看| 中文字幕一区二区三区色视频| 午夜视频久久久久久| 成人高清免费观看| 91精品国产91久久综合桃花 | 久久99国产精品成人| 97se亚洲国产综合自在线| 91精品久久久久久久99蜜桃| 中文幕一区二区三区久久蜜桃| 日韩极品在线观看| 色女孩综合影院| 欧美经典一区二区| 六月丁香婷婷久久| 欧美日韩免费不卡视频一区二区三区| 国产三级一区二区三区| 男人的j进女人的j一区| 色狠狠av一区二区三区| 国产精品久久久久婷婷| 狠狠色狠狠色合久久伊人| 欧美久久久久久蜜桃| 一区二区三区日韩在线观看| 成人一区二区三区| 日韩欧美一级精品久久| 日韩中文欧美在线| 在线免费观看视频一区| 自拍av一区二区三区| 成人综合婷婷国产精品久久蜜臀| 日韩一区二区精品在线观看| 亚洲成人精品在线观看| 欧美视频一区二区三区四区| ㊣最新国产の精品bt伙计久久| 国产黄色91视频| 久久精品视频在线免费观看| 久久超碰97中文字幕| 日韩一区二区三区免费观看| 日韩精品一级二级| 69堂国产成人免费视频| 性欧美大战久久久久久久久| 欧美日韩精品免费观看视频| 亚洲一线二线三线视频| 欧洲精品中文字幕| 性久久久久久久久|