Merge pull request #1526 from armink/fix_dfs_fatfs

[components][dfs][fatfs] Add return 0 to get_fattime when RT_USING_LI…
This commit is contained in:
Bernard Xiong 2018-06-11 21:52:24 +08:00 committed by GitHub
commit bce30adddb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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)
(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;
} }