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

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

?? tff.c~

?? this source is for sd mmc read write in fat file system for atmega64
?? C~
?? 第 1 頁 / 共 4 頁
字號:
	fp->flag |= FA__ERROR;
	return FR_RW_ERROR;
}




#if _FS_MINIMIZE <= 1
/*-----------------------------------------------------------------------*/
/* Open a directroy                                                      */
/*-----------------------------------------------------------------------*/

FRESULT f_opendir (
	DIR *dirobj,		/* Pointer to directory object to create */
	const char *path	/* Pointer to the directory path */
)
{
	BYTE *dir;
	char fn[8+3+1];
	FRESULT res;
	FATFS *fs = FatFs;


	res = auto_mount(&path, 0);
	if (res != FR_OK) return res;

	res = trace_path(dirobj, fn, path, &dir);	/* Trace the directory path */
	if (res == FR_OK) {							/* Trace completed */
		if (dir != NULL) {						/* It is not the root dir */
			if (dir[DIR_Attr] & AM_DIR) {		/* The entry is a directory */
	 			dirobj->clust =
#if _FAT32
					((DWORD)LD_WORD(&dir[DIR_FstClusHI]) << 16) |
#endif
					LD_WORD(&dir[DIR_FstClusLO]);
				dirobj->sect = clust2sect(dirobj->clust);
				dirobj->index = 2;
			} else {						/* The entry is not a directory */
				res = FR_NO_FILE;
			}
		}
		dirobj->id = fs->id;
	}
	return res;
}




/*-----------------------------------------------------------------------*/
/* Read Directory Entry in Sequense                                      */
/*-----------------------------------------------------------------------*/

FRESULT f_readdir (
	DIR *dirobj,		/* Pointer to the directory object */
	FILINFO *finfo		/* Pointer to file information to return */
)
{
	BYTE *dir, c;
	FRESULT res;
	FATFS *fs = dirobj->fs;


	res = validate(fs, dirobj->id);			/* Check validity of the object */
	if (res != FR_OK) return res;

	finfo->fname[0] = 0;
	while (dirobj->sect) {
		if (!move_window(dirobj->sect))
			return FR_RW_ERROR;
		dir = &fs->win[(dirobj->index & 15) * 32];		/* pointer to the directory entry */
		c = dir[DIR_Name];
		if (c == 0) break;								/* Has it reached to end of dir? */
		if (c != 0xE5 && !(dir[DIR_Attr] & AM_VOL))		/* Is it a valid entry? */
			get_fileinfo(finfo, dir);
		if (!next_dir_entry(dirobj)) dirobj->sect = 0;	/* Next entry */
		if (finfo->fname[0]) break;						/* Found valid entry */
	}

	return FR_OK;
}




#if _FS_MINIMIZE == 0
/*-----------------------------------------------------------------------*/
/* Get File Status                                                       */
/*-----------------------------------------------------------------------*/

FRESULT f_stat (
	const char *path,	/* Pointer to the file path */
	FILINFO *finfo		/* Pointer to file information to return */
)
{
	BYTE *dir;
	char fn[8+3+1];
	FRESULT res;
	DIR dirobj;


	res = auto_mount(&path, 0);
	if (res != FR_OK) return res;

	res = trace_path(&dirobj, fn, path, &dir);	/* Trace the file path */
	if (res == FR_OK) {							/* Trace completed */
		if (dir)	/* Found an object */
			get_fileinfo(finfo, dir);
		else		/* It is root dir */
			res = FR_INVALID_NAME;
	}

	return res;
}




#if !_FS_READONLY
/*-----------------------------------------------------------------------*/
/* Get Number of Free Clusters                                           */
/*-----------------------------------------------------------------------*/

