未验证 提交 bce30add 编写于 作者: B Bernard Xiong 提交者: GitHub

Merge pull request #1526 from armink/fix_dfs_fatfs

[components][dfs][fatfs] Add return 0 to get_fattime when RT_USING_LI…
...@@ -924,10 +924,12 @@ DRESULT disk_ioctl(BYTE drv, BYTE ctrl, void *buff) ...@@ -924,10 +924,12 @@ DRESULT disk_ioctl(BYTE drv, BYTE ctrl, void *buff)
DWORD get_fattime(void) DWORD get_fattime(void)
{ {
DWORD fat_time = 0;
#ifdef RT_USING_LIBC
time_t now; time_t now;
struct tm *p_tm; struct tm *p_tm;
struct tm tm_now; struct tm tm_now;
DWORD fat_time;
/* get current time */ /* get current time */
now = time(RT_NULL); now = time(RT_NULL);
...@@ -947,6 +949,7 @@ DWORD get_fattime(void) ...@@ -947,6 +949,7 @@ DWORD get_fattime(void)
(DWORD)tm_now.tm_hour << 11 | (DWORD)tm_now.tm_hour << 11 |
(DWORD)tm_now.tm_min << 5 | (DWORD)tm_now.tm_min << 5 |
(DWORD)tm_now.tm_sec / 2 ; (DWORD)tm_now.tm_sec / 2 ;
#endif /* RT_USING_LIBC */
return fat_time; return fat_time;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册