main.c

来自「能够在单片机等小型处理器上使用的fat16文件系统」· C语言 代码 · 共 39 行

C
39
字号
#include<stdio.h>
#include"file_system.h"
#include"string.h"
extern unsigned char VFILE[1024*1024*4];
int main()
{
	M_FILE fp;
	FILE *fpoint_real;
	int i;
	unsigned short test_buffer[512*512];
	
	for(i=0;i<512*512;i++)
		test_buffer[i]=i;

	m_format();
    Sect_Init();
	FileSys_Init();

	mm_fopen(&fp,"test1.txt","w");
	mm_fwrite(&fp,"hello",5);
	m_fclose(&fp);

	mm_fopen(&fp,"test2.txt","w");
	mm_fwrite(&fp,"hello world",12);
	m_fclose(&fp);
	
	mm_fopen(&fp,"test3.txt","w");
	mm_fwrite(&fp,"hello world2",13);
	m_fclose(&fp);	

	//////
	fpoint_real=fopen("file_test.wdk","wb");
	fwrite(VFILE,1024*1024*4,1,fpoint_real);
	fclose(fpoint_real);

	printf("hello\n");
	return 0;
}

⌨️ 快捷键说明

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