9
0
Fork 0

Fix error in FAT time (date value was being used)

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4099 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo 2011-11-18 12:45:00 +00:00
parent 9a0c388181
commit 76af7ae37b
3 changed files with 9 additions and 15 deletions

View File

@ -2215,4 +2215,6 @@
at all. Some additional special handling is required to initialize the
root directory entry to interoperate correctly with windows.
* fs/fat/fs_fat32util.c: In fat_systime2fattime(void) should be
clock_gettime() and not clock_gettime() (Thanks to David Sidrane).
clock_gettime() and not clock_gettime(). Also, there is a place where
FAT date is used instead of FAT time. (Thanks to David Sidrane).
* arch/arm/src/stm32: Add support for the STM3240xxx MCU family.

View File

@ -16,7 +16,7 @@ nuttx/
(16) Network (net/, drivers/net)
(2) USB (drivers/usbdev, drivers/usbhost)
(7) Libraries (lib/)
(10) File system/Generic drivers (fs/, drivers/)
(9) File system/Generic drivers (fs/, drivers/)
(2) Graphics subystem (graphics/)
(1) Pascal add-on (pcode/)
(1) Documentation (Documentation/)
@ -501,14 +501,6 @@ o File system / Generic drivers (fs/, drivers/)
Status: Open
Priority: Medium
Description: mkfatfs() does not create the "." directory entry (all directories)
or the ".." directory entry (all directories except for the root
directory). NuttX doesn't care about these entries, but this will
probably make a FAT filesystem formatted on NuttX unusable under
Windows.
Status: Open
Priority: High
o Graphics subystem (graphics/)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -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
}