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

📄 trueffs.c

📁 MPC8241:本程序是freescale的824*系列的BSP源程序
💻 C
字号:
#include <vxworks.h>
#include "blkIo.h"
#include "ioLib.h"
#include "iosLib.h"
#include "memLib.h"
#include "errnoLib.h"
#include "string.h"
#include "stdlib.h"
#include "stdio.h"
#include "dosFsLib.h"
#include "stat.h"
#include "time.h"
#include "config.h"
#include "usrLib.h"

#include "flash.h"
/*#include "mpc8260.h"
#include "target.h" */

/************************************************************************
description: 	This function is used to format a flash device if needed,
				create a block device,mount the DOS file system on a TFFS 
				Flash disk
input:	
				isFormat:
						 1 : need format          
						 0 : without format	
output:		
return value:
				NULL
************************************************************************/

void CreateBlkDev(int isFormat)
{

	STATUS rtValue;

/*	PDA*     ppda;*/


/*	ppda = (PDA*)(0x0f000000);*/
	
	/****some initialization for system needed****/
/*	ppda->pio_pcpar  &= ~(BIT1);
	ppda->pio_pcdir  |= BIT1;*/
	/*printf("S_PortCDataReg is 0x%x\n",S_PortCDataReg);*/
	/*ppda->pio_pcdat  &= ~(BIT1);*/
	/*printf("S_PortCDataReg is 0x%x\n",S_PortCDataReg);*/
	/*ppda->pio_pcdat  |= 1<< (31-1);	

	ppda->pio_pcdat  &= ~(1<< (31-1));
	ppda->pio_pcdat  |= (BIT2);
	ppda->pio_pcdat  &= ~(BIT2);
	ppda->pio_pcdat  |= (BIT4);
	ppda->pio_pcdat  &= ~(BIT4);
	ppda->pio_pcdat  = 0x88888888;
	temp             = ppda->pio_pcdat;
	ppda->pio_pcdat  |= (BIT1);
	ppda->pio_pcdat  = 0x0;
	temp             = ppda->pio_pcdat;
	ppda->pio_pcdat  |= (BIT1);*/
	/*printf("S_PortCDataReg is 0x%x\n",S_PortCDataReg);*/
	/*ppda->pio_pcdat  &= ~(BIT1);*/
	
	if(isFormat == 1 ) 
	{
		/*FlashEraseSector(0);*//*modified by msy*/

		rtValue = tffsDevFormat(0,0);
		if(rtValue == ERROR)
		{
			printf("\ntffsDevFormat error");
			return;
		}
		else
		{
			printf("\ntffsDevFormat sucessfully");
		}
	}
	rtValue = usrTffsConfig(0,0,"RFA");
	if(rtValue == ERROR)
	{
		printf("\nusrTffsConfig error");
		return;
	}

	printf("\ntrueFFS flash file system is created sucessfully");
}

⌨️ 快捷键说明

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