Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ rich set of detailed error codes.
For more details, please visit
[FreeRTOS+FAT](https://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_FAT/index.html) page.

## Current working directory support

Set `ffconfigHAS_CWD` to `1` in `FreeRTOSFATConfig.h` to maintain a current
working directory (CWD) for each task that accesses the file system. This allows
file operations to use relative paths and makes the `ff_chdir()` and
`ff_getcwd()` APIs available. Set it to `0` to disable CWD support; file
operations must then use full paths.

When CWD support is enabled, `ffconfigCWD_THREAD_LOCAL_INDEX` must identify a
free slot in the FreeRTOS thread-local storage pointer array. The CWD is stored
per task, so each task can have its own working directory.

## To consume FreeRTOS+FAT

### Consume with CMake
Expand Down
8 changes: 6 additions & 2 deletions ff_dev_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ enum eCACHE_ACTION
eCACHE_REMOVE,
};

const char pcDevicePath[] = ffconfigDEV_PATH;

//const char pcDevicePath[] = ffconfigDEV_PATH;
const char pcDevicePath[] = "/dev";
struct SFileCache * pxFindFile( const char * pcFname,
enum eCACHE_ACTION eAction )
{
Expand Down Expand Up @@ -170,6 +170,8 @@ size_t FF_Device_Read( void * pvBuf,
FF_FILE * pxStream )
{
lCount *= lSize;
(void)pvBuf; /*SQUASH*/
(void)pxStream ; /*SQUASH*/
return lCount;
}

Expand All @@ -179,6 +181,7 @@ size_t FF_Device_Write( const void * pvBuf,
FF_FILE * pxStream )
{
lCount *= lSize;
(void)pvBuf; /*SQUASH*/

if( pxStream->pxDevNode != NULL )
{
Expand Down Expand Up @@ -216,6 +219,7 @@ int FF_Device_GetDirEnt( const char * pcPath,
FF_DirEnt_t * pxDirEnt )
{
BaseType_t xIsDotDir = 0;
(void)pcPath; /*SQUASH*/

if( pxDirEnt->pcFileName[ 0 ] == '.' )
{
Expand Down
Loading