fat_test.c

来自「这是一个基于8255扩展端口的keil c51固件」· C语言 代码 · 共 64 行

C
64
字号
/*
  Copyright (C) 2003 Bart Bilos <boombox666@yahoo.com>.

  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; either version 2
  of the License, or (at your option) any later version.

  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.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software Foundation, 
  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

*/
#include <Dallas\REG320.H>
#include <stdio.h>                /* prototype declarations for I/O functions */
#include <string.h>               /* memory operations */
#include "IDE_LIB.h"              /* IDE working variables */
#include "fat32.h"
#include "util.h"
#include "timertick.h"

void displaydata();

void init(void){
  inittimer();
  ide_hard_reset();
  ide_init();
  init_fat32();
  initfiles();
}

//unsigned int seekfilestart(char * filename

/*------------------------------------------------\
Test program to see if the fat32 is functioning
------------------------------------------------*/
void main (void) {
  int handle1,handle2;
  char bufA[100],bufB[100];
  init();
//  displaydata();
  printf("FAT32 TEST PROGRAM \n");
  handle1 = fopen("MSDOS   SYS");
  handle2 = fopen("IO      SYS");
  fread(handle1,bufA,4);
  fread(handle2,bufB,4);
  fread(handle1,bufA,5);
  fread(handle2,bufB,5);
  fclose(handle1);
  fclose(handle2);
  delay(100);
}

/*
void displaydata() {
  traverse_dir(traverse_dir(rootdir()));
}
*/

⌨️ 快捷键说明

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