|
EDA365欢迎您!
您需要 登录 才可以下载或查看,没有帐号?注册
x
自己移植的SD卡的FATFS文件系统,采用最新版FATFS R0.09,并且有详细的中文注释,和操作测试程序,完整的MDK STM32F103工程。下载即可使用。6 Q! N6 P0 i2 o/ s' D3 b# I% z
/*----------------------------------------------------------------------------/; X, O& E* G* o: d# T; ^2 I& X$ K3 c
/ FatFs - FAT file system module R0.09 (C)ChaN, 2011- ^0 V$ T" O) p9 y2 a/ \
/-----------------------------------------------------------------------------/2 G) g6 B. w9 o( K
/ FatFs module is a generic FAT file system module for small embedded systems.
. v8 R: ?! G' S# v/ This is a free software that opened for education, research and commercial, y! b" R/ \3 Y4 U
/ developments under license policy of following terms.
; M9 P3 O8 B7 W$ V0 B! j/
) I; a s' a& D. z) g" V+ G/ Copyright (C) 2011, ChaN, all right reserved.2 u; {: s/ M7 f% w% E7 G( a3 h
/
' I- K' A' q+ a' G( U# K/ * The FatFs module is a free software and there is NO WARRANTY.
/ S" d& z/ J% `1 M5 q7 q' O3 h/ * No restriction on use. You can use, modify and redistribute it for
% p& `% i& G3 q% f+ D& C/ personal, non-profit or commercial products UNDER YOUR RESPONSIBILITY.3 h% t G% ` x7 K* ^4 M
/ * Redistributions of source code must retain the above copyright notice.
6 P* A r" {3 V/+ H0 Q3 `6 Q8 D
/-----------------------------------------------------------------------------/2 v; e4 O; {8 U* c9 j( d
6 c! t# F& V8 d7 l/ q1 f
b+ [3 C, M6 {( ~( h) X
/*--------------File Info-------------------------------------------------------
- o- t& P; O- H6 b** 文 件 名: FATFS_Function.c, l5 u: m& ?( x3 X+ E: \/ W+ {
** 作 者:~风中的叶~ 整理
* G9 q+ v4 g; G8 _3 j2 n q** 最后修改日期: 2012.01.18# V) H U# r3 e- p2 i
** 版 本: V1.0
) V$ O- \7 ]. n' z7 @( V1 E; }+ f** 描 述: FATFS常用功能测试函数 .连接PC机串口,观察超级终端输出
+ ~9 M( Y% E" e5 R! p8 s3 f**------------------------------------------------------------------------------/ Z: z+ d; I% d( S# M
** Created by: Dt.( L9 b% z5 r" u( ^% B9 u# [
** Created date:
3 M7 \2 {2 f/ P# y; W, B*******************************************************************************/
$ D% X& Q: s( Z#include "TEST_FATFS.h"3 c& i$ R6 D4 m
#include "string.h"8 w' x6 h) h% G4 Q2 s( `& ^* O4 V
. [: Y( u; K3 U) U#ifdef TEST_FATFS_EN0 }7 z0 e8 @7 G2 F1 D b+ f
) Z, W( |+ r. J) N1 q, B# m
, ~. r: ?( J$ o
! l7 j/ _( m+ ]. E1 }//检测磁盘是否插好" y- ~, a2 M0 [- O+ P
BOOL disk_detect_OK(void)( H, ^, h6 z+ G! X7 U8 ?2 t. K
{: L# r* E5 l" b2 E$ G3 y
if( disk_status(0)==STA_NODISK )/* Physical drive nmuber (0..) */% q' h8 {/ K: `( A& \! W
{) L2 ~9 u L8 x7 k5 W! I
printf("\r\n\r\n%48s\r\n","<未检测到磁盘,请检查SD卡是否插好...>");
# \6 D+ E' U7 b; |' `5 b6 I0 F return FALSE;# {) N* a' M! x; K
}
& s$ ^; t1 ^( a- c- D return TRUE;
/ n; W5 G" O6 Y}
) A2 z( \, Y9 ] i
, m6 P# X9 y% }7 L" V
7 H: T: M( z: T* }6 M$ B
) t l6 u2 R$ y2 p4 K- S//测试函数执行结果分析
6 `6 {5 H6 [* M5 a' D* U, bvoid die(FRESULT res)6 V9 ]2 v2 \; u
{, R" v1 ~6 z2 n- J; h5 M
switch(res); G7 R' ^7 S' l0 Q# |1 ?
{5 ^4 b6 H- a9 }/ }* [
case FR_OK: //The function succeeded.
# C& N5 Q" G9 {4 M) q w' r {
J- @4 [$ M s6 U0 x' \ printf("\r\nThe function succeeded!\r\n");
' B: E% r+ Q c2 T break;5 H2 g& a8 W, ]- J
}
; v' y& O8 z) H case FR_NOT_READY://The disk drive cannot work due to no medium in the drive or any other reason
% N2 p1 m) D; n! R( v! T0 o) B/ ]; y2 h {
5 _9 m; V# \% D4 ~) X* [% ~ printf("\r\nThe disk drive cannot work due to no medium in the drive or any other reason!\r\n");0 l. T2 _6 o8 J9 B
break;
8 l$ p5 f$ T& A% @5 U# O- f3 W1 B$ M }0 q# }9 M- n2 N& o% b, s
case FR_NO_FILE://Could not find the file.
# R: O( l( i9 N9 P4 ^0 `1 E {+ ~8 Q# s7 k) J
printf("\r\nCould not find the file!\r\n");$ e. K$ t j1 W% I% {3 w J
break;0 k- U% b# g% K3 d, S
}
0 n+ I% S$ s, h0 V; f8 p q6 \ case FR_NO_PATH://Could not find the path/ e: S' G% N: N" M6 U s. O
{
6 D- H7 O$ ]2 z+ H0 N7 C printf("\r\nCould not find the path!\r\n");) ]; L; S! ~# N
break;
2 `. y* i" p @6 K% r( D }
' X& o: v9 X' H6 b4 z case FR_INVALID_NAME://The path name is invalid1 p4 a G% X M9 [+ \& l
{
6 B# m, c) m- e/ D printf("\r\nThe path name is invalid!\r\n");! I7 Y0 ]0 J2 q2 d& ~1 \1 F: ]
break;* V( D3 x& d7 a% ]0 b
}
) b7 m( c) g, P5 H. u case FR_INVALID_DRIVE://The drive number is invalid: g$ T- Y3 m) i8 ?9 V" Z: X
{/ ~/ f5 }+ ?1 {9 |9 B
printf("\r\nThe drive number is invalid!\r\n");
0 q& U9 l9 K- h, @' c) e break;
+ a1 h7 h9 |2 g' K9 E+ c1 _, V }
" d: l# w4 ]& R4 u. e# b case FR_DENIED://The directory cannot be created due to directory table or disk is full.
2 P% i; M$ \5 m2 ? {& O9 Z/ B I& [+ X0 \& z8 Z
printf("\r\nThe directory cannot be created due to directory table or disk is full!\r\n");0 y* v) R4 a" A
break;* y' M- A6 o- r+ J
}: [6 b6 m# x y
case FR_EXIST://A file or directory that has same name is already existing+ B$ f4 z- w/ S/ r. b
{' Q8 j) R, ?- B, O& c
printf("\r\nA file or directory that has same name is already existing!\r\n");7 h$ N L) H8 F
break;4 C( d& P$ L: L
}- p7 U' j r8 }; l& s
// case FR_RW_ERROR://The function failed due to a disk error or an internal error8 D. e8 D3 Z% k. J/ \4 i5 C1 Y
/*$ L r. ^5 u; G0 J( z/ I
case FR_RW_ERROR://The function failed due to a disk error or an internal error; f* |4 G/ T6 n9 {( `/ @
{. N7 A4 H G( Q* X1 r
printp("\r\nThe function failed due to a disk error or an internal error!\r\n");
! g, N6 x5 @ Q2 ]! p break;* P6 `3 I K3 j7 m) |& d
}
: M9 g4 `2 T% y% \7 W1 c*/3 F' A# N9 c0 F1 H: N
case FR_WRITE_PROTECTED://The medium is write protected
7 S- r v7 ~8 c. [ K" G% G6 ~ {/ Y F( `+ {, ^
printf("\r\nThe medium is write protected!\r\n");3 E2 R- k( V# g( h: X# G6 m6 x, ~
break;: l' J3 M* o% d" e
}
* l3 @8 p% u$ D5 `/ B# V K case FR_NOT_ENABLED://The logical drive has no work area: v9 ~- X) g) p# @6 \0 j
{
, }! H$ u: w$ X1 Y' H0 f% h/ ~ printf("\r\nThe logical drive has no work area!\r\n");( L6 n% [3 Q6 w, r/ T3 K) H; _
break;
" O" n0 l* J! `' M' `9 R% d }
* D$ s/ f8 z. T& m case FR_NO_FILESYSTEM://There is no valid FAT partition on the disk
, A0 l7 @5 ~! i( ~) a {
/ @; W& D! s& Q0 A( h5 ~ printf("\r\nThere is no valid FAT partition on the disk!\r\n");" K% X% |! E2 z" h4 L. A
break;
# i# T4 H, d9 X1 L }6 d. i6 z/ k! O, C* }
case FR_INVALID_OBJECT://The file object is invalid
2 c' l+ T# G. T4 I* P {* j4 v: M" [6 e& ]" F
printf("\r\nThe file object is invalid!\r\n");
7 _7 _% \. ~. ` _8 P break;$ L% k+ j" d) `3 W; v# Z
}
1 f6 ?9 Z5 z, s6 v
2 i3 T7 ^; U5 S' @2 d) m //The function aborted before start in format due to a reason as follows.
; |# _. v y" L8 u4 k //The disk size is too small.
" Y; j( t% k+ a3 ^0 |) H+ N. d //Invalid parameter was given to any parameter.
! Y/ f6 A: Q; K //Not allowable cluster size for this drive. This can occure when number of clusters becomes around 0xFF7 and 0xFFF7. ( ^+ ]$ V( b% a0 T" c
case FR_MKFS_ABORTED://! x# c/ e8 Y3 b2 x/ V
{9 |( c3 C: y- d" ?, j8 e/ T
printf("\r\nThe function aborted before start in format!\r\n");
7 c4 E& Q, r1 L* { break;
6 `6 E# v& l, |" A. D }: H. z! U+ Q* _) \( U
+ k3 M5 a7 n- S: a4 U
default:
# A: O1 C- T/ m+ Y6 S* o {; F4 Q2 }8 Q" O5 g/ l
printf("\r\nerror!\r\n");: w( ]# p, N1 R# }% ]( @5 D C+ t
break;
! F' Q7 x' E4 P' J4 e } # ]2 V, q1 _. T ], {( z" Q) \* ?" b
}
. C9 Z; n/ D- [# R2 X return;4 `+ f/ Z6 u! L
}
v5 m. t1 I! K( N: D" Mvoid Test_f_getfree(void)//获取卡的总容量及剩余容量6 V. v: W& b+ A. q1 a/ v* n
{, d7 W' b& j6 ^& R( B: B# |
FATFS fs;
) R8 l& ?' r4 y& G FATFS *pfs;! ~, \5 f( h5 _
DWORD clust;; U# o5 n+ t$ c0 l
FRESULT res; // FatFs function common result code" {: @; S. D# O& {# ]
}6 P- i" H; ^( g+ ^. C& W' s5 d //检测磁盘是否插好
: w" g& B! g5 A c0 F: k if( disk_detect_OK()==FALSE ) return;
6 T$ P, d2 @; d0 {9 f, r' z
- u' L. B- l- L5 d C pfs=&fs;//指向2 m! w! z! K _7 F
// Register a work area for logical drive 0
- C2 O; s5 g4 g$ v* `$ ~& k f_mount(0, &fs);//安装FATFS,就是给FATFS分配空间
7 T, ~: {) o* {
4 C2 @$ e9 |* A% y% d1 S8 k5 Z // Get free clusters
' ^' C3 H) a s, _: } res = f_getfree("/", &clust, &pfs);//必须是根目录,默认磁盘0;"/"或者"0:/"
$ P* |3 z4 R1 b% R$ I5 a; W if ( res==FR_OK )
1 |! Y0 p+ l9 L/ O/ Q. O- s& G! C {
$ `' B3 V9 M/ }* Z v) a // Get free space
2 m$ z! _5 B7 z printf("\r\n%d MB total disk space.\r\n%d MB available on the disk.\r\n",8 I4 r4 D" O1 a+ m( y6 d
(DWORD)(pfs->n_fatent - 2) * pfs->csize /2/1024,//总的磁盘空间M =(总簇数-2)*每簇的扇区数/2/1024=可用簇数*每簇的扇区数/2/1024
6 I) p; y0 j+ ~7 ?' ? clust * pfs->csize /2/1024);//空闲的磁盘空间M=剩余簇数*每簇的扇区数/2/1024
% v5 W" K! c' w z# W6 |/ { }+ g) n; a3 O! P v! W
else die(res);//测试函数执行结果分析5 T" f8 x# B8 C1 ^" y
, ?' g, P/ E& {( h. W% A" m // Unregister a work area before discard it
: h0 n- D8 ^, c& ~6 i& r3 K" c f_mount(0, NULL);//卸载FATFS,就是释放FATFS结构体所占空间
2 U8 `' l1 Y$ h* H1 H+ u+ \}
8 R# s2 {- f2 r8 g$ T; W
. r% G4 K: G8 X7 l) I% yvoid Test_f_read(void)//读文件的数据,如果没有此文件则返回错误
& ~+ g3 |( S3 o- s& a- c$ c$ p& q{7 B7 b! J2 u# V# M4 ?
FATFS fs; // Work area (file system object) for logical drive
' J8 }! D) T& {' @3 \" W( T FIL fsrc; // file objects
2 C5 A' y% ~/ j BYTE buffer[512]; // file copy buffer
- |# c' v3 F: B+ M1 A9 F# ~ FRESULT res; // FatFs function common result code
3 T- n) S2 S1 @2 ?9 l UINT br; // File R count
" @1 h6 ]/ v3 X, r: Q. {& U u16 i;
7 { T, i; G' F! k2 S, G
! @) y# x9 |, n1 @: P% q$ V+ e9 U& {" H K6 \ Q
char path[20];4 s; {* }/ {* |$ a! _3 K1 d& Z6 X
: C- I, Z0 E" J1 B9 D
//检测磁盘是否插好 ?7 x9 D5 W/ t2 {
if( disk_detect_OK()==FALSE ) return;
5 p& K+ j9 u F# `( c
; n9 G6 S' b0 f // Register a work area for logical drive 0
( y6 i" ?$ G& }1 U" z% @ f_mount(0, &fs);
+ {& f! n9 X% K' |8 j
8 b R+ w1 U1 R printf("\r\nread file:>");. [# D: `5 X4 }+ x& Z3 r
USART_Scanf_Name(path);//通过串口输入文件路径名/dir/file.txt或者0:dir/file.txt或者0:/dir/file.txt
) w7 U6 R n$ J) }$ B0 v& x) ~8 W* H( p2 N) N F0 n( _8 U$ ~
//Open source file
4 k) y9 F3 s: O! l* f R res = f_open(&fsrc, path, FA_OPEN_EXISTING | FA_READ);//打开存在的文件,如果没有则返回错误9 L6 o8 v" |, B1 }
die(res);
4 D& a8 W- O. q' x, L8 \% Y' L! {( h) I& @
# [0 p+ h$ _& o4 S0 W2 i //buffer空间设大一点,会提高读的速度。/ _8 Z& ^2 w5 k9 d4 A
//如果文件实际大小512byte,
# F: K; e# M, s1 m1 J# h //设为buffer[512]时,只需要循坏一次,如果设为buffer[1],需要循坏512次。1 [+ w. i( x; _( ]! z# D3 o( K
//下面两行主要是去除1s误差。
8 d& ?! A$ n' i; g2 k. O e- S. c1 M
for (;;)
! f% _7 Y7 v3 ^* ^/ x* \ {
- m8 X& Y7 s- G% }: @) e9 F2 I for(i=0;i<sizeof(buffer);i++) buffer[i]='\0';//清除缓存' v0 y; G3 t: ~( |# c9 k% M) N
; _+ o+ N0 h1 ]7 R. _$ w
res = f_read(&fsrc, buffer, sizeof(buffer), &br);
0 i# u+ b9 M# X0 {0 a' f3 {9 [ if (res ||(br == 0)) break; // error or eof
# m! ], m! l2 T4 S( ` + M2 o3 Z3 n2 `2 x
printf("%s",buffer);
; Z) g5 h: i& M. x3 j }
. N# m L+ c- O& M9 W5 o: N- a; W5 n6 ] L
3 @ r: C$ u2 K) I; l // Close all files
$ @, n1 U5 }! o* h1 K; J- Z1 Y! e f_close(&fsrc);; Y. g9 b d+ N
// Unregister a work area before discard it9 l. d2 L" Y5 e# q) s+ R
f_mount(0, NULL);
; b+ l$ j$ o1 v5 K8 V- k}5 l6 \- I, J0 R' t8 F
9 q9 v( U& ]& }! ^! P. Dvoid Test_f_write(void)//写数据到文件,如果没有此文件则创建文件& n+ G' z0 M/ g @4 ~1 p
{+ J% j# T8 d1 a
FATFS fs; // Work area (file system object) for logical drive
9 P% M/ k9 O( h; [# E2 A FRESULT res; // FatFs function common result code
! p2 u. `( I. R% s1 z7 {& ~, R( r FIL Make_file;
6 f, S ~. [9 t6 e! q char file_name[20];: ?4 |! R0 x$ J% v: P
char Storage_buffer[] ="0";
! B" A6 F* Q7 b2 v4 r
; j% o# ]9 V# `9 u UINT bw;
- S! G- z0 b( d' O" i //检测磁盘是否插好
) L3 U q( j' ?3 r2 S& s if( disk_detect_OK()==FALSE ) return;* _( f: ?8 V+ O! j2 E6 w |
printf("\r\n inaert_ok:>");: q/ o% }* J1 b( N
// Register a work area for logical drive 02 @4 G: O6 C+ A: c# ]& s& @+ y
f_mount(0, &fs);
1 g4 Y% s- k ?8 M+ R. m
! j. R" i& X& q printf("\r\n Make file Name:>");
# m4 P- b; E, C2 Q( h- G: ~# {8 { USART_Scanf_Name(file_name);//通过串口输入源文件路径名/dir/file.txt或者0:dir/file.txt或者0:/dir/file.txt
7 t) o; V: l9 m1 {
' Y8 R9 @% d: w. G; i U N2 I; q7 Y res = f_open(&Make_file, file_name, FA_OPEN_ALWAYS | FA_WRITE); //可写方式打开 没有文件则创建
$ B% f5 l7 m% L4 @ printf("\r\n open_ok:>");- E9 o" d; u) X7 h+ _+ T
die(res);
! v8 f; U0 V4 S. J, N res = f_lseek(&Make_file, Make_file.fsize); //指针移到文件最后 ]4 h/ W b) n# b$ ^
printf("\r\n seek_ok:>");% o3 a& f- Z- w/ w& @. K- z
die(res);; P) t- ~9 m, J( W, e& \4 c" c
res = f_write(&Make_file, Storage_buffer, (sizeof (Storage_buffer))-1 , &bw); //每次需要写入的数据字节数,去掉最后的\0所以-1
& o- t& M8 i9 l3 p" N% N printf("\r\n write_ok:>");) i1 {$ D; `, H. m
die(res);
/ s2 c4 P1 d$ W3 x8 k res = f_lseek(&Make_file, Make_file.fsize); //指针移到文件最后
+ W9 c, l) ]6 y% J" ~ f_close(&Make_file);//关闭文件: ]- ^/ N8 r6 D+ \/ l8 [( V* C
printf("\r\n close_ok:>");0 \# X0 i8 x* v G# H
/ o0 a3 d( `/ X printf("\r\n写文件测试OK!\r\n");
% R+ o5 F4 D+ ]+ _3 { g. B+ `% E& T% ~0 T
// Unregister a work area before discard it
# E2 e/ E. l* ^8 N* w) \+ b4 \ f_mount(0, NULL);
& S. h( `. q; m" B, n}4 J! z T0 c' z2 I: o) T
) [: P, ~* q. V7 V' s7 j% G' J) J
//The f_read function reads data from a file.% V/ J0 `) f9 U* Z( e& a
//在RAM里面调试这个程序的时候,总出现莫名其妙的错误,最后怀疑是堆寨溢出了,证明果然是这样* @! |+ G+ M" M1 g. `7 h" A
//把Stack_Size EQU 0x00000400 改为 Stack_Size EQU 0x00000800就正常了
4 M5 D. W7 O9 _8 X- |//所以以后要特别注意这个问题。
' F* b- V, X) E: i, w+ t" w
8 u% j1 |! I! y# bu8 StrToData(u8 * data, u8 len)
+ t) Z/ h5 b7 M& d, Q2 M9 [0 o{3 d# c9 D* z/ J
u8 ltemp;
1 D H! i* p- G* ^0 k& J if(len == 1)
; T, A( g7 p2 s4 h {
4 a* V2 T0 C0 ?9 e. R ltemp = data[0]-0x30;& Q) W5 |! u/ x% z5 s8 K6 }) s
( q) ~, ?+ g" t) L% T8 ?
}
* D. b! `$ a8 }# M. m else if(len == 2)1 Z: \1 ?( I" S# @/ p
{* [$ W8 `6 P. _1 ~4 ~$ J
ltemp = (data[0]-0x30)*10 + (data[1]-0x30);
* p6 C7 J2 ?/ }4 j
/ A: L4 _8 i% x$ n- Z+ B }6 I; u7 S7 h! i7 j5 U6 ]" u
//else if(len == 3)
2 Y. P$ Q3 o) |9 L" P: @9 A1 { //ltemp = (data[0]-0x30)*100 + (data[1]-0x30)*10 + [data[2] - 0x30];( L- H- H' [& z* t& O
4 g; Q( D8 W9 o; k% v5 D4 g; d( X* z# r4 S return ltemp;
) ^% Z& G* S6 N% H( |1 D; X: @* U( Q
5 Z& ^# ?' u/ H! p}
$ P* l4 s7 k% p8 U( l( \) r# `& ], G' S- o
+ j: }: I' e+ s6 \* e#endif3 X6 J" f" ^8 l$ e
# `: c! a. o1 @* ~* x
& {1 ~6 ^" w$ p
/*1 E1 t' _$ Q6 T# Q8 m/ @9 G
int main(void)
* o9 ^) B) L3 @1 j, c{
/ F1 D1 S8 G. T///////////////////////////////////////////////////////////. w) Y6 f+ b. W/ Y
UART1GPIO_config();//串口IO口配置
- I8 V- W3 ?8 c/ m( J6 zUSART1_config();//串口初始化波特率为192002 O4 _# w' b9 k6 D
//UART1NVIC_config();//配置中断, }* w: L2 z3 z4 S8 } b
///////////////////////////////////////////////////////////6 d8 m3 Z/ V& V4 O: O, ~
SDCard_SpiInit();//SD卡的IO口及SPI模块初始化,PA2插入检测(H—>L) A3 CD_CS片选;PA5 SCK;PA6 MISO;PA7 MOSI;低速模式
% y3 Z( W' r9 L, {5 N; z//SD_Init();//SD卡初始化,如果使用的FATFS则可以不用这句,因为FATFS在打开文件等操作时已经调用了它
6 ?/ Q& P. G, ^Test_f_getfree();//获取SD卡的容量和剩余容量
0 Q; C' K# u' v/ X* ?, z9 x/ LTest_f_read();//SD卡读文件测试! ?- R O" f, n o# J: X
Test_f_write();//SD卡写文件测试
: _- N9 L! o7 V0 D' ~///////////////////////////////////////////////////////////
& X7 Z$ t" G7 R7 _, K while (1)
6 c0 f9 e& z; e5 z/ n- V/ \5 E {
/ j K4 f" u7 u //printf("好的");
/ {/ L8 A. c2 [8 @; y1 J$ q }/ e0 Z2 m: c' ~4 s: H8 a/ l! O
}*/" s+ p/ r% P* t+ ^$ t4 z
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1 D) o! y* p$ V8 z" c4 A4 LFRESULT Test_f_mkfs(BYTE drv)//对卡进行格式化,驱动器号一般为0
! B! P1 z) h. W1 W2 O0 w; F9 \{5 U+ Q" @( T9 D" S2 h
FATFS fs; // Work area (file system object) for logical drive. L1 c _) Z8 q% u X6 R& ]3 ]
FRESULT res; // FatFs function common result code
. c$ T# a! t1 i8 h8 @* U2 O8 m A+ o" }. m" N/ f
//检测磁盘是否插好
! c4 T1 s1 a- B$ T //if(disk_detect_OK()==FALSE ) return ;
1 l; u: x4 u8 q1 D3 X* K) a- n; a4 i2 f //printf("\r\n inaert_ok:>");0 n9 u6 I" a, X% u0 x. x" x
// Register a work area for logical drive 0
; Z2 w3 z2 C1 n5 T$ B( U8 W f_mount(drv, &fs);
0 ]4 {( I, d* }! G- b. Q& X5 t res=f_mkfs(drv, 0, 0);/* Create a file system on the drive 在驱动器创建一个文件系统(驱动器号,分区规则(0:FDISK, 1:SFD),分配的单元大小)*/( n6 y9 i2 Y- i' L6 \ ~
//die(res);
; d) e# b$ E; i5 d1 M f_mount(0, NULL);* H `/ P! v1 Q
return res;
! Z8 g J8 k( @; H7 a2 z/ W}4 m) e, X9 j0 } D# g- ]4 f
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////' ]) A0 B; x, _# t" X
FRESULT Test_f_mkdir(const TCHAR* path)//创建一个新目录,输入目录的路径Test_f_mkdir("/dir");只能一级一级的建立目录 / Z& _+ S! ~0 F% U
{& N( [" f1 `: ]8 M$ [& n
FATFS fs; // Work area (file system object) for logical drive
4 X, y7 L0 |3 C! X. T5 `; r FRESULT res; // FatFs function common result code N! v5 K( m1 I
! ?. t/ n) i: t //检测磁盘是否插好! {& A: F( H* M( R: S3 }0 K) `
//if(disk_detect_OK()==FALSE ) return ;
* X$ G4 j2 I3 u) ]2 Z //printf("\r\n inaert_ok:>");
" f b( V" T7 i, u // Register a work area for logical drive 0
* I7 ?/ P4 D4 b0 R f_mount(0, &fs);1 e( B2 M' L' m; t7 y& C. E+ \
res=f_mkdir(path);//创建一个新目录
; j( H$ N: o& _" Z //die(res);
3 G4 ^9 j3 s* h, S& N& p+ {' { f_mount(0, NULL);
' |6 n& D m* r c) H& Y& \4 E return res;2 _: C& i" R6 y! d4 `: D+ n
}, F% R* m4 F S6 Q" d5 {: W
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////4 ?0 p6 j4 j$ b4 c
FRESULT Test_f_deldir(const TCHAR* path)//删除一个目录,输入目录的路径;目录里的内容是空的才能删除Test_f_deldir("/dir");
* k/ [7 e, p f% e. C{9 D5 D% m+ |/ J9 Q6 C8 J; F
FATFS fs; // Work area (file system object) for logical drive* M5 J& [2 V4 ]7 r. l j6 I
//DIR dir; V1 P2 \) y1 q% W0 h& `4 l: z9 l
FRESULT res; // FatFs function common result code; l3 X7 I" n* D& M* y ]6 n
w* ~: P& V# Y! @ //检测磁盘是否插好
% w, b9 a3 q8 |5 E2 \; c //if(disk_detect_OK()==FALSE ) return ;
m( I) G1 N! c4 I! k3 A( ^+ b0 O //printf("\r\n inaert_ok:>");# N( ^" D6 y; O* ]' b) N
// Register a work area for logical drive 0" u* k n) k9 ]
f_mount(0, &fs);
! A& o8 k6 [0 K0 j9 b& K' N2 s //f_opendir (&dir,path);
1 r- ]# E8 D: l( ~2 N- U7 q1 f res=f_unlink(path);//删除一个目录
: N4 z) l8 C z0 p, P/ [0 { //die(res);
; `2 _6 U- N L( B f_mount(0, NULL);0 z/ Y/ s1 a! G* E* U( y
return res;1 g( e. I( o" m3 t6 P
}! q% I" n8 i5 P, U+ S4 W4 l
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////0 B1 e, y/ e' ~6 N/ j1 W4 y4 i
FRESULT Test_f_readdir(const TCHAR* path,char (*filename)[13])//获取目录中的文件,输入目录的路径;输出文件名和文件夹名Test_f_readdir("/DIR",name);char name[5][13] * f( B7 e) r' \$ x$ g; S
{! T, A3 W3 t9 @: {/ M( X% S, a; w9 W7 L
FATFS fs; // Work area (file system object) for logical drive9 Q( B' N6 I) j- V& P4 ^
DIR dir;1 X0 C( Q8 |# F$ o, p E1 K9 B
FILINFO finf;* ^/ o- B8 q9 @0 g& \6 G
FRESULT res; // FatFs function common result code
# [+ u1 S, z, J% Z" ^0 c4 k, d) p6 j3 F2 T
//检测磁盘是否插好$ L3 ^: n: B6 C$ |
//if(disk_detect_OK()==FALSE ) return ;: |- \2 U; M5 D
//printf("\r\n inaert_ok:>");$ j! `5 i% U- S! r) Q2 w
// Register a work area for logical drive 0
+ ]' z1 I, [* P f_mount(0, &fs);
5 S* _" {8 J% }4 ?& x f_opendir (&dir,path);) j2 q& S5 D/ t
& d4 B/ O1 l5 i% w% Z5 K while(((res=f_readdir(&dir,&finf))==FR_OK)&&(finf.fname[0]))//获取目录中的文件 + }/ S, P9 i4 g& E
{strcpy(*(filename++),finf.fname);3 @! C2 {3 L- j) k; a) {
//printf("%s",finf.fname);! [1 s/ s( Z1 `7 V! B1 D
}
) J R/ @' \# _5 I. o3 M //die(res);
C3 W8 u6 I! f( ^+ X6 z" u f_mount(0, NULL);
; k7 M" i- ]5 W, H1 F, G/ F return res;
* n+ f9 c( J' ~0 n}
4 D) ]& g4 V% P////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2 K1 ?" u3 N" ]! H) jFRESULT Test_f_creat(const TCHAR* path)//建立文件,输入文件路径和文件名5 H0 Y* \- |) R
{
1 \" J" }! P3 i- \ FATFS fs; // Work area (file system object) for logical drive, t" l! v8 H3 s3 v a/ Y$ Z
FIL file;1 X! w# l6 c) o& f* V1 t2 [$ d
FRESULT res; // FatFs function common result code% P/ Y r2 `1 M' F6 i. ?
! w* K* R9 B, C! @ W; M5 }3 ?! g //检测磁盘是否插好1 x6 Y2 M0 q1 R* k/ @ h( ^
//if(disk_detect_OK()==FALSE ) return ;8 b" C4 _, A! c5 K' n$ R% \
//printf("\r\n inaert_ok:>");+ D B' i. \+ A$ a' z
// Register a work area for logical drive 0
0 y( w) L0 i* L) m* I" @ B) H7 ` f_mount(0, &fs);
! e9 I7 H7 q! O3 V* Q- x res=f_open(&file,path,FA_CREATE_NEW); //创建一个新文件。如果文件已存在,则创建失败//FA_CREATE_NEW创建一个新文件。如果文件已存在,则创建失败。$ C6 f* G- K9 x; X3 y4 k( l
//FA_CREATE_ALWAYS //创建一个新文件。如果文件已存在,则它将被截断并覆盖。
6 C6 U3 S. q* g- z. @ //FA_OPEN_ALWAYS //如果文件存在,则打开;否则,创建一个新文件。) \4 f0 v0 }$ B" l* s
//die(res);
0 [$ S, L- U; Y5 P! z6 D f_close(&file);//关闭文件
- X3 [7 ^1 E9 B3 c4 R* b f_mount(0, NULL);9 _% u7 c" D9 Y4 ?/ A
return res; I" f$ L0 k0 o% h
}& Q4 V' x3 `1 p: W! y% b2 k
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
8 w5 Y1 M! K2 g7 PFRESULT Test_f_delfile(const TCHAR* path)//删除一个文件,输入文件的路径;Test_f_delfile("/dir"); $ |' w5 \" W; a
{
8 g3 a5 j4 H4 x, E4 K FATFS fs; // Work area (file system object) for logical drive
' A: S( q: I. u( g- X4 I //DIR dir;9 s- B+ e% O" i7 \0 W
FRESULT res; // FatFs function common result code
; K* f" ]# M3 `. i$ n7 B/ w% q6 i" ?* |0 z) v+ ~
//检测磁盘是否插好( v$ O9 P; u9 K% s1 F) Y
//if(disk_detect_OK()==FALSE ) return ;) |2 S& o! t0 r
//printf("\r\n inaert_ok:>");
5 T+ p3 q% }4 t! t9 k* D // Register a work area for logical drive 0
/ x" e% @! p0 ]* M- x/ w( I f_mount(0, &fs);
* z h5 }3 n5 a+ m9 C8 f //f_opendir (&dir,path);( e( D: i# o# n2 E( \$ J( i
res=f_unlink(path);//删除一个文件
& J# a6 a+ I F; H! r //die(res);
! E8 }* q/ |! \. q f_mount(0, NULL);
4 I6 t' U* N; K& z* X5 Y; I return res;
' Q+ M( s* j: b}
3 r9 ` P6 s' d) Y////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$ x1 Y3 `4 v4 ~& z$ @FRESULT Test_f_readfile(const TCHAR* path,char *buff,DWORD ofs,UINT strl)//读文件的数据,如果没有此文件则返回错误;输入文件的路径名,内容缓存,读取开始偏移指针,读取的字节数& u: s- }! _* `! v# L$ x. A: J
{ //Test_f_readfile("/dir/r.txt",str,0,sizeof(strr));
6 X/ p2 }# q/ O$ d+ P4 H \% ?9 y FATFS fs; // Work area (file system object) for logical drive
# U, A& j) k2 U! z: P" l7 i FIL file; // file objects4 I9 K: @+ b! T) i
FRESULT res; // FatFs function common result code0 Z7 G8 ], A% z; X4 C; X5 g5 ?. ]
UINT br; // File R count 文件读回的字节计数. }! Z, [) z0 W
//u16 i;2 V1 s6 [6 |, c9 G
//检测磁盘是否插好0 u+ \1 P7 p: o
//if( disk_detect_OK()==FALSE ) return;" e1 e/ t6 \3 ]2 _$ E9 O7 L5 `
// Register a work area for logical drive 0' Z" H/ Z6 g; F. U" n2 R# H( q
//for(i=0;i<sizeof(buff);i++) buff[i]='\0';
Y- u. C5 K# t% c f_mount(0, &fs);
: {. [& L" v' F' c9 V- l9 ^ //Open source file
Q9 z: j. I. _* l res = f_open(&file, path, FA_OPEN_EXISTING | FA_READ);//打开存在的文件,如果没有则返回错误# X, C) {" T1 G8 K6 e: ]1 X* M
//die(res); S3 b4 c0 Q8 h
res = f_lseek(&file,ofs); //指针移到文件ofs个字节处
; a: m. e' b" e$ i. k //buffer空间设大一点,会提高读的速度。
9 r1 A' S, T3 x$ s# v" s //如果文件实际大小512byte,0 L; _, N, q* d; S( m
//设为buffer[512]时,只需要循坏一次,如果设为buffer[1],需要循坏512次。/ n- z H+ h# o* Y0 a4 E
//for (;;) ' A3 a k* Y6 ]9 W- Q8 U2 @
{# ^1 ?( z9 p. H2 l+ _) \
//for(i=0;i<sizeof(buff);i++) buff[i]='\0';//清除缓存
~. W- j( {+ f2 q/ c4 V% [# @( o8 R& \
res = f_read(&file, buff, strl, &br);
* e4 S$ N3 z' R //if (res ||(br == 0)) break; // error or eof如果错误或者到文件末尾则退出
4 |* P( ?# m$ V$ z$ [1 R
0 C% y8 V1 x" i //printf("%s",buff); & Z8 L" D5 H7 H. m/ H5 I2 n
}
- t* [& F7 p. P+ H/ @; l // Close all files& M' {% }/ \, f0 i7 W o
f_close(&file);
1 `7 A2 C/ b0 y, [5 A s // Unregister a work area before discard it3 \$ N m0 V5 L& G+ C, a$ C
f_mount(0, NULL);. v7 j N# b. e; }7 A" N. x8 |
return res;
1 {! ~# Z) x# h}# D3 z( E' P* S4 k# S+ b! I
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////' p( \: o, R$ t# C- j
FRESULT Test_f_writefile(const TCHAR* path,char *buff,DWORD ofs,UINT strl)//写数据到文件,如果没有此文件则创建文件;输入文件的路径名,内容缓存,写开始偏移指针,写的字节数6 K' Y- x; q2 b0 U; _, N7 z/ b
{ //Test_f_writefile("/dir/r.txt",strw,0,strlen(strw));
* y, I! b Q0 x0 o FATFS fs; // Work area (file system object) for logical drive9 d, w* g' I! w# y# [2 m* ]
FRESULT res; // FatFs function common result code
) O7 C9 h' p( Y8 ?1 ]: \ FIL file;
: \5 v# W" v9 J; Q# h% j9 g UINT bw; //文件写入的字节计数
* ~! _% D5 ~1 p7 h F H. N //检测磁盘是否插好
: Y! H4 e: @3 K+ ~( g9 _ //if( disk_detect_OK()==FALSE ) return;
% g5 O1 ]0 I! G7 X( y% i1 Y // Register a work area for logical drive 0
0 V( _! T0 Z1 j# b8 L f_mount(0, &fs);
+ N& r# J0 {5 s9 T3 t" S8 Q res = f_open(&file, path, FA_OPEN_ALWAYS | FA_WRITE); //可写方式打开 没有文件则创建 8 ?% r) Z" s/ O6 u: ~2 {- j
//die(res);2 o7 O6 x3 p) I: e: g, v1 Q
res = f_lseek(&file, ofs); //指针移到文件ofs处;输入file.fsize指针移到文件最后 4 T( C8 `; j/ t
//die(res);
# J7 b5 Y4 j; e- q& W res = f_write(&file, buff, strl, &bw); //每次需要写入的数据字节数;如果btr为strlen(buff)则写入所有的字符
4 d% F* d( ^0 k I3 B0 n. Z //die(res);( g: ~: ]7 [! x3 V: d# F: F
//res = f_lseek(&file, Make_file.fsize); //指针移到文件最后,一边再一次的写入 4 A' i7 t$ ^1 F0 b
f_close(&file);//关闭文件. g3 [) l {. P# c2 ?1 l
// Unregister a work area before discard it
& [9 |4 m% b9 n; v& Z+ ] f_mount(0, NULL);: q) D4 i( P; r# F, K$ m: o
return res;
% v; f2 O' M6 T, K d. K. ?' x2 |}% I8 G$ n' B* J R/ X
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////1 ^' p. l8 Z4 P) ~, X
FRESULT Test_f_getfreem(DWORD *freem)//获取卡的剩余容量单位为M
5 u- S9 x* U5 c7 q5 Y T9 M2 C{
/ V5 D4 P+ B- S5 Y, a3 m FATFS fs;
@# Z7 j$ o8 @1 G% N$ z: y1 w6 G FATFS *pfs;5 x: q* ^3 i: V5 W5 z& |; B
FRESULT res; // FatFs function common result code
# A8 Y Y7 w6 \, N //检测磁盘是否插好+ O r8 L0 j9 ?
//if( disk_detect_OK()==FALSE ) return;$ A$ h; S' l8 I$ E$ `. l2 G
// Register a work area for logical drive 0+ ]$ \- M9 E: q) `
pfs=&fs;//指向0 f3 p, {% h$ ~+ x
f_mount(0, &fs);//安装FATFS,就是给FATFS分配空间; x3 u& ]" h2 E- z' P
// Get free clusters% T. |" m2 S) [1 t5 r
res = f_getfree("/",freem,&pfs);//必须是根目录,默认磁盘0;"/"或者"0:/"+ S7 a2 ~ \7 b# x6 V& r# c
//die(res);. W* f1 D+ B; z& r( }
if ( res==FR_OK ) 2 n/ p$ e( F, B6 n! I
{
( u. j6 @$ H; s5 p! I. a$ t7 { // Get free space
9 u9 `. C4 h. K4 V; v8 j //printf("\r\n%d MB total disk space.\r\n%d MB available on the disk.\r\n",& y3 }0 s5 V+ g+ m) C9 @4 x, k
//(DWORD)(pfs->n_fatent - 2) * (pfs->csize) /2/1024,//总的磁盘空间M =(总簇数-2)*每簇的扇区数/2/1024=可用簇数*每簇的扇区数/2/1024
+ u/ C( T9 C8 _! z //(*freem)*(pfs->csize)/2/1024);//空闲的磁盘空间M=剩余簇数*每簇的扇区数/2/10244 m( r0 Q; w3 \
*freem=((*freem)*pfs->csize)/2/1024;1 t; y; @( A, Y
}8 l" b1 q6 g# G H3 ~4 Y: [
//else die(res);//测试函数执行结果分析
4 }' [8 p8 S9 u- S+ x# H1 L# s( U/ D& Z( q // Unregister a work area before discard it8 D4 e4 ]# s# `- E0 [" q: B
f_mount(0, NULL);//卸载FATFS,就是释放FATFS结构体所占空间$ T- x( T" h" C; P$ H
return res;' m; k, N; Z' e# K* Q
}$ P3 |9 n' Q4 S0 h0 B& h
! V9 k, B' ~7 p) X, t
' r$ p9 |+ o" X& G2 C
, t# M) M" p8 z3 Y; G/ w/ Feb 26,'06 R0.00 Prototype.
$ A- p0 p( a0 c! _" Z/* i# B# Q2 I& K; y) x
/ Apr 29,'06 R0.01 First stable version.
5 r: G6 ]* c, \2 r/4 f) f u6 @# }: `, N! o
/ Jun 01,'06 R0.02 Added FAT12 support.
5 \1 p* ]5 B `+ [# z/ Removed unbuffered mode.
4 J' B! ]3 k) D' q/ Fixed a problem on small (<32M) partition.
2 I+ q e( L8 Q% |/ Jun 10,'06 R0.02a Added a configuration option (_FS_MINIMUM).
3 R6 b8 M o% c1 j0 l/( a( j& r- `* E; }" Q! A# k1 p, {) C
/ Sep 22,'06 R0.03 Added f_rename().* C3 m9 `$ A% Q7 g) v6 R
/ Changed option _FS_MINIMUM to _FS_MINIMIZE.
# k& }8 _: t0 M/ K/ Dec 11,'06 R0.03a Improved cluster scan algorithm to write files fast.
$ A G6 I; p5 c# w/ Fixed f_mkdir() creates incorrect directory on FAT32.$ u. g6 M% ^1 Q y1 ?3 B4 I" i4 L: `
/2 ~. X5 s& h, c) ]5 y1 |. h0 r
/ Feb 04,'07 R0.04 Supported multiple drive system. ~8 N' j- Y) b! d! t! t F
/ Changed some interfaces for multiple drive system.
) ]+ T; t& _0 b: N4 G/ Changed f_mountdrv() to f_mount().3 E; y0 C0 x$ d% \9 _4 b, v% ^, V
/ Added f_mkfs().4 u" C- J6 W. k+ B$ \
/ Apr 01,'07 R0.04a Supported multiple partitions on a physical drive.
' s& q" V) {4 v+ J/ Added a capability of extending file size to f_lseek().- C P* p, Q f; r' ?
/ Added minimization level 3.
. M: P! W$ |9 S' O' M/ Fixed an endian sensitive code in f_mkfs().2 p/ t: H8 \& \( P/ M4 i1 `
/ May 05,'07 R0.04b Added a configuration option _USE_NTFLAG.
/ h* B) B: s* U( g! D0 C/ Added FSInfo support.
- m# T, ^7 @0 h+ Z! D! N7 z n/ Fixed DBCS name can result FR_INVALID_NAME.+ n6 E. ?8 e" ?
/ Fixed short seek (<= csize) collapses the file object.
+ E& [! s. h6 D6 H( E2 G7 L2 w/# b) y) z7 Y* B" ^6 m3 w4 J# q' }% t
/ Aug 25,'07 R0.05 Changed arguments of f_read(), f_write() and f_mkfs().
/ K! J; {4 q; F3 `, F/ Fixed f_mkfs() on FAT32 creates incorrect FSInfo.
# A2 D( Q# C! B. K/ Fixed f_mkdir() on FAT32 creates incorrect directory.9 h; { Y( z7 P! Z% j" n
/ Feb 03,'08 R0.05a Added f_truncate() and f_utime().
1 U( T1 I/ f+ q( |& N, K4 z; W; i/ Fixed off by one error at FAT sub-type determination.
" U8 k; L- u6 f: @3 U. R/ Fixed btr in f_read() can be mistruncated.
, G1 D4 r0 \9 y5 T; S5 Z( d/ Fixed cached sector is not flushed when create and close without write.
& E1 S* F$ U) Q/ Z/
" z c( E! O( q: O/ Apr 01,'08 R0.06 Added fputc(), fputs(), fprintf() and fgets().; D' i9 h4 l, U4 |0 I5 j3 K
/ Improved performance of f_lseek() on moving to the same or following cluster.
5 g8 Y7 \% f% p! ]6 I, O/8 \& K- g( t: ^, j( a! I- O
/ Apr 01,'09 R0.07 Merged Tiny-FatFs as a configuration option. (_FS_TINY)) R. O, y& a' w; z+ ]4 _4 U
/ Added long file name feature., T$ w4 n; U" p1 L5 z' V& j
/ Added multiple code page feature.* `# \" f8 }. ~# g2 r" U+ K* D
/ Added re-entrancy for multitask operation.
6 L3 ?' @0 d( h0 h- [: b3 e/ Added auto cluster size selection to f_mkfs().. H4 w' | @1 ?6 l8 b _5 R
/ Added rewind option to f_readdir().
, p7 L+ H2 g5 ]6 ^0 X/ Changed result code of critical errors.
! T6 i8 y' J+ ^/ t& O/ Renamed string functions to avoid name collision.8 ~" v- ]4 F9 R6 Y* R* S
/ Apr 14,'09 R0.07a Separated out OS dependent code on reentrant cfg.% l! ~8 m$ _+ Z$ F
/ Added multiple sector size feature.
7 } l2 [, o( |5 G/ Jun 21,'09 R0.07c Fixed f_unlink() can return FR_OK on error.) ~" m/ c% Q4 e* b+ w6 a- F8 K
/ Fixed wrong cache control in f_lseek().) G7 g! T3 o4 P! w
/ Added relative path feature.$ r3 z* ]1 @" q. J/ y+ k7 F% U
/ Added f_chdir() and f_chdrive().
8 ~0 u5 |4 b" q4 g6 ~8 C9 }3 o/ Added proper case conversion to extended char.
0 ?! V$ a8 j6 m: O# e- K/ Nov 03,'09 R0.07e Separated out configuration options from ff.h to ffconf.h.
2 Q, p4 F* g% q8 ~ a: e/ Fixed f_unlink() fails to remove a sub-dir on _FS_RPATH.
8 O9 [) o: Q9 v: H$ a0 v/ Fixed name matching error on the 13 char boundary.! _' f, x1 e& ]$ Q
/ Added a configuration option, _LFN_UNICODE.
& X2 n% Z' m; K5 j' s9 S2 I8 o7 F1 ]/ Changed f_readdir() to return the SFN with always upper case on non-LFN cfg., n# @/ z% \* w" i
/
1 D2 }4 z. a- G5 |/ _/ May 15,'10 R0.08 Added a memory configuration option. (_USE_LFN = 3)
" f) ]# A8 r# w, m/ Added file lock feature. (_FS_SHARE)
" [9 x0 v% t t w5 v9 S# j2 }+ z/ Added fast seek feature. (_USE_FASTSEEK)
9 j9 l) X7 s! y" s8 ]/ Changed some types on the API, XCHAR->TCHAR.3 c: Q2 u- P: X- k( M8 Y
/ Changed fname member in the FILINFO structure on Unicode cfg.5 |+ x! q1 K5 I4 R) J0 H
/ String functions support UTF-8 encoding files on Unicode cfg./ M1 J5 s2 t* r; f% C& u" G& ]8 E7 _: C
/ Aug 16,'10 R0.08a Added f_getcwd(). (_FS_RPATH = 2)1 {8 E! h0 J. v$ s* F/ K" u: ]
/ Added sector erase feature. (_USE_ERASE)5 U+ V U# h* [" N+ _6 q
/ Moved file lock semaphore table from fs object to the bss.
% g L' w7 M1 k \/ Fixed a wrong directory entry is created on non-LFN cfg when the given name contains ';'.% f$ c4 V5 r# _' X
/ Fixed f_mkfs() creates wrong FAT32 volume.
8 ~0 H% n7 I; Z7 v! G# ]/ Jan 15,'11 R0.08b Fast seek feature is also applied to f_read() and f_write().: R. B3 l7 K1 P' f9 v N5 K
/ f_lseek() reports required table size on creating CLMP.
" R6 `( m+ N1 ^$ s; \0 G4 T( Z/ Extended format syntax of f_printf function.
, d; h0 t) R8 t+ @2 V6 n3 }' D/ Ignores duplicated directory separators in given path names.3 S! w1 s2 K( N) u1 T' c, I
/
) K1 r" }( x$ W8 [2 q u. \2 K/ Sep 06,'11 R0.09 f_mkfs() supports multiple partition to finish the multiple partition feature.
- {5 `+ b8 ?; C7 N2 R- t F3 t/ Added f_fdisk(). (_MULTI_PARTITION = 2)5 Q l2 X7 c' R4 g
/---------------------------------------------------------------------------*/8 X: P Y* B1 R/ W# W9 c/ t
& c+ O/ G0 d0 a f" R5 Y |
|