diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-11-18 12:45:00 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-11-18 12:45:00 +0000 |
commit | c87da92e33969fe48b37578fa3b7113a9d5a2433 (patch) | |
tree | 72e7a451eac2eedeeb2704cffa801c041e3d772e /nuttx/fs | |
parent | 06bde1dc470bca53790e59177379fc10bcd09421 (diff) | |
download | px4-nuttx-c87da92e33969fe48b37578fa3b7113a9d5a2433.tar.gz px4-nuttx-c87da92e33969fe48b37578fa3b7113a9d5a2433.tar.bz2 px4-nuttx-c87da92e33969fe48b37578fa3b7113a9d5a2433.zip |
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
Diffstat (limited to 'nuttx/fs')
-rw-r--r-- | nuttx/fs/fat/fs_fat32util.c | 10 |
1 files changed, 5 insertions, 5 deletions
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 } |