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

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

?? fat.c

?? filesystem for at91sam9263ek,編輯器為keil for arm mdk
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*****************************************************************************\*              efs - General purpose Embedded Filesystem library              **          --------------------- -----------------------------------          **                                                                             ** Filename : fat.c                                                            ** Description : This file contains all the functions dealing with the FAT     **               in a Microsoft FAT filesystem. It belongs under fs.c          **                                                                             ** This program is free software; you can redistribute it and/or               ** modify it under the terms of the GNU General Public License                 ** as published by the Free Software Foundation; version 2                     ** of the License.                                                             *                                                                              ** This program is distributed in the hope that it will be useful,             ** but WITHOUT ANY WARRANTY; without even the implied warranty of              ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               ** GNU General Public License for more details.                                **                                                                             ** As a special exception, if other files instantiate templates or             ** use macros or inline functions from this file, or you compile this          ** file and link it with other works to produce a work based on this file,     ** this file does not by itself cause the resulting work to be covered         ** by the GNU General Public License. However the source code for this         ** file must still be made available in accordance with section (3) of         ** the GNU General Public License.                                             **                                                                             ** This exception does not invalidate any other reasons why a work based       ** on this file might be covered by the GNU General Public License.            **                                                                             **                                                    (c)2006 Lennart Yseboodt **                                                    (c)2006 Michael De Nil   *\*****************************************************************************//*****************************************************************************/#include "fs.h"/*****************************************************************************//* ****************************************************************************   * unsigned long fat_getSectorAddressFatEntry(FileSystem *fs,unsigned long cluster_addr) * Description: Returns the sectornumber that holds the fat entry for cluster cluster_addr. * This works for all FAT types. * Return value: Sectornumber, or 0. Warning, no boundary check.*/euint32 fat_getSectorAddressFatEntry(FileSystem *fs,euint32 cluster_addr){ 	euint32 base = fs->volumeId.ReservedSectorCount,res;		switch(fs->type){		case FAT12:			res=(cluster_addr*3/1024);			if(res>=fs->FatSectorCount){				return(0);			}else{				return(base+res);			}			break;		case FAT16:			res=cluster_addr/256;			if(res>=fs->FatSectorCount){				return(0);			}else{				return(base+res);			}			break;		case FAT32:			res=cluster_addr/128;			if(res>=fs->FatSectorCount){				return(0);			}else{				return(base+res);			}			break; 	}	return(0);}/*****************************************************************************/ /* ****************************************************************************   * unsigned long fat_getNextClusterAddress(FileSystem *fs,unsigned long cluster_addr * Description: This function loads the sector of the fat which contains the entry * for cluster_addr. It then fetches and (if required) calculates it's value. * This value is the EoC marker -or- the number of the next cluster in the chain. * Return value: Clusternumber or EoC*/euint32 fat_getNextClusterAddress(FileSystem *fs,euint32 cluster_addr,euint16 *linear){	euint8 *buf; 	euint8 hb,lb;	euint16 offset;	euint32 sector;	euint32 nextcluster=0;		sector=fat_getSectorAddressFatEntry(fs,cluster_addr);	if( (fs->FatSectorCount <= (sector-fs->volumeId.ReservedSectorCount)) || sector==0 )	{		return(0);	}		buf=part_getSect(fs->part,sector,IOM_MODE_READONLY);			switch(fs->type)	{		case FAT12:			offset = ((cluster_addr%1024)*3/2)%512;			hb = buf[offset];			if(offset == 511){				part_relSect(fs->part,buf);				buf=part_getSect(fs->part,sector+1,IOM_MODE_READONLY);				lb = buf[0];			}else{				lb = buf[offset + 1];			}			if(cluster_addr%2==0){				nextcluster = ( ((lb&0x0F)<<8) + (hb) );			}else{				nextcluster = ( (lb<<4) + (hb>>4) );			}			break;		case FAT16:			offset=cluster_addr%256;			nextcluster = *((euint16 *)buf + offset);			break;		case FAT32:			offset=cluster_addr%128;			nextcluster = *((euint32 *)buf + offset);			break;	}		part_relSect(fs->part,buf);		return(nextcluster);}/*****************************************************************************/ /* ****************************************************************************   * void fat_setNextClusterAddress(FileSystem *fs,unsigned long cluster_addr,unsigned long next_cluster_addr) * Description: This function makes an entry in the fattable for cluster_addr. The value it puts there * is next_cluster_addr. */void fat_setNextClusterAddress(FileSystem *fs,euint32 cluster_addr,euint32 next_cluster_addr){	euint8 *buf,*buf2; 	euint16 offset;	euint32 sector;		sector=fat_getSectorAddressFatEntry(fs,cluster_addr);		if(( fs->FatSectorCount <= (sector - fs->volumeId.ReservedSectorCount )||(sector==0))){	    DBG((TXT("HARDERROR:::fat_getNextClusterAddress READ PAST FAT BOUNDARY\n")));	    return;	}		buf=part_getSect(fs->part,sector,IOM_MODE_READWRITE);			switch(fs->type){		case FAT12:			offset = ((cluster_addr%1024)*3/2)%512;			if(offset == 511){				if(cluster_addr%2==0){					buf[offset]=next_cluster_addr&0xFF;				}else{					buf[offset]=(buf[offset]&0xF)+((next_cluster_addr<<4)&0xF0);				}				buf2=part_getSect(fs->part,fat_getSectorAddressFatEntry(fs,cluster_addr)+1,IOM_MODE_READWRITE);				if(cluster_addr%2==0){					buf2[0]=(buf2[0]&0xF0)+((next_cluster_addr>>8)&0xF);				}else{					buf2[0]=(next_cluster_addr>>4)&0xFF;				}				part_relSect(fs->part,buf2);			}else{				if(cluster_addr%2==0){					buf[offset]=next_cluster_addr&0xFF;					buf[offset+1]=(buf[offset+1]&0xF0)+((next_cluster_addr>>8)&0xF);				}else{					buf[offset]=(buf[offset]&0xF)+((next_cluster_addr<<4)&0xF0);					buf[offset+1]=(next_cluster_addr>>4)&0xFF;				}			}			part_relSect(fs->part,buf);			break;		case FAT16:			offset=cluster_addr%256;			*((euint16*)buf+offset)=next_cluster_addr;			part_relSect(fs->part,buf);			break;		case FAT32:			offset=cluster_addr%128;			*((euint32*)buf+offset)=next_cluster_addr;			part_relSect(fs->part,buf);			break;	}	}/*****************************************************************************/ /* ****************************************************************************   * short fat_isEocMarker(FileSystem *fs,unsigned long fat_entry) * Description: Checks if a certain value is the EoC marker for the filesystem * noted in fs->type. * Return value: Returns 0 when it is the EoC marker, and 1 otherwise.*/eint16 fat_isEocMarker(FileSystem *fs,euint32 fat_entry){	switch(fs->type){		case FAT12:			if(fat_entry<0xFF8){				return(0);			}			break;		case FAT16:			if(fat_entry<0xFFF8){				return(0);			}			break;		case FAT32:			if((fat_entry&0x0FFFFFFF)<0xFFFFFF8){				return(0);			}			break;	}	return(1);}/*****************************************************************************/ /* ****************************************************************************   * unsigned long fat_giveEocMarker(FileSystem *fs) * Description: Returns an EoC markernumber valid for the filesystem noted in * fs->type. * Note, for FAT32, the upper 4 bits are set to zero, although they should be un * touched according to MicroSoft specifications. I didn't care. * Return value: The EoC marker cast to an ulong.*/euint32 fat_giveEocMarker(FileSystem *fs){	switch(fs->type)	{		case FAT12:			return(0xFFF);			break;		case FAT16:			return(0xFFFF);			break;		case FAT32:			return(0x0FFFFFFF);			break;	}	return(0);}/*****************************************************************************/ /* ****************************************************************************   * euint32 fat_getNextClusterAddressWBuf(FileSystem *fs,euint32 cluster_addr, euint8* buf) * Description: This function retrieves the contents of a FAT field. It does not fetch * it's own buffer, it is given as a parameter. (ioman makes this function rather obsolete) * Only in the case of a FAT12 crosssector data entry a sector is retrieved here. * Return value: The value of the clusterfield is returned.*/euint32 fat_getNextClusterAddressWBuf(FileSystem *fs,euint32 cluster_addr, euint8* buf){	euint8  *buf2; /* For FAT12 fallover only */	euint8 hb,lb;	euint16 offset;	euint32 nextcluster=0;		switch(fs->type)	{		case FAT12:			offset = ((cluster_addr%1024)*3/2)%512;			hb = buf[offset];			if(offset == 511){				buf2=part_getSect(fs->part,fat_getSectorAddressFatEntry(fs,cluster_addr)+1,IOM_MODE_READONLY);				lb = buf2[0];				part_relSect(fs->part,buf2);			}else{				lb = buf[offset + 1];			}			if(cluster_addr%2==0){				nextcluster = ( ((lb&0x0F)<<8) + (hb) );			}else{

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区三区免费看| 欧美一二三四区在线| 亚洲成人777| 久久精品水蜜桃av综合天堂| 欧美日韩一区视频| eeuss国产一区二区三区| 免费的国产精品| 亚洲在线视频网站| 亚洲欧美综合色| 久久久一区二区三区| 欧美日韩精品免费观看视频| eeuss鲁片一区二区三区在线观看| 奇米四色…亚洲| 亚洲综合激情另类小说区| 国产精品久久久久久久久图文区| 欧美电影免费观看高清完整版在线 | 91精品欧美福利在线观看| 91热门视频在线观看| 国产成人自拍高清视频在线免费播放| 天天影视涩香欲综合网| 亚洲综合视频在线| 自拍视频在线观看一区二区| 亚洲国产精品国自产拍av| 久久综合色播五月| 欧美一级黄色片| 91麻豆精品91久久久久久清纯 | 日韩色在线观看| 欧美伊人精品成人久久综合97| 国产精品一二三区在线| 韩国三级中文字幕hd久久精品| 丝袜亚洲另类欧美| 亚洲高清久久久| 亚洲韩国一区二区三区| 亚洲一区二区三区中文字幕 | 国产精品水嫩水嫩| 久久久精品中文字幕麻豆发布| 日韩欧美第一区| 欧美电影免费观看高清完整版在线| 欧美日韩美女一区二区| 欧美男生操女生| 在线不卡免费欧美| 欧美精品1区2区| 日韩午夜激情电影| 在线播放日韩导航| 精品捆绑美女sm三区| 欧美本精品男人aⅴ天堂| 久久青草国产手机看片福利盒子 | 337p日本欧洲亚洲大胆精品| 久久亚洲精品小早川怜子| 久久久无码精品亚洲日韩按摩| 久久这里只有精品视频网| 国产欧美日韩卡一| 亚洲精品伦理在线| 亚洲电影一区二区三区| 亚洲成人动漫在线观看| 天堂精品中文字幕在线| 久久精品国内一区二区三区| 国产成人精品影视| 一本在线高清不卡dvd| 欧美日韩精品综合在线| 日韩美一区二区三区| 国产日韩欧美高清在线| 亚洲另类春色国产| 男女视频一区二区| 成人免费视频一区二区| 在线观看亚洲精品| 精品少妇一区二区三区| 亚洲欧洲另类国产综合| 亚洲成人在线观看视频| 久久99精品国产麻豆不卡| 丁香婷婷综合网| 在线观看中文字幕不卡| 欧美中文字幕一区二区三区| 欧美一级片免费看| 国产精品无遮挡| 亚洲.国产.中文慕字在线| 狠狠色综合播放一区二区| 91在线观看污| 欧美一区二区三区视频在线| 国产人成一区二区三区影院| 夜夜嗨av一区二区三区| 久久国产尿小便嘘嘘尿| 色综合天天综合| 欧美sm美女调教| 亚洲欧美日韩一区| 奇米影视在线99精品| 97久久人人超碰| 日韩女优av电影| 亚洲精品久久7777| 国产寡妇亲子伦一区二区| 欧美性感一类影片在线播放| 久久亚洲精精品中文字幕早川悠里 | 一区二区不卡在线播放| 国产一区视频导航| 欧美日韩亚洲综合在线| 国产精品天干天干在线综合| 免费成人av在线| 欧美主播一区二区三区美女| 国产女人水真多18毛片18精品视频 | 亚洲.国产.中文慕字在线| 成人夜色视频网站在线观看| 日韩亚洲欧美成人一区| 樱花草国产18久久久久| 成人黄色小视频| 精品欧美一区二区久久| 亚洲国产成人av| 一本久久精品一区二区| 国产精品丝袜久久久久久app| 另类调教123区 | 精品国产露脸精彩对白| 亚洲国产另类精品专区| 一本到一区二区三区| 欧美国产日韩在线观看| 国精产品一区一区三区mba桃花 | 亚洲国产人成综合网站| 99久久综合99久久综合网站| 久久精品在线免费观看| 激情五月婷婷综合| 精品日韩成人av| 精品视频在线视频| 亚洲伦在线观看| 97se亚洲国产综合自在线不卡| 精品国产区一区| 麻豆91在线播放免费| 91精品国产高清一区二区三区 | 三级影片在线观看欧美日韩一区二区 | 国产成人av一区二区三区在线观看| 欧美一区二区三区在线视频| 香蕉成人啪国产精品视频综合网| 在线观看免费成人| 夜夜操天天操亚洲| 欧美四级电影在线观看| 亚洲一区免费在线观看| 一本久久a久久精品亚洲| 亚洲美女区一区| 91浏览器打开| 亚洲综合在线五月| 欧美午夜电影网| 丝瓜av网站精品一区二区 | 久久久www成人免费无遮挡大片| 精品一区二区三区在线视频| 精品国产乱码久久久久久夜甘婷婷 | 欧美伊人精品成人久久综合97 | 亚洲国产中文字幕在线视频综合 | 欧美高清在线视频| 99精品国产一区二区三区不卡| 亚洲三级电影网站| 欧美亚洲国产怡红院影院| 亚洲一二三区不卡| 欧美高清视频不卡网| 奇米精品一区二区三区在线观看一| 在线不卡的av| 国产自产v一区二区三区c| 国产精品免费视频网站| 97久久久精品综合88久久| 亚洲一区二区在线观看视频| 在线综合+亚洲+欧美中文字幕| 久久国产精品72免费观看| 国产亚洲综合性久久久影院| 99久久伊人精品| 午夜精品久久久久| 久久香蕉国产线看观看99| www.色精品| 亚洲午夜私人影院| 日韩欧美国产午夜精品| 国产999精品久久| 亚洲精品大片www| 欧美麻豆精品久久久久久| 国精产品一区一区三区mba视频| 国产精品久久久久久亚洲毛片| 欧美日韩中文字幕一区| 久久99精品一区二区三区| 中文字幕视频一区| 777午夜精品免费视频| 国产乱码字幕精品高清av| 亚洲日本韩国一区| 日韩午夜小视频| 成人18精品视频| 婷婷一区二区三区| 欧美精品一区二区三区蜜桃视频 | 精品一区二区三区在线视频| 亚洲欧洲精品一区二区三区不卡| 欧美精品xxxxbbbb| 福利一区二区在线| 爽好久久久欧美精品| 国产精品美女久久福利网站| 宅男在线国产精品| 成人h版在线观看| 欧美a级一区二区| 亚洲色图制服诱惑| 精品久久久久香蕉网| 色婷婷综合久久久久中文一区二区 | 夜夜夜精品看看| 久久综合色之久久综合| 欧美日韩精品欧美日韩精品 | 九一九一国产精品| 一级中文字幕一区二区| 久久女同精品一区二区| 欧美日韩国产精品自在自线| 99精品视频中文字幕|