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

📄 efs.c

📁 Philips LPC2138 Demo Application with Keil C
💻 C
字号:
/*****************************************************************************\*              efs - General purpose Embedded Filesystem library              **          --------------------- -----------------------------------          **                                                                             ** Filename : efs.h                                                            ** Description : This should become the wrapper around efs. It will contain    **               functions like efs_init etc.                                  **                                                                             ** This library is free software; you can redistribute it and/or               ** modify it under the terms of the GNU Lesser General Public                  ** License as published by the Free Software Foundation; either                ** version 2.1 of the License, or (at your option) any later version.          **                                                                             ** This library 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           ** Lesser General Public License for more details.                             **                                                                             **                                                    (c)2005 Michael De Nil   **                                                    (c)2005 Lennart Yseboodt *\*****************************************************************************//*****************************************************************************/#include "efs.h"/*****************************************************************************//* ****************************************************************************   * esint8 efs_init(EmbeddedFileSystem * efs,eint8* opts) * Description: This function initialises all subelements of a filesystem. * It sets the pointerchain and verifies each step. * Return value: 0 on success and -1 on failure.*/esint8 efs_init(EmbeddedFileSystem * efs,eint8* opts){	if(if_initInterface(&efs->myCard, opts)==0)	{		ioman_init(&efs->myIOman,&efs->myCard,0);		disc_initDisc(&efs->myDisc, &efs->myIOman);		part_initPartition(&efs->myPart, &efs->myDisc);		if(efs->myPart.activePartition==-1){			efs->myDisc.partitions[0].type=0x0B;			efs->myDisc.partitions[0].LBA_begin=0;			efs->myDisc.partitions[0].numSectors=efs->myCard.sectorCount;				/*efs->myPart.activePartition = 0;*/			/*efs->myPart.disc = &(efs->myDisc);*/			part_initPartition(&efs->myPart, &efs->myDisc);		}		/*part_initPartition(&efs->myPart, &efs->myDisc);*/		if(fs_initFs(&efs->myFs, &efs->myPart))			return(-2);		return(0);	}	return(-1);}/*****************************************************************************/

⌨️ 快捷键说明

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