FRESULT f_getfree (
	const char *drv,	/* Logical drive number */
	DWORD *nclust,		/* Pointer to the double word to return number of free clusters */
	FATFS **fatfs		/* Pointer to pointer to the file system object to return */
)
{
	DWORD n, sect;
	CLUST clust;
	BYTE fat, f, *p;
	FRESULT res;
	FATFS *fs;


	/* Get drive number */
	res = auto_mount(&drv, 0);
	if (res != FR_OK) return res;
	*fatfs = fs = FatFs;

	/* If number of free cluster is valid, return it without cluster scan. */
	if (fs->free_clust <= fs->max_clust - 2) {
		*nclust = fs->free_clust;
		return FR_OK;
	}

	/* Count number of free clusters */
	fat = fs->fs_type;
	n = 0;
	if (fat == FS_FAT12) {
		clust = 2;
		do {
			if ((WORD)get_cluster(clust) == 0) n++;
		} while (++clust < fs->max_clust);
	} else {
		clust = fs->max_clust;
		sect = fs->fatbase;
		f = 0; p = 0;
		do {
			if (!f) {
				if (!move_window(sect++)) return FR_RW_ERROR;
				p = fs->win;
			}
			if (!_FAT32 || fat == FS_FAT16) {
				if (LD_WORD(p) == 0) n++;
				p += 2; f += 1;
			} else {
				if (LD_DWORD(p) == 0) n++;
				p += 4; f += 2;
			}
		} while (--clust);
	}
	fs->free_clust = n;
#if _USE_FSINFO
	if (fat == FS_FAT32) fs->fsi_flag = 1;
#endif

	*nclust = n;
	return FR_OK;
}




/*-----------------------------------------------------------------------*/
/* Delete a File or a Directory                                          */
/*-----------------------------------------------------------------------*/

FRESULT f_unlink (
	const char *path			/* Pointer to the file or directory path */
)
{
	BYTE *dir, *sdir;
	DWORD dsect;
	char fn[8+3+1];
	CLUST dclust;
	FRESULT res;
	DIR dirobj;
	FATFS *fs = FatFs;


	res = auto_mount(&path, 1);
	if (res != FR_OK) return res;

	res = trace_path(&dirobj, fn, path, &dir);	/* Trace the file path */
	if (res != FR_OK) return res;				/* Trace failed */
	if (dir == NULL) return FR_INVALID_NAME;	/* It is the root directory */
	if (dir[DIR_Attr] & AM_RDO) return FR_DENIED;	/* It is a R/O object */
	dsect = fs->winsect;
	dclust =
#if _FAT32
		((DWORD)LD_WORD(&dir[DIR_FstClusHI]) << 16) |
#endif
		LD_WORD(&dir[DIR_FstClusLO]);
	if (dir[DIR_Attr] & AM_DIR) {				/* It is a sub-directory */
		dirobj.clust = dclust;					/* Check if the sub-dir is empty or not */
		dirobj.sect = clust2sect(dclust);
		dirobj.index = 2;
		do {
			if (!move_window(dirobj.sect)) return FR_RW_ERROR;
			sdir = &fs->win[(dirobj.index & 15) * 32];
			if (sdir[DIR_Name] == 0) break;
			if (sdir[DIR_Name] != 0xE5 && !(sdir[DIR_Attr] & AM_VOL))
				return FR_DENIED;	/* The directory is not empty */
		} while (next_dir_entry(&dirobj));
	}

	if (!move_window(dsect)) return FR_RW_ERROR;	/* Mark the directory entry 'deleted' */
	dir[DIR_Name] = 0xE5;
	fs->winflag = 1;
	if (!remove_chain(dclust)) return FR_RW_ERROR;	/* Remove the cluster chain */

	return sync();
}




/*-----------------------------------------------------------------------*/
/* Create a Directory                                                    */
/*-----------------------------------------------------------------------*/

