ffsystem.c 962 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*------------------------------------------------------------------------*/
  2. /* OS Dependent Functions for FatFs */
  3. /* (C)ChaN, 2018 */
  4. /*------------------------------------------------------------------------*/
  5. #include "ff.h"
  6. #include <stdlib.h>
  7. /* This is the implementation for host-side testing on Linux.
  8. * Host-side tests are single threaded, so lock functionality isn't needed.
  9. */
  10. void* ff_memalloc(UINT msize)
  11. {
  12. return malloc(msize);
  13. }
  14. void ff_memfree(void* mblock)
  15. {
  16. free(mblock);
  17. }
  18. static int* Mutex[FF_VOLUMES + 1]; /* Table of mutex handle */
  19. /* 1:Function succeeded, 0:Could not create the mutex */
  20. int ff_mutex_create(int vol)
  21. {
  22. Mutex[vol] = NULL;
  23. return 1;
  24. }
  25. void ff_mutex_delete(int vol)
  26. {
  27. }
  28. /* 1:Function succeeded, 0:Could not acquire lock */
  29. int ff_mutex_take(int vol)
  30. {
  31. return 1;
  32. }
  33. void ff_mutex_give(int vol)
  34. {
  35. }