aboutsummaryrefslogtreecommitdiff
path: root/nuttx/graphics
diff options
context:
space:
mode:
authorpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-03-28 16:06:56 +0000
committerpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-03-28 16:06:56 +0000
commit07e5222a418853f4a9c4eede819afd1da4fa386f (patch)
treed57d866e590029f590543adf137fffaeb234ab84 /nuttx/graphics
parent52bf8b3bf1f8d89cc551d520e909bc8355c2fae4 (diff)
downloadpx4-firmware-07e5222a418853f4a9c4eede819afd1da4fa386f.tar.gz
px4-firmware-07e5222a418853f4a9c4eede819afd1da4fa386f.tar.bz2
px4-firmware-07e5222a418853f4a9c4eede819afd1da4fa386f.zip
NX console updates
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4534 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/graphics')
-rw-r--r--nuttx/graphics/Makefile2
-rw-r--r--nuttx/graphics/README.txt2
-rwxr-xr-xnuttx/graphics/nxconsole/nxcon_driver.c5
3 files changed, 7 insertions, 2 deletions
diff --git a/nuttx/graphics/Makefile b/nuttx/graphics/Makefile
index 590e41ffa..4ba9b7d4f 100644
--- a/nuttx/graphics/Makefile
+++ b/nuttx/graphics/Makefile
@@ -68,9 +68,11 @@ include nxfonts/Make.defs
DEPPATH += --dep-path nxfonts
CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxfonts}
+ifeq ($(CONFIG_NXCONSOLE),y)
include nxconsole/Make.defs
DEPPATH += --dep-path nxconsole
CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxconsole}
+endif
ASRCS = $(NXGLIB_ASRCS) $(NXBE_ASRCS) $(NX_ASRCS) $(NXTK_ASRCS) $(NXFONTS_ASRCS) $(NXCON_ASRCS)
AOBJS = $(ASRCS:.S=$(OBJEXT))
diff --git a/nuttx/graphics/README.txt b/nuttx/graphics/README.txt
index d5027c1f0..3e7f61bcf 100644
--- a/nuttx/graphics/README.txt
+++ b/nuttx/graphics/README.txt
@@ -319,6 +319,8 @@ CONFIG_NXFONT_SERIF38X49B
NxConsole Configuration Settings:
+CONFIG_NXCONSOLE
+ Enables building of the NxConsole driver.
CONFIG_NXCONSOLE_BPP
Currently, NxConsole supports only a single pixel depth. This
configuration setting must be provided to support that single pixel depth.
diff --git a/nuttx/graphics/nxconsole/nxcon_driver.c b/nuttx/graphics/nxconsole/nxcon_driver.c
index dc7d5f353..d4ab71464 100755
--- a/nuttx/graphics/nxconsole/nxcon_driver.c
+++ b/nuttx/graphics/nxconsole/nxcon_driver.c
@@ -124,6 +124,7 @@ static ssize_t nxcon_write(FAR struct file *filep, FAR const char *buffer,
size_t buflen)
{
FAR struct nxcon_state_s *priv;
+ ssize_t remaining;
char ch;
int lineheight;
int ret;
@@ -145,7 +146,7 @@ static ssize_t nxcon_write(FAR struct file *filep, FAR const char *buffer,
lineheight = (priv->fheight + CONFIG_NXCONSOLE_LINESEPARATION);
- while (buflen-- > 0)
+ for (remaining = (ssize_t)buflen; remaining > 0; remaining--)
{
/* Ignore carriage returns */
@@ -195,7 +196,7 @@ static ssize_t nxcon_write(FAR struct file *filep, FAR const char *buffer,
}
sem_post(&priv->exclsem);
- return buflen;
+ return (ssize_t)buflen;
}
/****************************************************************************