Lockpick_RCM/source/libs/fatfs/ffsystem.c

40 lines
1.3 KiB
C
Raw Permalink Normal View History

2019-03-04 23:05:42 +00:00
/*------------------------------------------------------------------------*/
/* Sample Code of OS Dependent Functions for FatFs */
2019-04-18 16:47:34 +00:00
/* (C) ChaN, 2018 */
2019-03-04 23:05:42 +00:00
/* (C) CTCaer, 2018 */
/*------------------------------------------------------------------------*/
2020-06-26 20:17:06 +00:00
#include <libs/fatfs/ff.h>
#include <mem/heap.h>
2019-03-04 23:05:42 +00:00
#if FF_USE_LFN == 3 /* Dynamic memory allocation */
/*------------------------------------------------------------------------*/
/* Allocate a memory block */
/*------------------------------------------------------------------------*/
2019-04-18 16:47:34 +00:00
void* ff_memalloc ( /* Returns pointer to the allocated memory block (null if not enough core) */
2019-03-04 23:05:42 +00:00
UINT msize /* Number of bytes to allocate */
)
{
return malloc(msize); /* Allocate a new memory block with POSIX API */
}
/*------------------------------------------------------------------------*/
/* Free a memory block */
/*------------------------------------------------------------------------*/
void ff_memfree (
2019-04-18 16:47:34 +00:00
void* mblock /* Pointer to the memory block to free (nothing to do if null) */
2019-03-04 23:05:42 +00:00
)
{
free(mblock); /* Free the memory block with POSIX API */
}
#endif