![]() |
|
| << Previous | Next >> | |
| | |
int fs_format( long reserveblocks, int num_blocks, unsigned long wearlevel );
Description
- Initializes the internal data structures and file system. All blocks in the file system are erased.
Parameters
- reserveblocks
- Starting address of the flash file system. When
FS_FLASHis defined this value should be 0 or a multiple of the block size. WhenFS_RAMis defined this parameter is ignored.
- num_blocks
- The number of blocks to allocate for the file system. With a default block size of 4096 bytes and a 256K flash memory, this value might be 64.
- wearlevel
- This value should be 1 on a new flash memory, and some higher value on an unformatted used flash memory. If you are reformatting a flash memory you can set
wearlevelto 0 to keep the old wear leveling.
Return value
0: Success.
1: Failure.Library
- FILESYSTEM.LIB
Example
- This program can be found in
samples/filesystem/format.c.
| Dynamic C Functions | << Previous | Next >> | rabbit.com |