summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-11-18 12:45:00 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-11-18 12:45:00 +0000
commitc87da92e33969fe48b37578fa3b7113a9d5a2433 (patch)
tree72e7a451eac2eedeeb2704cffa801c041e3d772e
parent06bde1dc470bca53790e59177379fc10bcd09421 (diff)
downloadnuttx-c87da92e33969fe48b37578fa3b7113a9d5a2433.tar.gz
nuttx-c87da92e33969fe48b37578fa3b7113a9d5a2433.tar.bz2
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
-rw-r--r--nuttx/ChangeLog4
-rw-r--r--nuttx/TODO10
-rw-r--r--nuttx/fs/fat/fs_fat32util.c10
3 files changed, 9 insertions, 15 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index ef7cba211..77c762494 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -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.
diff --git a/nuttx/TODO b/nuttx/TODO
index a5bf08ace..79dc6af79 100644
--- a/nuttx/TODO
+++ b/nuttx/TODO
@@ -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/)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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
}