FRESULT f_mkdir (
	const char *path		/* Pointer to the directory path */
)
{
	BYTE *dir, *fw, n;
	char fn[8+3+1];
	DWORD sect, dsect, tim;
	CLUST dclust, pclust;
	FRESULT res;
	DIR dirobj;
	FATFS *fs = FatFs;


	res = auto_mount(&path, 1);
	if (res != FR_OK) return res;

	res = trace_path(&dirobj, fn, path, &dir);	/* Trace the file path */
	if (res == FR_OK) return FR_EXIST;			/* Any file or directory is already existing */
	if (res != FR_NO_FILE) return res;

	res = reserve_direntry(&dirobj, &dir); 		/* Reserve a directory entry */
	if (res != FR_OK) return res;
	sect = fs->winsect;
	dclust = create_chain(0);					/* Allocate a cluster for new directory table */
	if (dclust == 1) return FR_RW_ERROR;
	dsect = clust2sect(dclust);
	if (!dsect) return FR_DENIED;
	if (!move_window(dsect)) return FR_RW_ERROR;

	fw = fs->win;
	memset(fw, 0, 512);							/* Clear the directory table */
	for (n = 1; n < fs->sects_clust; n++) {
		if (disk_write(0, fw, ++dsect, 1) != RES_OK)
			return FR_RW_ERROR;
	}

	memset(&fw[DIR_Name], ' ', 8+3);			/* Create "." entry */
	fw[DIR_Name] = '.';
	fw[DIR_Attr] = AM_DIR;
	tim = get_fattime();
	ST_DWORD(&fw[DIR_WrtTime], tim);
	memcpy(&fw[32], &fw[0], 32); fw[33] = '.';	/* Create ".." entry */
	pclust = dirobj.sclust;
#if _FAT32
	ST_WORD(&fw[   DIR_FstClusHI], dclust >> 16);
	if (fs->fs_type == FS_FAT32 && pclust == fs->dirbase) pclust = 0;
	ST_WORD(&fw[32+DIR_FstClusHI], pclust >> 16);
#endif
	ST_WORD(&fw[   DIR_FstClusLO], dclust);
	ST_WORD(&fw[32+DIR_FstClusLO], pclust);
	fs->winflag = 1;

	if (!move_window(sect)) return FR_RW_ERROR;
	memset(&dir[0], 0, 32);						/* Clean-up the new entry */
	memcpy(&dir[DIR_Name], fn, 8+3);			/* Name */
	dir[DIR_NTres] = fn[11];
	dir[DIR_Attr] = AM_DIR;						/* Attribute */
	ST_DWORD(&dir[DIR_WrtTime], tim);			/* Crated time */
	ST_WORD(&dir[DIR_FstClusLO], dclust);		/* Table start cluster */
#if _FAT32
	ST_WORD(&dir[DIR_FstClusHI], dclust >> 16);
#endif

	return sync();
}




/*-----------------------------------------------------------------------*/
/* Change File Attribute                                                 */
/*-----------------------------------------------------------------------*/

FRESULT f_chmod (
	const char *path,	/* Pointer to the file path */
	BYTE value,			/* Attribute bits */
	BYTE mask			/* Attribute mask to change */
)
{
	FRESULT res;
	BYTE *dir;
	DIR dirobj;
	char fn[8+3+1];


	res = auto_mount(&path, 1);
	if (res == FR_OK) {
		res = trace_path(&dirobj, fn, path, &dir);	/* Trace the file path */
		if (res == FR_OK) {			/* Trace completed */
			if (dir == NULL) {
				res = FR_INVALID_NAME;
			} else {
				mask &= AM_RDO|AM_HID|AM_SYS|AM_ARC;	/* Valid attribute mask */
				dir[DIR_Attr] = (value & mask) | (dir[DIR_Attr] & (BYTE)~mask);	/* Apply attribute change */
				res = sync();
			}
		}
	}
	return res;
}




/*-----------------------------------------------------------------------*/
/* Rename File/Directory                                                 */
/*-----------------------------------------------------------------------*/

