mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fatfs: create separate ffsystem.c for host side testing
This commit is contained in:
parent
66bdeca603
commit
8f6606141a
@ -3,7 +3,7 @@ idf_component_register(SRCS "diskio/diskio.c"
|
||||
"diskio/diskio_sdmmc.c"
|
||||
"diskio/diskio_wl.c"
|
||||
"src/ff.c"
|
||||
"port/ffsystem.c"
|
||||
"port/freertos/ffsystem.c"
|
||||
"src/ffunicode.c"
|
||||
"vfs/vfs_fat.c"
|
||||
"vfs/vfs_fat_sdmmc.c"
|
||||
|
@ -1,3 +1,3 @@
|
||||
COMPONENT_ADD_INCLUDEDIRS := diskio vfs src
|
||||
COMPONENT_SRCDIRS := diskio vfs port src
|
||||
COMPONENT_SRCDIRS := diskio vfs port/freertos src
|
||||
COMPONENT_OBJEXCLUDE := src/diskio.o src/ffsystem.o
|
||||
|
@ -10,6 +10,7 @@
|
||||
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/time.h>
|
||||
#include "diskio_impl.h"
|
||||
#include "ffconf.h"
|
||||
|
@ -12,12 +12,6 @@
|
||||
#include "esp_heap_caps.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
/* Allocate a memory block */
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
void* ff_memalloc ( /* Returns pointer to the allocated memory block (null on not enough core) */
|
||||
unsigned msize /* Number of bytes to allocate */
|
||||
)
|
||||
@ -111,4 +105,4 @@ void ff_rel_grant (
|
||||
xSemaphoreGive(sobj);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif // FF_FS_REENTRANT
|
46
components/fatfs/port/linux/ffsystem.c
Normal file
46
components/fatfs/port/linux/ffsystem.c
Normal file
@ -0,0 +1,46 @@
|
||||
/*------------------------------------------------------------------------*/
|
||||
/* OS Dependent Functions for FatFs */
|
||||
/* (C)ChaN, 2018 */
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#include "ff.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
/* This is the implementation for host-side testing on Linux.
|
||||
* Host-side tests are single threaded, so lock functionality isn't needed.
|
||||
*/
|
||||
|
||||
void* ff_memalloc(UINT msize)
|
||||
{
|
||||
return malloc(msize);
|
||||
}
|
||||
|
||||
void ff_memfree(void* mblock)
|
||||
{
|
||||
free(mblock);
|
||||
}
|
||||
|
||||
/* 1:Function succeeded, 0:Could not create the sync object */
|
||||
int ff_cre_syncobj(BYTE vol, FF_SYNC_t* sobj)
|
||||
{
|
||||
*sobj = NULL;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* 1:Function succeeded, 0:Could not delete due to an error */
|
||||
int ff_del_syncobj(FF_SYNC_t sobj)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* 1:Function succeeded, 0:Could not acquire lock */
|
||||
int ff_req_grant (FF_SYNC_t sobj)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
void ff_rel_grant (FF_SYNC_t sobj)
|
||||
{
|
||||
}
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "sdkconfig.h"
|
||||
|
||||
/*---------------------------------------------------------------------------/
|
||||
/ FatFs Functional Configurations
|
||||
/---------------------------------------------------------------------------*/
|
||||
|
@ -1,13 +1,13 @@
|
||||
SOURCE_FILES := \
|
||||
$(addprefix ../src/, \
|
||||
ff.c \
|
||||
ffsystem.c \
|
||||
ffunicode.c \
|
||||
) \
|
||||
$(addprefix ../diskio/,\
|
||||
diskio.c \
|
||||
diskio_wl.c \
|
||||
)
|
||||
) \
|
||||
../port/linux/ffsystem.c
|
||||
|
||||
INCLUDE_DIRS := \
|
||||
. \
|
||||
|
Loading…
Reference in New Issue
Block a user