NX console updates

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4534 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2012-03-28 16:06:56 +00:00
parent 638dcbf1b5
commit 0118856491
16 changed files with 79 additions and 14 deletions

View File

@ -3353,6 +3353,8 @@ int nxf_convert_32bpp(FAR uint32_t *dest, uint16_t height,
<ul>
<dl>
<dt><code>CONFIG_NXCONSOLE</code>:
<dd>Enables building of the NxConsole driver.
<dt><code>CONFIG_NXCONSOLE_BPP</code>:
<dd>Currently, NxConsole supports only a single pixel depth.
This configuration setting must be provided to support that single pixel depth.

View File

@ -367,8 +367,14 @@ nx11
examples/nxconsole
------------------
This configuration is also set up to use the examples/nxconsole
test instead of examples/nx. Simply comment out the following
in the appconfig file:
test instead of examples/nx. To enable this configuration,
First, select Multi-User mode as described above. Then add the
following definitions to the defconfig file:
-CONFIG_NXCONSOLE=n
+CONFIG_NXCONSOLE=y
Comment out the following in the appconfig file:
-CONFIGURED_APPS += examples/nx
+#CONFIGURED_APPS += examples/nx

View File

@ -48,3 +48,8 @@ CONFIGURED_APPS += examples/nx
CONFIGURED_APPS += examples/nxhello
CONFIGURED_APPS += examples/nxlines
CONFIGURED_APPS += examples/touchscreen
ifeq ($(CONFIG_NXCONSOLE),y)
CONFIGURED_APPS += examples/nxconsole
endif

View File

@ -424,6 +424,8 @@ CONFIG_NX_MXCLIENTMSGS=16
#
# 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.
@ -452,6 +454,7 @@ CONFIG_NX_MXCLIENTMSGS=16
# of the window. This setting can be defining to change this behavior so
# that the text is simply truncated until a new line is encountered.
#
CONFIG_NXCONSOLE=n
CONFIG_NXCONSOLE_BPP=8
# CONFIG_NXCONSOLE_NOGETRUN
# CONFIG_NXCONSOLE_MXCHARS

View File

@ -425,6 +425,8 @@ CONFIG_NX_MXCLIENTMSGS=16
#
# 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.
@ -453,6 +455,7 @@ CONFIG_NX_MXCLIENTMSGS=16
# of the window. This setting can be defining to change this behavior so
# that the text is simply truncated until a new line is encountered.
#
CONFIG_NXCONSOLE=n
CONFIG_NXCONSOLE_BPP=32
# CONFIG_NXCONSOLE_NOGETRUN
# CONFIG_NXCONSOLE_MXCHARS

View File

@ -50,9 +50,12 @@ CONFIGURED_APPS += examples/nx
CONFIGURED_APPS += examples/nxhello
#CONFIGURED_APPS += examples/nxlines
#CONFIGURED_APPS += examples/nxtext
#CONFIGURED_APPS += examples/nxconsole
CONFIGURED_APPS += examples/usbstorage
ifeq ($(CONFIG_NXCONSOLE),y)
CONFIGURED_APPS += examples/nxconsole
endif
ifeq ($(CONFIG_I2C),y)
CONFIGURED_APPS += system/i2c
endif

View File

@ -1043,6 +1043,8 @@ CONFIG_NX_MXCLIENTMSGS=16
#
# 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.
@ -1071,6 +1073,7 @@ CONFIG_NX_MXCLIENTMSGS=16
# of the window. This setting can be defining to change this behavior so
# that the text is simply truncated until a new line is encountered.
#
CONFIG_NXCONSOLE=n
CONFIG_NXCONSOLE_BPP=16
# CONFIG_NXCONSOLE_NOGETRUN
# CONFIG_NXCONSOLE_MXCHARS

View File

@ -893,6 +893,8 @@ CONFIG_NX_MXCLIENTMSGS=16
#
# 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.
@ -921,6 +923,7 @@ CONFIG_NX_MXCLIENTMSGS=16
# of the window. This setting can be defining to change this behavior so
# that the text is simply truncated until a new line is encountered.
#
CONFIG_NXCONSOLE=n
CONFIG_NXCONSOLE_BPP=16
# CONFIG_NXCONSOLE_NOGETRUN
# CONFIG_NXCONSOLE_MXCHARS

View File

@ -892,6 +892,8 @@ CONFIG_NX_MXCLIENTMSGS=16
#
# 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.
@ -920,6 +922,7 @@ CONFIG_NX_MXCLIENTMSGS=16
# of the window. This setting can be defining to change this behavior so
# that the text is simply truncated until a new line is encountered.
#
CONFIG_NXCONSOLE=n
CONFIG_NXCONSOLE_BPP=16
# CONFIG_NXCONSOLE_NOGETRUN
# CONFIG_NXCONSOLE_MXCHARS

View File

@ -892,6 +892,8 @@ CONFIG_NX_MXCLIENTMSGS=16
#
# 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.
@ -920,6 +922,7 @@ CONFIG_NX_MXCLIENTMSGS=16
# of the window. This setting can be defining to change this behavior so
# that the text is simply truncated until a new line is encountered.
#
CONFIG_NXCONSOLE=n
CONFIG_NXCONSOLE_BPP=16
# CONFIG_NXCONSOLE_NOGETRUN
# CONFIG_NXCONSOLE_MXCHARS

View File

@ -46,18 +46,12 @@
# Path to example in apps/examples containing the user_start entry point
CONFIGURED_APPS += examples/nsh
# Invoke the following application after NuttX starts
#CONFIG_BUILTIN_APP_START="hello"
# Application Libraries
CONFIGURED_APPS += system/readline
CONFIGURED_APPS += nshlib
# Individual selection of built-in applications:
# Hello world provide a simple skeleton/demo application
CONFIGURED_APPS += vsn/hello
# Provide poweroff command to switch off the board
CONFIGURED_APPS += vsn/poweroff
@ -79,5 +73,3 @@ CONFIGURED_APPS += system/free
# Provide FLASH program installation support
CONFIGURED_APPS += system/install

View File

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

View File

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

View File

@ -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;
}
/****************************************************************************

View File

@ -45,9 +45,42 @@
#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxtk.h>
#ifdef CONFIG_NXCONSOLE
/****************************************************************************
* Pre-processor definitions
****************************************************************************/
/* Configuration ************************************************************/
/* 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.
* Default: The smallest enabled pixel depth. (see CONFIG_NX_DISABLE_*BPP)
* CONFIG_NXCONSOLE_NOGETRUN
* NxConsole needs to know if it can read from the LCD or not. If reading
* from the LCD is supported, then NxConsole can do more efficient
* scrolling. Default: Supported
* CONFIG_NXCONSOLE_MXCHARS
* NxConsole needs to remember every character written to the console so
* that it can redraw the window. This setting determines the size of some
* internal memory allocations used to hold the character data. Default: 128.
* CONFIG_NXCONSOLE_FONTCACHE
* If this setting is defined, then caching of fonts will be supported by
* NxConsole. Each font must be rendered from the tiny font storage format
* to the full display size and pixel depth. If this setting is defined, then
* the more recently used font glyphs will be retained in a cache of size
* CONFIG_NXCONSOLE_CACHESIZE. Default: No font caching.
* CONFIG_NXCONSOLE_CACHESIZE
* If CONFIG_NXCONSOLE_FONTCACHE, then this setting will control the size
* of the font cache (in number of glyphs). Default: 16.
* CONFIG_NXCONSOLE_LINESEPARATION
* This the space (in rows) between each row of test. Default: 2
* CONFIG_NXCONSOLE_NOWRAP
* By default, lines will wrap when the test reaches the right hand side
* of the window. This setting can be defining to change this behavior so
* that the text is simply truncated until a new line is encountered.
*/
/****************************************************************************
* Public Types
@ -198,4 +231,5 @@ EXTERN void nxcon_redraw(NXCONSOLE handle, FAR const struct nxgl_rect_s *rect,
}
#endif
#endif /* CONFIG_NXCONSOLE */
#endif /* __INCLUDE_NUTTX_NX_NXCONSOLE_H */

View File

@ -122,7 +122,7 @@ ssize_t lib_fflush(FAR FILE *stream, bool bforce)
lib_take_semaphore(stream);
/* Make sure tht the buffer holds valid data */
/* Make sure that the buffer holds valid data */
if (stream->fs_bufpos != stream->fs_bufstart)
{