A media partition must be formatted before it can be used. The
FF_Format() function is used for this purpose.
As an example, below is the outline of the prvFormatPartition() function
used by FreeRTOS-Plus-FAT's RAM disk driver. prvFormatPartition() is called by
the RAM disk's initialisation function and demonstrates how to use the
FF_Format() function. See the file
ff_ramdisk.c in the
FreeRTOS-Plus/Source/FreeRTOS-Plus-FAT/portable/common directory
for the full version.
static BaseType_t prvFormatPartition( FF_Disk_t *pxDisk, BaseType_t xPartitionToFormat )
{
BaseType_t xReturn;
FF_Error_t xError;
xError = FF_Format( pxDisk->pxIOManager, xPartitionToFormat, pdTRUE, pdTRUE );
if( FF_isERR( xError ) != pdFALSE )
{
xReturn = pdFAIL;
}
else
{
xReturn = pdPASS;
}
return xReturn;
}
Formatting a Partition
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.