summaryrefslogtreecommitdiff
path: root/nuttx
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx')
-rw-r--r--nuttx/Documentation/NuttxPortingGuide.html38
-rw-r--r--nuttx/arch/arm/src/dm320/dm320_boot.c2
-rw-r--r--nuttx/arch/arm/src/dm320/dm320_usbdev.c6
-rw-r--r--nuttx/arch/arm/src/imx/imx_boot.c2
-rw-r--r--nuttx/arch/z80/src/z8/z8_registerdump.c4
-rw-r--r--nuttx/configs/README.txt31
-rw-r--r--nuttx/drivers/mtd/skeleton.c4
-rw-r--r--nuttx/drivers/usbhost/usbhost_hidkbd.c42
-rw-r--r--nuttx/examples/poll/poll_main.c44
-rw-r--r--nuttx/graphics/nxbe/nxbe_closewindow.c8
-rw-r--r--nuttx/graphics/nxbe/nxbe_colormap.c4
-rw-r--r--nuttx/graphics/nxsu/nxsu_reportposition.c5
-rwxr-xr-xnuttx/lib/lib_dtoa.c4
-rw-r--r--nuttx/mm/mm_memalign.c4
14 files changed, 143 insertions, 55 deletions
diff --git a/nuttx/Documentation/NuttxPortingGuide.html b/nuttx/Documentation/NuttxPortingGuide.html
index 0eb4e6f44..81f819260 100644
--- a/nuttx/Documentation/NuttxPortingGuide.html
+++ b/nuttx/Documentation/NuttxPortingGuide.html
@@ -12,7 +12,7 @@
<h1><big><font color="#3c34ec">
<i>NuttX RTOS Porting Guide</i>
</font></big></h1>
- <p>Last Updated: January 16, 2011</p>
+ <p>Last Updated: January 19, 2011</p>
</td>
</tr>
</table>
@@ -3622,6 +3622,42 @@ build
<code>CONFIG_USBHOST_ISOC_DISABLE</code>: On some architectures, selecting this setting will reduce driver size by disabling isochronous endpoint support
</li>
</ul>
+<h3>USB Host HID Class Driver</h3>
+<p>
+ Requires <code>CONFIG_USBHOST=y</code>, <code>CONFIG_USBHOST_INT_DISABLE=n</code>, <code>CONFIG_NFILE_DESCRIPTORS > 0</code>,
+ <code>CONFIG_SCHED_WORKQUEUE=y</code>, and <code>CONFIG_DISABLE_SIGNALS=n</code>.
+</p>
+<ul>
+ <li>
+ <code>CONFIG_HIDKBD_POLLUSEC</code>: Device poll rate in microseconds. Default: 100 milliseconds.
+ </li>
+ <li>
+ <code>CONFIG_HIDKBD_DEFPRIO</code>: Priority of the polling thread. Default: 50.
+ </li>
+ <li>
+ <code>CONFIG_HIDKBD_STACKSIZE</code>: Stack size for polling thread. Default: 1024
+ </li>
+ <li>
+ <code>CONFIG_HIDKBD_BUFSIZE</code>: Scancode buffer size. Default: 64.
+ </li>
+ <li>
+ <code>CONFIG_HIDKBD_NPOLLWAITERS</code>: If the poll() method is enabled, this defines the maximum number of threads that can be waiting for keyboard events. Default: 2.
+ </li>
+ <li>
+ <code>CONFIG_HIDKBD_RAWSCANCODES</code>: If set to <code>y</code> no conversion will be made on the raw keyboard scan codes. Default: ASCII conversion.
+ </li>
+ <li>
+ <code>CONFIG_HIDKBD_ALLSCANCODES</code>: If set to <code>y</code> all 231 possible scancodes will be converted to something. Default: 104 key US keyboard.
+ </li>
+ <li>
+ <code>CONFIG_HIDKBD_NODEBOUNCE</code>: If set to <code>y</code> normal debouncing is disabled. Default: Debounce/No repeat keys.
+ </li>
+</ul>
+<h3>USB Host HID Mass Storage Class Driver</h3>
+<p>
+ Requires <code>CONFIG_USBHOST=y</code>, <code>CONFIG_USBHOST_BULK_DISABLE=n</code>, <code>CONFIG_NFILE_DESCRIPTORS > 0</code>,
+ and <code>CONFIG_SCHED_WORKQUEUE=y</code>.
+</p>
<h2>Graphics related configuration settings</h3>
<ul>
diff --git a/nuttx/arch/arm/src/dm320/dm320_boot.c b/nuttx/arch/arm/src/dm320/dm320_boot.c
index 335b7f30b..6269ed8f8 100644
--- a/nuttx/arch/arm/src/dm320/dm320_boot.c
+++ b/nuttx/arch/arm/src/dm320/dm320_boot.c
@@ -1,7 +1,7 @@
/************************************************************************************
* arch/arm/src/dm320/dm320_boot.c
*
- * Copyright (C) 2007, 2009-2010 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007, 2009-2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
diff --git a/nuttx/arch/arm/src/dm320/dm320_usbdev.c b/nuttx/arch/arm/src/dm320/dm320_usbdev.c
index e18ad0ad9..1a3bc0629 100644
--- a/nuttx/arch/arm/src/dm320/dm320_usbdev.c
+++ b/nuttx/arch/arm/src/dm320/dm320_usbdev.c
@@ -1,7 +1,7 @@
/*******************************************************************************
* arch/arm/src/dm320/dm320_usbdev.c
*
- * Copyright (C) 2008-2010 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -2402,7 +2402,7 @@ void up_usbinitialize(void)
/* Perform endpoint initialization */
- for (i = 0; i < DM320_NENDPOINTS+1; i++)
+ for (i = 0; i < DM320_NENDPOINTS; i++)
{
/* Set up the standard stuff */
@@ -2423,7 +2423,7 @@ void up_usbinitialize(void)
priv->eplist[i].ep.maxpacket = g_epinfo[i].maxpacket;
if (USB_EPIN(g_epinfo[i].addr))
{
- priv->eplist[1].in = 1;
+ priv->eplist[i].in = 1;
}
/* Reset the endpoint */
diff --git a/nuttx/arch/arm/src/imx/imx_boot.c b/nuttx/arch/arm/src/imx/imx_boot.c
index 842050e15..9cd4d390e 100644
--- a/nuttx/arch/arm/src/imx/imx_boot.c
+++ b/nuttx/arch/arm/src/imx/imx_boot.c
@@ -2,7 +2,7 @@
* arch/arm/src/imx/imx_boot.c
* arch/arm/src/chip/imx_boot.c
*
- * Copyright (C) 2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2009,2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
diff --git a/nuttx/arch/z80/src/z8/z8_registerdump.c b/nuttx/arch/z80/src/z8/z8_registerdump.c
index 0fb103c7d..d9ccdf48f 100644
--- a/nuttx/arch/z80/src/z8/z8_registerdump.c
+++ b/nuttx/arch/z80/src/z8/z8_registerdump.c
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/z80/src/z8/z8_registerdump.c
*
- * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009,2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -130,7 +130,7 @@ void z8_registerdump(void)
regs = g_z8irqstate.regs;
z8_dumpregs(regs);
z8_dumpstate(regs[XCPT_SP], regs[XCPT_PC],
- regs[XCPT_IRQCTL], regs[XCPT_RPFLAGS];
+ regs[XCPT_IRQCTL], regs[XCPT_RPFLAGS]);
break;
case Z8_IRQSTATE_NONE:
diff --git a/nuttx/configs/README.txt b/nuttx/configs/README.txt
index 8b5e7a51b..e44369529 100644
--- a/nuttx/configs/README.txt
+++ b/nuttx/configs/README.txt
@@ -712,12 +712,41 @@ defconfig -- This is a configuration file similar to the Linux
On some architectures, selecting this setting will reduce driver size
by disabling bulk endpoint support
CONFIG_USBHOST_INT_DISABLE
- On some architectures, selecting this setting will reduce driver size
+ On some architectures, selecting this setting will reduce driver size
by disabling interrupt endpoint support
CONFIG_USBHOST_ISOC_DISABLE
On some architectures, selecting this setting will reduce driver size
by disabling isochronous endpoint support
+ USB host HID class driver. Requires CONFIG_USBHOST=y,
+ CONFIG_USBHOST_INT_DISABLE=n, CONFIG_NFILE_DESCRIPTORS > 0,
+ CONFIG_SCHED_WORKQUEUE=y, and CONFIG_DISABLE_SIGNALS=n.
+
+ CONFIG_HIDKBD_POLLUSEC
+ Device poll rate in microseconds. Default: 100 milliseconds.
+ CONFIG_HIDKBD_DEFPRIO
+ Priority of the polling thread. Default: 50.
+ CONFIG_HIDKBD_STACKSIZE
+ Stack size for polling thread. Default: 1024
+ CONFIG_HIDKBD_BUFSIZE
+ Scancode buffer size. Default: 64.
+ CONFIG_HIDKBD_NPOLLWAITERS
+ If the poll() method is enabled, this defines the maximum number
+ of threads that can be waiting for keyboard events. Default: 2.
+ CONFIG_HIDKBD_RAWSCANCODES
+ If set to y no conversion will be made on the raw keyboard scan
+ codes. Default: ASCII conversion.
+ CONFIG_HIDKBD_ALLSCANCODES'
+ If set to y all 231 possible scancodes will be converted to
+ something. Default: 104 key US keyboard.
+ CONFIG_HIDKBD_NODEBOUNCE
+ If set to y normal debouncing is disabled. Default:
+ Debounce enabled (No repeat keys).
+
+ USB host mass storage class driver. Requires CONFIG_USBHOST=y,
+ CONFIG_USBHOST_BULK_DISABLE=n, CONFIG_NFILE_DESCRIPTORS > 0,
+ and CONFIG_SCHED_WORKQUEUE=y
+
USB serial device class driver
CONFIG_USBSER
Enable compilation of the USB serial driver
diff --git a/nuttx/drivers/mtd/skeleton.c b/nuttx/drivers/mtd/skeleton.c
index 356e318a5..ecd5f85bb 100644
--- a/nuttx/drivers/mtd/skeleton.c
+++ b/nuttx/drivers/mtd/skeleton.c
@@ -1,7 +1,7 @@
/****************************************************************************
* drivers/mtd/skeleton.c
*
- * Copyright (C) 2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -270,5 +270,5 @@ void skel_initialize(void)
/* Return the implementation-specific state structure as the MTD device */
- return ((FAR struct mtd_dev_s *)&g_skeldev;
+ return (FAR struct mtd_dev_s *)&g_skeldev;
}
diff --git a/nuttx/drivers/usbhost/usbhost_hidkbd.c b/nuttx/drivers/usbhost/usbhost_hidkbd.c
index 6e3eb8fea..e6db0c8f7 100644
--- a/nuttx/drivers/usbhost/usbhost_hidkbd.c
+++ b/nuttx/drivers/usbhost/usbhost_hidkbd.c
@@ -103,22 +103,22 @@
# define CONFIG_HIDKBD_STACKSIZE 1024
#endif
-#ifndef CONFIG_USBHID_BUFSIZE
-# define CONFIG_USBHID_BUFSIZE 64
+#ifndef CONFIG_HIDKBD_BUFSIZE
+# define CONFIG_HIDKBD_BUFSIZE 64
#endif
-#ifndef CONFIG_USBHID_NPOLLWAITERS
-# define CONFIG_USBHID_NPOLLWAITERS 2
+#ifndef CONFIG_HIDKBD_NPOLLWAITERS
+# define CONFIG_HIDKBD_NPOLLWAITERS 2
#endif
/* The default is to support scancode mapping for the standard 104 key
- * keyboard. Setting CONFIG_USBHID_RAWSCANCODES will disable all scancode
- * mapping; Setting CONFIG_USBHID_ALLSCANCODES will enable mapping of all
+ * keyboard. Setting CONFIG_HIDKBD_RAWSCANCODES will disable all scancode
+ * mapping; Setting CONFIG_HIDKBD_ALLSCANCODES will enable mapping of all
* scancodes;
*/
-#ifndef CONFIG_USBHID_RAWSCANCODES
-# ifdef CONFIG_USBHID_ALLSCANCODES
+#ifndef CONFIG_HIDKBD_RAWSCANCODES
+# ifdef CONFIG_HIDKBD_ALLSCANCODES
# define USBHID_NUMSCANCODES (USBHID_KBDUSE_MAX+1)
# else
# define USBHID_NUMSCANCODES 104
@@ -198,14 +198,14 @@ struct usbhost_state_s
*/
#ifndef CONFIG_DISABLE_POLL
- struct pollfd *fds[CONFIG_USBHID_NPOLLWAITERS];
+ struct pollfd *fds[CONFIG_HIDKBD_NPOLLWAITERS];
#endif
/* Buffer used to collect and buffer incoming keyboard characters */
volatile uint16_t headndx; /* Buffer head index */
volatile uint16_t tailndx; /* Buffer tail index */
- uint8_t kbdbuffer[CONFIG_USBHID_BUFSIZE];
+ uint8_t kbdbuffer[CONFIG_HIDKBD_BUFSIZE];
};
/****************************************************************************
@@ -342,7 +342,7 @@ static struct usbhost_state_s *g_priv; /* Data passed to thread */
* controls.
*/
-#ifndef CONFIG_USBHID_RAWSCANCODES
+#ifndef CONFIG_HIDKBD_RAWSCANCODES
static const uint8_t ucmap[USBHID_NUMSCANCODES] =
{
0, 0, 0, 0, 'A', 'B', 'C', 'D', /* 0x00-0x07: Reserved, errors, A-D */
@@ -358,7 +358,7 @@ static const uint8_t ucmap[USBHID_NUMSCANCODES] =
0, 0, 0, 0, '/', '*', '-', '+', /* 0x50-0x57: LeftArrow,DownArrow,UpArrow,Num Lock,/,*,-,+ */
'\n', '1', '2', '3', '4', '4', '6', '7', /* 0x58-0x5f: Enter,1-7 */
'8', '9', '0', '.', 0, 0, 0, '=', /* 0x60-0x67: 8-9,0,.,Non-US \,Application,Power,= */
-#ifdef CONFIG_USBHID_ALLSCANCODES
+#ifdef CONFIG_HIDKBD_ALLSCANCODES
0, 0, 0, 0, 0, 0, 0, 0, /* 0x68-0x6f: F13,F14,F15,F16,F17,F18,F19,F20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70-0x77: F21,F22,F23,F24,Execute,Help,Menu,Select */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x78-0x7f: Stop,Again,Undo,Cut,Copy,Paste,Find,Mute */
@@ -393,7 +393,7 @@ static const uint8_t lcmap[USBHID_NUMSCANCODES] =
0, 0, 0, 0, '/', '*', '-', '+', /* 0x50-0x57: LeftArrow,DownArrow,UpArrow,Num Lock,/,*,-,+ */
'\n', '1', '2', '3', '4', '4', '6', '7', /* 0x58-0x5f: Enter,1-7 */
'8', '9', '0', '.', 0, 0, 0, '=', /* 0x60-0x67: 8-9,0,.,Non-US \,Application,Power,= */
-#ifdef CONFIG_USBHID_ALLSCANCODES
+#ifdef CONFIG_HIDKBD_ALLSCANCODES
0, 0, 0, 0, 0, 0, 0, 0, /* 0x68-0x6f: F13,F14,F15,F16,F17,F18,F19,F20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70-0x77: F21,F22,F23,F24,Execute,Help,Menu,Select */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x78-0x7f: Stop,Again,Undo,Cut,Copy,Paste,Find,Mute */
@@ -412,7 +412,7 @@ static const uint8_t lcmap[USBHID_NUMSCANCODES] =
0, 0, 0, 0, 0, 0, 0, 0, /* 0xe0-0xe7: Left Ctrl,Shift,Alt,GUI, Right Ctrl,Shift,Alt,GUI */
#endif
};
-#endif /* CONFIG_USBHID_RAWSCANCODES */
+#endif /* CONFIG_HIDKBD_RAWSCANCODES */
/****************************************************************************
* Private Functions
@@ -450,7 +450,7 @@ static void usbhost_pollnotify(FAR struct usbhost_state_s *priv)
{
int i;
- for (i = 0; i < CONFIG_USBHID_NPOLLWAITERS; i++)
+ for (i = 0; i < CONFIG_HIDKBD_NPOLLWAITERS; i++)
{
struct pollfd *fds = priv->fds[i];
if (fds)
@@ -655,7 +655,7 @@ static void usbhost_destroy(FAR void *arg)
static inline uint8_t usbhost_mapscancode(uint8_t scancode, uint8_t modifier)
{
-#ifndef CONFIG_USBHID_RAWSCANCODES
+#ifndef CONFIG_HIDKBD_RAWSCANCODES
/* Range check */
if (scancode >= USBHID_NUMSCANCODES)
@@ -831,7 +831,7 @@ static int usbhost_kbdpoll(int argc, char *argv[])
/* Increment the head index */
- if (++head >= CONFIG_USBHID_BUFSIZE)
+ if (++head >= CONFIG_HIDKBD_BUFSIZE)
{
head = 0;
}
@@ -843,7 +843,7 @@ static int usbhost_kbdpoll(int argc, char *argv[])
if (tail == head)
{
- if (++tail >= CONFIG_USBHID_BUFSIZE)
+ if (++tail >= CONFIG_HIDKBD_BUFSIZE)
{
tail = 0;
}
@@ -1850,7 +1850,7 @@ static ssize_t usbhost_read(FAR struct file *filep, FAR char *buffer, size_t len
/* Handle wrap-around of the tail index */
- if (++tail >= CONFIG_USBHID_BUFSIZE)
+ if (++tail >= CONFIG_HIDKBD_BUFSIZE)
{
tail = 0;
}
@@ -1928,7 +1928,7 @@ static int usbhost_poll(FAR struct file *filep, FAR struct pollfd *fds,
* the poll structure reference
*/
- for (i = 0; i < CONFIG_USBHID_NPOLLWAITERS; i++)
+ for (i = 0; i < CONFIG_HIDKBD_NPOLLWAITERS; i++)
{
/* Find an available slot */
@@ -1942,7 +1942,7 @@ static int usbhost_poll(FAR struct file *filep, FAR struct pollfd *fds,
}
}
- if (i >= CONFIG_USBHID_NPOLLWAITERS)
+ if (i >= CONFIG_HIDKBD_NPOLLWAITERS)
{
fds->priv = NULL;
ret = -EBUSY;
diff --git a/nuttx/examples/poll/poll_main.c b/nuttx/examples/poll/poll_main.c
index dbf5eec65..d66e7f269 100644
--- a/nuttx/examples/poll/poll_main.c
+++ b/nuttx/examples/poll/poll_main.c
@@ -1,7 +1,7 @@
/****************************************************************************
* examples/poll/poll_main.c
*
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -95,9 +95,10 @@ int user_start(int argc, char *argv[])
pthread_t tid3;
#endif
int count;
- int fd1;
- int fd2;
+ int fd1 = -1;
+ int fd2 = -1;
int ret;
+ int exitcode = 0;
/* Open FIFOs */
@@ -106,7 +107,8 @@ int user_start(int argc, char *argv[])
if (ret < 0)
{
message("user_start: mkfifo failed: %d\n", errno);
- return 1;
+ exitcode = 1;
+ goto errout;
}
message("\nuser_start: Creating FIFO %s\n", FIFO_PATH2);
@@ -114,7 +116,8 @@ int user_start(int argc, char *argv[])
if (ret < 0)
{
message("user_start: mkfifo failed: %d\n", errno);
- return 2;
+ exitcode = 2;
+ goto errout;
}
/* Open the FIFOs for blocking, write */
@@ -124,7 +127,8 @@ int user_start(int argc, char *argv[])
{
message("user_start: Failed to open FIFO %s for writing, errno=%d\n",
FIFO_PATH1, errno);
- return 2;
+ exitcode = 3;
+ goto errout;
}
fd2 = open(FIFO_PATH2, O_WRONLY);
@@ -132,7 +136,8 @@ int user_start(int argc, char *argv[])
{
message("user_start: Failed to open FIFO %s for writing, errno=%d\n",
FIFO_PATH2, errno);
- return 2;
+ exitcode = 4;
+ goto errout;
}
/* Start the listeners */
@@ -143,7 +148,8 @@ int user_start(int argc, char *argv[])
if (ret != 0)
{
message("user_start: Failed to create poll_listener thread: %d\n", ret);
- return 3;
+ exitcode = 5;
+ goto errout;
}
message("user_start: Starting select_listener thread\n");
@@ -152,7 +158,8 @@ int user_start(int argc, char *argv[])
if (ret != 0)
{
message("user_start: Failed to create select_listener thread: %d\n", ret);
- return 3;
+ exitcode = 6;
+ goto errout;
}
#ifdef HAVE_NETPOLL
@@ -184,14 +191,16 @@ int user_start(int argc, char *argv[])
if (nbytes < 0)
{
message("user_start: Write to fd1 failed: %d\n", errno);
- return 4;
+ exitcode = 7;
+ goto errout;
}
nbytes = write(fd2, buffer, strlen(buffer));
if (nbytes < 0)
{
message("user_start: Write fd2 failed: %d\n", errno);
- return 4;
+ exitcode = 8;
+ goto errout;
}
message("\nuser_start: Sent '%s' (%d bytes)\n", buffer, nbytes);
@@ -204,6 +213,17 @@ int user_start(int argc, char *argv[])
sleep(WRITER_DELAY);
}
+errout:
+ if (fd1 >= 0)
+ {
+ close(fd1);
+ }
+
+ if (fd2 >= 0)
+ {
+ close(fd2);
+ }
+
fflush(stdout);
- return 0;
+ return exitcode;
}
diff --git a/nuttx/graphics/nxbe/nxbe_closewindow.c b/nuttx/graphics/nxbe/nxbe_closewindow.c
index c5c15023c..7e7e3f45e 100644
--- a/nuttx/graphics/nxbe/nxbe_closewindow.c
+++ b/nuttx/graphics/nxbe/nxbe_closewindow.c
@@ -1,7 +1,7 @@
/****************************************************************************
* graphics/nxbe/nxbe_closewindow.c
*
- * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -86,17 +86,19 @@
void nxbe_closewindow(struct nxbe_window_s *wnd)
{
- FAR struct nxbe_state_s *be = wnd->be;
+ FAR struct nxbe_state_s *be;
+
#ifdef CONFIG_DEBUG
if (!wnd)
{
return;
}
+#endif
+ be = wnd->be;
/* The background window should never be closed */
DEBUGASSERT(wnd != &be->bkgd);
-#endif
/* Is there a window above the one being closed? */
diff --git a/nuttx/graphics/nxbe/nxbe_colormap.c b/nuttx/graphics/nxbe/nxbe_colormap.c
index f35393b20..31072fb16 100644
--- a/nuttx/graphics/nxbe/nxbe_colormap.c
+++ b/nuttx/graphics/nxbe/nxbe_colormap.c
@@ -1,7 +1,7 @@
/****************************************************************************
* graphics/nxbe/nxbe_colormap.c
*
- * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009,2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -98,7 +98,7 @@ int nxbe_configure(FAR NX_DRIVERTYPE *dev, FAR struct nxbe_state_s *be)
size = 3 * CONFIG_NX_NCOLORS * sizeof(uint16_t);
alloc = (uint8_t*)malloc(size);
- if (alloc < 0)
+ if (alloc == NULL)
{
return -ENOMEM;
}
diff --git a/nuttx/graphics/nxsu/nxsu_reportposition.c b/nuttx/graphics/nxsu/nxsu_reportposition.c
index f7fc1d800..71b76aa63 100644
--- a/nuttx/graphics/nxsu/nxsu_reportposition.c
+++ b/nuttx/graphics/nxsu/nxsu_reportposition.c
@@ -1,7 +1,7 @@
/****************************************************************************
* graphics/nxsu/nxsu_reportposition.c
*
- * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009,2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -79,7 +79,7 @@
void nxfe_reportposition(FAR struct nxbe_window_s *wnd)
{
- FAR struct nxbe_state_s *be = wnd->be;
+ FAR struct nxbe_state_s *be;
struct nxgl_size_s size;
#ifdef CONFIG_DEBUG
@@ -88,6 +88,7 @@ void nxfe_reportposition(FAR struct nxbe_window_s *wnd)
return;
}
#endif
+ be = wnd->be;
/* This is very awkward in single user mode, but at least it is compatible.
* with the way things are done in multiple user mode.
diff --git a/nuttx/lib/lib_dtoa.c b/nuttx/lib/lib_dtoa.c
index 1bab1435f..08904d9df 100755
--- a/nuttx/lib/lib_dtoa.c
+++ b/nuttx/lib/lib_dtoa.c
@@ -1445,9 +1445,9 @@ char *__dtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve)
#endif
if (j < 0 || (j == 0 && !mode
#ifndef ROUND_BIASED
- && (!(word1(d) & 1)))
+ && (!(word1(d) & 1))
#endif
- )
+ ))
{
if ((j_1 > 0))
{
diff --git a/nuttx/mm/mm_memalign.c b/nuttx/mm/mm_memalign.c
index 10c455ff7..02394acc5 100644
--- a/nuttx/mm/mm_memalign.c
+++ b/nuttx/mm/mm_memalign.c
@@ -1,7 +1,7 @@
/************************************************************
* mm/mm_memalign.c
*
- * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -100,7 +100,7 @@ FAR void *memalign(size_t alignment, size_t size)
/* Then malloc that size */
rawchunk = (size_t)malloc(allocsize);
- if (!rawchunk)
+ if (rawchunk == NULL)
{
return NULL;
}