FRESULT f_rename (
	const char *path_old,	/* Pointer to the old name */
	const char *path_new	/* Pointer to the new name */
)
{
	FRESULT res;
	DWORD sect_old;
	BYTE *dir_old, *dir_new, direntry[32-11];
	DIR dirobj;
	char fn[8+3+1];
	FATFS *fs = FatFs;


	res = auto_mount(&path_old, 1);
	if (res != FR_OK) return res;

	res = trace_path(&dirobj, fn, path_old, &dir_old);	/* Check old object */
	if (res != FR_OK) return res;			/* The old object is not found */
	if (!dir_old) return FR_NO_FILE;
	sect_old = fs->winsect;					/* Save the object information */
	memcpy(direntry, &dir_old[11], 32-11);

	res = trace_path(&dirobj, fn, path_new, &dir_new);	/* Check new object */
	if (res == FR_OK) return FR_EXIST;			/* The new object name is already existing */
	if (res != FR_NO_FILE) return res;			/* Is there no old name? */
	res = reserve_direntry(&dirobj, &dir_new); 	/* Reserve a directory entry */
	if (res != FR_OK) return res;

	memcpy(&dir_new[DIR_Attr], direntry, 32-11);	/* Create new entry */
	memcpy(&dir_new[DIR_Name], fn, 8+3);
	dir_new[DIR_NTres] = fn[11];
	fs->winflag = 1;

	if (!move_window(sect_old)) return FR_RW_ERROR;	/* Remove old entry */
	dir_old[DIR_Name] = 0xE5;

	return sync();
}

