Once a partition has been formatted it can be mounted. The
FF_Mount() function is used for this purpose.
As an example, below is the outline of the prvMountPartition() function
used by FreeRTOS-Plus-FAT's RAM disk driver. prvMountPartition() is called by
the RAM disk's initialisation function and demonstrates how to use the
FF_Mount() 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 prvMountPartition( FF_Disk_t *pxDisk, BaseType_t xPartitionToMount )
{
FF_Error_t xError;
BaseType_t xReturn;
pxDisk->xStatus.bPartitionNumber = xPartitionToMount;
xError = FF_Mount( pxDisk->pxIOManager, xPartitionToMount );
if( FF_isERR( xError ) == pdFALSE )
{
pxDisk->xStatus.bIsMounted = pdTRUE;
xReturn = pdPASS;
}
else
{
xReturn = pdFALSE;
}
return xReturn;
}
Mounting a Partition
FreeRTOS-Plus-FAT implements a virtual file system, in which each mounted
partition appears as a directory. Mounted partitions are added to the
virtual file system using the ff_fs_add() function.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.