From c87da92e33969fe48b37578fa3b7113a9d5a2433 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 18 Nov 2011 12:45:00 +0000 Subject: Fix error in FAT time (date value was being used) git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4099 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/fs/fat/fs_fat32util.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'nuttx/fs/fat/fs_fat32util.c') diff --git a/nuttx/fs/fat/fs_fat32util.c b/nuttx/fs/fat/fs_fat32util.c index bef9b45a7..520ae42c1 100644 --- a/nuttx/fs/fat/fs_fat32util.c +++ b/nuttx/fs/fat/fs_fat32util.c @@ -447,7 +447,7 @@ uint32_t fat_systime2fattime(void) } } #endif - return 0; + return 0; } /**************************************************************************** @@ -478,9 +478,9 @@ time_t fat_fattime2systime(uint16_t fattime, uint16_t fatdate) /* Break out the date and time */ - tm.tm_sec = (fatdate & 0x001f) << 1; /* Bits 0-4: 2 second count (0-29) */ - tm.tm_min = (fatdate & 0x07e0) >> 5; /* Bits 5-10: minutes (0-59) */ - tm.tm_hour = (fatdate & 0xf800) >> 11; /* Bits 11-15: hours (0-23) */ + tm.tm_sec = (fattime & 0x001f) << 1; /* Bits 0-4: 2 second count (0-29) */ + tm.tm_min = (fattime & 0x07e0) >> 5; /* Bits 5-10: minutes (0-59) */ + tm.tm_hour = (fattime & 0xf800) >> 11; /* Bits 11-15: hours (0-23) */ tm.tm_mday = (fatdate & 0x001f); /* Bits 0-4: Day of month (1-31) */ tmp = ((fatdate & 0x01e0) >> 5); /* Bits 5-8: Month of year (1-12) */ @@ -491,7 +491,7 @@ time_t fat_fattime2systime(uint16_t fattime, uint16_t fatdate) return mktime(&tm); #else - return 0; + return 0; #endif } -- cgit v1.2.3