#endif /* !_FS_READONLY */
#endif /* _FS_MINIMIZE == 0 */
#endif /* _FS_MINIMIZE <= 1 */
#endif /* _FS_MINIMIZE <= 2 */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品一区二区三区在线播放视频 | 亚洲视频香蕉人妖| 一区二区三区久久| 一本一道波多野结衣一区二区| 国产精品国产三级国产专播品爱网 | 午夜精品视频在线观看| 久久免费精品国产久精品久久久久| 欧美群妇大交群中文字幕| 色欧美乱欧美15图片| 精品一区二区三区久久| 欧美精品一区男女天堂| 国产精品一区在线观看你懂的| 综合婷婷亚洲小说| 国产精品性做久久久久久| 亚洲国产欧美在线人成| 欧美不卡在线视频| 91丝袜美女网| 天堂久久一区二区三区| 91精品国产一区二区三区| 国产高清精品在线| 看片的网站亚洲| 首页综合国产亚洲丝袜| 亚洲国产精品一区二区www| 国产精品初高中害羞小美女文| 精品国产91乱码一区二区三区 | 亚洲伊人色欲综合网| 亚洲国产精品av| 国产亚洲精久久久久久| 日韩欧美国产一区在线观看| 91麻豆精品国产| 欧美三级午夜理伦三级中视频| 91一区二区在线| av电影天堂一区二区在线| 国产69精品久久久久777| 国产一区二区在线视频| 激情图片小说一区| 韩国欧美国产一区| 国产成人免费视频网站高清观看视频 | 亚洲国产成人私人影院tom| 另类调教123区| 日韩制服丝袜av| 亚洲一区二区三区四区在线免费观看| 极品瑜伽女神91| 国产精品一区在线| 91丨九色丨蝌蚪丨老版| 久久久久久电影| 一区二区在线观看视频在线观看| 伦理电影国产精品| 欧美日韩午夜影院| 亚洲日本在线看| 国产成人精品一区二区三区四区| 免费视频最近日韩| 伊人婷婷欧美激情| 亚洲欧美日韩一区二区 | 欧美高清视频不卡网| 国产乱码精品一区二区三区忘忧草| 午夜精品福利久久久| 99re在线精品| 色综合久久88色综合天天| 91免费观看国产| 欧美日韩国产经典色站一区二区三区| 777欧美精品| 欧美大片拔萝卜| 亚洲国产高清不卡| 综合激情网...| 午夜免费久久看| 精品一区二区三区免费观看| 国产91清纯白嫩初高中在线观看 | 亚洲最大成人网4388xx| 三级欧美在线一区| 国产成人免费在线| 欧美三级电影精品| 欧美v亚洲v综合ⅴ国产v| 国产精品视频九色porn| 一区二区三区欧美亚洲| 色狠狠一区二区三区香蕉| 一区二区中文视频| 国产一区在线精品| 蜜桃av噜噜一区| 午夜影视日本亚洲欧洲精品| 一区二区三区.www| 豆国产96在线|亚洲| 欧美日韩国产美| 亚洲激情在线播放| 91精品国产91久久综合桃花| 久久综合一区二区| 国产精品白丝jk白祙喷水网站| 国产精品欧美一区二区三区| 在线观看免费亚洲| 激情六月婷婷久久| 亚洲精品写真福利| 欧美一级黄色大片| 在线免费观看不卡av| 免费视频最近日韩| 欧美一区二区高清| 秋霞影院一区二区| 精品日产卡一卡二卡麻豆| 亚洲卡通动漫在线| 国产成都精品91一区二区三| 国产视频在线观看一区二区三区| 日日夜夜精品视频天天综合网| 欧美中文字幕一二三区视频| 亚洲久本草在线中文字幕| 欧美性猛交xxxxxxxx| 99国产麻豆精品| 国产色91在线| 奇米在线7777在线精品| 色婷婷亚洲综合| 国产欧美日韩不卡免费| 久久99国产精品久久99果冻传媒| 色综合久久中文字幕| 国产精品天美传媒| 国产一区二区三区综合| 91精品国产综合久久福利| 亚洲精品国产精华液| 成人网在线免费视频| 久久久精品综合| 精品在线免费观看| 这里是久久伊人| 亚洲r级在线视频| 91日韩一区二区三区| 中文字幕五月欧美| 欧美丰满一区二区免费视频| 色琪琪一区二区三区亚洲区| 91看片淫黄大片一级在线观看| 日韩一区日韩二区| 久久久一区二区三区捆绑**| 精品一区二区综合| 一区二区三区日韩欧美精品| 国产日韩精品一区二区三区| 欧美日韩亚洲丝袜制服| 国产性做久久久久久| 欧美日韩一区 二区 三区 久久精品| 99re这里都是精品| 在线视频亚洲一区| 精品成人一区二区三区| 久久久99精品免费观看| 亚洲日本乱码在线观看| 午夜亚洲国产au精品一区二区| 日产精品久久久久久久性色| 91在线视频免费91| 欧美日本乱大交xxxxx| www.欧美日韩| 99久久精品免费| 欧美性色欧美a在线播放| 国产精品影视网| 国产美女精品人人做人人爽| 日韩福利视频导航| 日韩中文字幕91| 亚洲综合成人在线| 亚洲色图.com| 日韩伦理电影网| 国产精品沙发午睡系列990531| 波多野结衣亚洲一区| 中文字幕永久在线不卡| 色综合色综合色综合| 一区二区三区不卡视频在线观看| 91福利区一区二区三区| 五月婷婷综合在线| 国产清纯在线一区二区www| 色噜噜夜夜夜综合网| 99久久久无码国产精品| 91精品久久久久久久99蜜桃| 免费视频一区二区| 亚洲国产激情av| 精品视频一区二区不卡| 毛片av中文字幕一区二区| 国产无人区一区二区三区| 91丝袜美腿高跟国产极品老师| 午夜影院久久久| 国产亚洲欧洲997久久综合| 色综合久久综合中文综合网| 日韩va亚洲va欧美va久久| 久久精品一级爱片| 婷婷久久综合九色综合伊人色| 色综合久久久久网| 一本到高清视频免费精品| 欧美日韩精品三区| 欧美老年两性高潮| 国产精品欧美一级免费| 久久国产欧美日韩精品| 在线国产亚洲欧美| 国产精品的网站| 色婷婷狠狠综合| 亚洲综合在线电影| 欧美日韩久久一区二区| 看片的网站亚洲| 中文字幕一区三区| 色屁屁一区二区| 三级不卡在线观看| 国产婷婷色一区二区三区在线| av一区二区不卡| 亚洲一本大道在线| 国产精品免费久久久久| 精品视频一区三区九区| 国产麻豆精品在线观看| 日韩视频免费观看高清完整版在线观看| 亚洲色图欧美激情| 欧美体内she精高潮| 亚洲影视资源网|