Browse Source

[fatfs] 修复time相关函数开启条件

Meco Man 3 years ago
parent
commit
32e9aa21c4
1 changed files with 2 additions and 2 deletions
  1. 2 2
      components/dfs/filesystems/elmfat/dfs_elm.c

+ 2 - 2
components/dfs/filesystems/elmfat/dfs_elm.c

@@ -945,7 +945,7 @@ DWORD get_fattime(void)
 {
     DWORD fat_time = 0;
 
-#ifdef RT_LIBC_USING_TIME
+#if defined(RT_LIBC_USING_TIME) || defined(RT_USING_LIBC)
     time_t now;
     struct tm *p_tm;
     struct tm tm_now;
@@ -968,7 +968,7 @@ DWORD get_fattime(void)
                (DWORD)tm_now.tm_hour        << 11 |
                (DWORD)tm_now.tm_min         <<  5 |
                (DWORD)tm_now.tm_sec / 2 ;
-#endif /* RT_USING_LIBC  */
+#endif /* defined(RT_LIBC_USING_TIME) || defined(RT_USING_LIBC) */
 
     return fat_time;
 }