Dozingfiretruck 9 месяцев назад
Родитель
Сommit
bda848e008
2 измененных файлов с 3 добавлено и 3 удалено
  1. 2 2
      components/fatfs/ffconf.h
  2. 1 1
      components/fatfs/ffsystem.c

+ 2 - 2
components/fatfs/ffconf.h

@@ -274,7 +274,7 @@
 */
 
 
-#define FF_FS_LOCK		0
+#define FF_FS_LOCK		16
 /* The option FF_FS_LOCK switches file lock function to control duplicated file open
 /  and illegal operation to open objects. This option must be 0 when FF_FS_READONLY
 /  is 1.
@@ -286,7 +286,7 @@
 /      lock control is independent of re-entrancy. */
 
 
-#define FF_FS_REENTRANT	0
+#define FF_FS_REENTRANT	1
 #define FF_FS_TIMEOUT	1000
 /* The option FF_FS_REENTRANT switches the re-entrancy (thread safe) of the FatFs
 /  module itself. Note that regardless of this option, file access to different

+ 1 - 1
components/fatfs/ffsystem.c

@@ -201,7 +201,7 @@ int ff_mutex_take (	/* Returns 1:Succeeded or 0:Timeout */
 	return (int)(osMutexWait(Mutex[vol], FF_FS_TIMEOUT) == osOK);
 
 #elif OS_TYPE == 5	/* LUATOS */
-	luat_rtos_mutex_lock(Mutex[vol], LUAT_WAIT_FOREVER);
+    return (int)(luat_rtos_mutex_lock(Mutex[vol], LUAT_WAIT_FOREVER) == 0);
 
 #endif
 }