📄 file_sys.c
字号:
/*
Progressive Resources LLC
FlashFile
Version : 2.00
Date: 11/01/2004
Author: Erick M. Higa
Revision History:
12/31/2003 - EMH - v1.00
- Initial Release
01/19/2004 - EMH - v1.10
- Fixed FAT access errors by allowing both FAT tables to be updated
- Fixed erase_cluster chain to stop if chain goes to '0'
- Fixed #include's so other non m128 processors could be used
- Fixed fcreate to match 'C' standard for function "creat"
- Fixed fseek so it would not error when in "READ" mode
- Modified SPI interface to use _FF_spi() so it is more universal
(see the "sd_cmd.c" file for the function used)
- Redifined global variables and #defines for more unique names
- Added string functions fputs, fputsc, & fgets
- Added functions fquickformat, fgetfileinfo, & GetVolID()
- Added directory support
- Modified delays in "sd_cmd.c" to increase transfer speed to max
- Updated "options.h" to include additions, and to make #defines
more universal to multiple platforms
01/21/2004 - EMH - v1.20
- Added ICC Support to the FlashFileSD
- Fixed card initialization error for MMC/SD's that have only a boot
sector and no partition table
- Fixed intermittant error on fcreate when creating existing file
- Changed "options.h" to #include all required files
02/19/2004 - EMH - v1.21
- Replaced all "const" refrances to "flash" to support CodeVision 1.24.1b
03/02/2004 - EMH - v1.22 (unofficial release)
- Changed Directory Functions to allow for multi-cluster directory entries
- Added function addr_to_clust() to support long directories
- Fixed FAT table address calculation to support multiple reserved sectors
(previously) assumed one reserved sector, if XP formats card sometimes
multiple reserved sectors - thanks YW
03/10/2004 - EMH - v1.30
- Added support for a Compact Flash package
- Renamed read and write to flash function names for multiple media support
03/26/2004 - EMH - v1.31
- Added define for easy MEGA128Dev board setup
- Changed demo projects so "option.h" is in the project directory
04/01/2004 - EMH - v1.32
- Fixed bug in "prev_cluster()" that didn't use updated FAT table address
calculations. (effects XP formatted cards see v1.22 notes)
05/07/2004 - EMH - v1.33
- Fixed bug in "fflush()" and "fopen()" that was incorrectly handling blank
files on certain MMC/SD cards.
05/17/2004 - EMH - v1.34
- Fixed bug "fopen()" that was incorrectly writing to 0xFE00 + _FF_DIR_ADDR
if opening a file in "WRITE" mode (bug since v1.22).
- Fixed bug in "append_toc()" that was incorrectly updating the time/date
stamp if _RTC_ON_ is NOT defined.
05/17/2004 - EMH - v1.40
- Added IAR EWAVR Support to the FlashFile
06/14/2004 - EMH - v1.41
- Fixed bug in "fflush()" that was incorrectly saving the last sector of a
cluster to the first if saving or closing a file at the end of file AND at
the end of a cluster.
11/01/2004 - EMH - v2.00
- Changing code to use structures and unions to optimize code to run faster
and use less code space.
- Fixed bug in fgets() that was reading too long if the line was >= n, and
it was returning the wrong pointer.
- Changing code to use sector addressing rather than direct memory addressing
to save code space and speed up time.
- Added _DIRECTORIES_SUPPORTED_ switch to options.h to enable or disable (less
code space) the use of directories.
- Added _NO_MALLOC_ switch to options.h to enable or disable the need of a
malloc() function.
- Added _BytsPerSec_512_ switch to options.h to enable or disable the BPB_BytsPerSec
variable. In all current flash media, there are 512 bytes per sector, and there
really is no need to have it as a variable. Enabling _BytsPerSec_512_ will hard
code all references to BPB_BytsPerSec as 0x200 or 512. This will cut down on code
space and speed the functions up a bit since << 9 and >> 9 can replace * 512 and
/ 512, and & 0x1FF can replace % 512.
- Fixed bug in addr_to_clust() that was checking if sector # was <= FirstDataSector
where it should just be < FirstDataSector.
- Added ability in initialize_media() for the calculations to look for the first
partition location in all four partition entry spaces rather than just the first.
- Fixed bug in scan_directory() that did not always 0xE5 as an empty file location.
- Fixed Directory support (scan_directory(), fcreate(), and mkdir()) so that multi
cluster sub-directories could be read.
- Fixed Initialization of the File Structure that was intermittantly causing errors in
fopen() and fcreate().
- Fixed bug in fcreatec(), fopenc(), and fget_file_infoc() that was not always handling
full length filenames of files correctly.
- Combined code so that CodeVision, ImageCraft, and IAR all use the same base code.
- Updated fprintf() in ImageCraft and IAR versions so that the use vsprintf and can be
used just like a printf().
- Added fread() and fwrite() functions.
Software License
The use of Progressive Resources LLC FlashFile Source Package indicates
your understanding and acceptance of the following terms and conditions.
This license shall supersede any verbal or prior verbal or written, statement
or agreement to the contrary. If you do not understand or accept these terms,
or your local regulations prohibit "after sale" license agreements or limited
disclaimers, you must cease and desist using this product immediately.
This product is
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -