summaryrefslogtreecommitdiff
path: root/nuttx
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2015-04-13 07:39:56 -0600
committerGregory Nutt <gnutt@nuttx.org>2015-04-13 07:39:56 -0600
commitdac105b64ee0c2544d14cbb7733c6861fb53a314 (patch)
tree837d89df3c8d2a996c1d9e442ce56e6563f7b25f /nuttx
parentddd9938f87309a69b1aeffc3b2f5455aff27fb7a (diff)
downloadpx4-nuttx-dac105b64ee0c2544d14cbb7733c6861fb53a314.tar.gz
px4-nuttx-dac105b64ee0c2544d14cbb7733c6861fb53a314.tar.bz2
px4-nuttx-dac105b64ee0c2544d14cbb7733c6861fb53a314.zip
Update some comments
Diffstat (limited to 'nuttx')
-rw-r--r--nuttx/fs/fat/fs_fat32util.c26
-rw-r--r--nuttx/libc/Kconfig7
2 files changed, 20 insertions, 13 deletions
diff --git a/nuttx/fs/fat/fs_fat32util.c b/nuttx/fs/fat/fs_fat32util.c
index a0f6b0ebf..ac2f53365 100644
--- a/nuttx/fs/fat/fs_fat32util.c
+++ b/nuttx/fs/fat/fs_fat32util.c
@@ -296,7 +296,10 @@ static int fat_checkbootrecord(struct fat_mountpt_s *fs)
uint16_t fat_getuint16(uint8_t *ptr)
{
- /* Byte-by-byte transfer is still necessary if the address is un-aligned */
+ /* NOTE that (1) this operation is independent of endian-ness and that (2)
+ * byte-by-byte transfer is necessary in any case because the address may be
+ * unaligned.
+ */
return ((uint16_t)ptr[1] << 8) | ptr[0];
}
@@ -307,7 +310,10 @@ uint16_t fat_getuint16(uint8_t *ptr)
uint32_t fat_getuint32(uint8_t *ptr)
{
- /* Byte-by-byte transfer is still necessary if the address is un-aligned */
+ /* NOTE that (1) this operation is independent of endian-ness and that (2)
+ * byte-by-byte transfer is necessary in any case because the address may be
+ * unaligned.
+ */
return ((uint32_t)fat_getuint16(&ptr[2]) << 16) | fat_getuint16(&ptr[0]);
}
@@ -321,13 +327,17 @@ void fat_putuint16(uint8_t *ptr, uint16_t value16)
uint8_t *val = (uint8_t*)&value16;
#ifdef CONFIG_ENDIAN_BIG
- /* The bytes always have to be swapped if the target is big-endian */
+ /* If the target is big-endian then the bytes always have to be swapped so
+ * that the representation is litle endian in the file system.
+ */
ptr[0] = val[1];
ptr[1] = val[0];
#else
- /* Byte-by-byte transfer is still necessary if the address is un-aligned */
+ /* Byte-by-byte transfer is still necessary because the address may be
+ * un-aligned.
+ */
ptr[0] = val[0];
ptr[1] = val[1];
@@ -343,13 +353,17 @@ void fat_putuint32(uint8_t *ptr, uint32_t value32)
uint16_t *val = (uint16_t*)&value32;
#ifdef CONFIG_ENDIAN_BIG
- /* The bytes always have to be swapped if the target is big-endian */
+ /* If the target is big-endian then the bytes always have to be swapped so
+ * that the representation is litle endian in the file system.
+ */
fat_putuint16(&ptr[0], val[1]);
fat_putuint16(&ptr[2], val[0]);
#else
- /* Byte-by-byte transfer is still necessary if the address is un-aligned */
+ /* Byte-by-byte transfer is still necessary because the address may be
+ * un-aligned.
+ */
fat_putuint16(&ptr[0], val[0]);
fat_putuint16(&ptr[2], val[1]);
diff --git a/nuttx/libc/Kconfig b/nuttx/libc/Kconfig
index 0a7a732ca..e4da4d61d 100644
--- a/nuttx/libc/Kconfig
+++ b/nuttx/libc/Kconfig
@@ -274,13 +274,6 @@ config LIBC_LOCALTIME
timezone file is required for any another time zone and the environment
variable TZ must be set to the name of that file.
- There is an issue with mktime being called very early in initialization
- by the OS before there are any file systems available.
-
- And finally, the times presented by the NSH date command are wrong when
- this logic is enabled. I assume that this is due to some inconsistency
- between the NuttX timing logic and the localtime timing logic.
-
if LIBC_LOCALTIME
config LIBC_TZ_MAX_TIMES