FSVol_Fmt()

void  FSVol_Fmt (CPU_CHAR  *name_vol,
                 void      *p_fs_cfg,
                 FS_ERR    *p_err);

File

Called from

Code enabled by

fs_vol.c

Application

not FS_CFG_RD_ONLY_EN

Format a volume.

Arguments

name_vol

Colume name.

p_fs_cfg

Pointer to file system driver-specific configuration. For all file system drivers, if this is a pointer to NULL, then the default configuration will be selected. More information about the appropriate structure for the FAT file system driver can be found in FS_FAT_SYS_CFG.

p_err

Pointer to variable that will receive the return error code from this function

FS_ERR_NONE

Volume formatted.

FS_ERR_DEV

Device error.

FS_ERR_DEV_INVALID_SIZE

Invalid device size.

FS_ERR_NAME_NULL

Argument name_vol passed a NULL pointer.

FS_ERR_VOL_DIRS_OPEN

Directories open on volume.

FS_ERR_VOL_FILES_OPEN

Files open on volume.

FS_ERR_VOL_INVALID_SYS

Invalid file system parameters.

FS_ERR_VOL_NOT_OPEN

Volume not open.

Required Configuration

None.

Notes/Warnings

  • Function blocked if files or directories are open on the volume. All files and directories must be closed prior to formatting the volume.
  • For any file system driver, if p_fs_cfg is a pointer to NULL, then the default configuration will be selected. If non-NULL, the argument should be passed a pointer to the appropriate configuration structure. For the FAT file system driver, p_fs_cfg should be passed a pointer to a FS_FAT_SYS_CFG.