generated from Embedded_Projects/Landzo_K60Z_LwIP
33 lines
599 B
C
33 lines
599 B
C
/* FreeRTOS */
|
|
#include "FreeRTOS.h"
|
|
#include "semphr.h"
|
|
#include "task.h"
|
|
|
|
/* FatFS */
|
|
#include "ff.h"
|
|
|
|
void *ff_memalloc(UINT msize) {
|
|
return pvPortMalloc(msize);
|
|
}
|
|
|
|
void ff_memfree(void *mblock) {
|
|
vPortFree(mblock);
|
|
}
|
|
|
|
int ff_cre_syncobj(BYTE vol, FF_SYNC_t *sobj) {
|
|
*sobj = xSemaphoreCreateMutex();
|
|
return (int)(*sobj != NULL);
|
|
}
|
|
|
|
int ff_del_syncobj(FF_SYNC_t sobj) {
|
|
vSemaphoreDelete(sobj);
|
|
return 1;
|
|
}
|
|
|
|
int ff_req_grant(FF_SYNC_t sobj) {
|
|
return (int)(xSemaphoreTake(sobj, FF_FS_TIMEOUT) == pdTRUE);
|
|
}
|
|
|
|
void ff_rel_grant(FF_SYNC_t sobj) {
|
|
xSemaphoreGive(sobj);
|
|
} |