summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-03-28 16:06:56 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-03-28 16:06:56 +0000
commit6a79e47a66fcc0d38cffca54b862a1efa19eb822 (patch)
treed57d866e590029f590543adf137fffaeb234ab84 /apps
parent6402e6269bd2f9619b7a7b21bab9a1fedc6f360b (diff)
downloadnuttx-6a79e47a66fcc0d38cffca54b862a1efa19eb822.tar.gz
nuttx-6a79e47a66fcc0d38cffca54b862a1efa19eb822.tar.bz2
nuttx-6a79e47a66fcc0d38cffca54b862a1efa19eb822.zip
NX console updates
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4534 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps')
-rw-r--r--apps/examples/README.txt16
-rw-r--r--apps/examples/nxconsole/nxcon_internal.h40
-rw-r--r--apps/examples/nxconsole/nxcon_main.c2
-rw-r--r--apps/examples/nxconsole/nxcon_toolbar.c10
4 files changed, 49 insertions, 19 deletions
diff --git a/apps/examples/README.txt b/apps/examples/README.txt
index f7b6d74e7..01d4fb0ec 100644
--- a/apps/examples/README.txt
+++ b/apps/examples/README.txt
@@ -627,18 +627,20 @@ examples/nxconsole
buffer driver for use in the test. Default: 0
CONFIG_EXAMPLES_NXCON_DEVNO - The LCD device to select from the LCD
driver for use in the test: Default: 0
- CONFIG_EXAMPLES_NXCON_BGCOLOR -- The color of the background. Default depends on
- CONFIG_EXAMPLES_NXCON_BPP.
- CONFIG_EXAMPLES_NXCON_WCOLOR -- The color of the window. Default depends on
- CONFIG_EXAMPLES_NXCON_BPP.
- CONFIG_EXAMPLES_NXCON_FONTID - Selects the font (see font ID numbers in
+ CONFIG_EXAMPLES_NXCON_BGCOLOR -- The color of the background. Default
+ Default is a darker royal blue.
+ CONFIG_EXAMPLES_NXCON_WCOLOR -- The color of the window. Default is a light
+ slate blue.
+ CONFIG_EXAMPLES_NXCON_FONTID -- Selects the font (see font ID numbers in
include/nuttx/nx/nxfonts.h)
- CONFIG_EXAMPLES_NXCON_FONTCOLOR -- The color of the fonts. Default depends on
- CONFIG_EXAMPLES_NXCON_BPP.
+ CONFIG_EXAMPLES_NXCON_FONTCOLOR -- The color of the fonts. Default is
+ black.
CONFIG_EXAMPLES_NXCON_BPP -- Pixels per pixel to use. Valid options
include 2, 4, 8, 16, 24, and 32. Default is 32.
CONFIG_EXAMPLES_NXCON_TOOLBAR_HEIGHT -- The height of the toolbar.
Default: 16
+ CONFIG_EXAMPLES_NXCON_TBCOLOR -- The color of the toolbar. Default is
+ a medium grey.
CONFIG_EXAMPLES_NXCON_EXTERNINIT - The driver for the graphics device on
this platform requires some unusual initialization. This is the
for, for example, SPI LCD/OLED devices. If this configuration is
diff --git a/apps/examples/nxconsole/nxcon_internal.h b/apps/examples/nxconsole/nxcon_internal.h
index f5d88e600..fd3777334 100644
--- a/apps/examples/nxconsole/nxcon_internal.h
+++ b/apps/examples/nxconsole/nxcon_internal.h
@@ -46,6 +46,8 @@
#include <stdbool.h>
#include <semaphore.h>
+#include <nuttx/rgbcolors.h>
+
#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxglib.h>
#include <nuttx/nx/nxtk.h>
@@ -61,6 +63,10 @@
# error "NX is not enabled (CONFIG_NX)"
#endif
+#ifndef CONFIG_NXCONSOLE
+# error "NxConsole is not enabled (CONFIG_NXCONSOLE)"
+#endif
+
/* If not specified, assume that the hardware supports one video plane */
#if CONFIG_NX_NPLANES != 1
@@ -93,30 +99,42 @@
# endif
#endif
-/* Background color */
+/* Background color (default is darker royal blue) */
#ifndef CONFIG_EXAMPLES_NXCON_BGCOLOR
# if CONFIG_EXAMPLES_NXCON_BPP == 24 || CONFIG_EXAMPLES_NXCON_BPP == 32
-# define CONFIG_EXAMPLES_NXCON_BGCOLOR 0x007b68ee
+# define CONFIG_EXAMPLES_NXCON_BGCOLOR RGBTO24(39, 64, 139)
# elif CONFIG_EXAMPLES_NXCON_BPP == 16
-# define CONFIG_EXAMPLES_NXCON_BGCOLOR 0x7b5d
+# define CONFIG_EXAMPLES_NXCON_BGCOLOR RGBTO16(39, 64, 139)
# else
-# define CONFIG_EXAMPLES_NXCON_BGCOLOR ' '
+# define CONFIG_EXAMPLES_NXCON_BGCOLOR RGBTO8(39, 64, 139)
# endif
#endif
-/* Window color */
+/* Window color (lighter steel blue) */
#ifndef CONFIG_EXAMPLES_NXCON_WCOLOR
# if CONFIG_EXAMPLES_NXCON_BPP == 24 || CONFIG_EXAMPLES_NXCON_BPP == 32
-# define CONFIG_EXAMPLES_NXCON_WCOLOR 0x007b68ee
+# define CONFIG_EXAMPLES_NXCON_WCOLOR RGBTO24(202, 225, 255)
# elif CONFIG_EXAMPLES_NXCON_BPP == 16
-# define CONFIG_EXAMPLES_NXCON_WCOLOR 0x7b5d
+# define CONFIG_EXAMPLES_NXCON_WCOLOR RGBTO16(202, 225, 255)
# else
-# define CONFIG_EXAMPLES_NXCON_WCOLOR ' '
+# define CONFIG_EXAMPLES_NXCON_WCOLOR RGBTO8(202, 225, 255)
# endif
#endif
+/* Toolbar color (medium grey) */
+
+#ifndef CONFIG_EXAMPLES_NXCON_TBCOLOR
+# if CONFIG_EXAMPLES_NX_BPP == 24 || CONFIG_EXAMPLES_NX_BPP == 32
+# define CONFIG_EXAMPLES_NXCON_TBCOLOR RGBTO24(188, 188, 188)
+# elif CONFIG_EXAMPLES_NX_BPP == 16
+# define CONFIG_EXAMPLES_NXCON_TBCOLOR RGBTO16(188, 188, 188)
+# else
+# define CONFIG_EXAMPLES_NXCON_TBCOLOR RGBTO8(188, 188, 188)
+# endif
+#endif
+
/* Font ID */
#ifndef CONFIG_EXAMPLES_NXCON_FONTID
@@ -127,11 +145,11 @@
#ifndef CONFIG_EXAMPLES_NXCON_FONTCOLOR
# if CONFIG_EXAMPLES_NXCON_BPP == 24 || CONFIG_EXAMPLES_NXCON_BPP == 32
-# define CONFIG_EXAMPLES_NXCON_FONTCOLOR 0x00000000
+# define CONFIG_EXAMPLES_NXCON_FONTCOLOR RGBTO24(0, 0, 0)
# elif CONFIG_EXAMPLES_NXCON_BPP == 16
-# define CONFIG_EXAMPLES_NXCON_FONTCOLOR 0x0000
+# define CONFIG_EXAMPLES_NXCON_FONTCOLOR RGBTO16(0, 0, 0)
# else
-# define CONFIG_EXAMPLES_NXCON_FONTCOLOR 'F'
+# define CONFIG_EXAMPLES_NXCON_FONTCOLOR RGBTO8(0, 0, 0)
# endif
#endif
diff --git a/apps/examples/nxconsole/nxcon_main.c b/apps/examples/nxconsole/nxcon_main.c
index 2edea83ba..fad6b9c0c 100644
--- a/apps/examples/nxconsole/nxcon_main.c
+++ b/apps/examples/nxconsole/nxcon_main.c
@@ -490,7 +490,7 @@ int MAIN_NAME(int argc, char **argv)
if (++ndx >= NCON_MSG_NLINES)
{
#ifdef CONFIG_NSH_BUILTIN_APPS
- /* If this is an NSH built-in apps, then just return after all
+ /* If this is an NSH built-in app, then just return after all
* of the lines have been presented.
*/
diff --git a/apps/examples/nxconsole/nxcon_toolbar.c b/apps/examples/nxconsole/nxcon_toolbar.c
index 38b5c1ee3..d4432b2f4 100644
--- a/apps/examples/nxconsole/nxcon_toolbar.c
+++ b/apps/examples/nxconsole/nxcon_toolbar.c
@@ -114,9 +114,19 @@ const struct nx_callback_s g_nxtoolcb =
static void nxtool_redraw(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
bool more, FAR void *arg)
{
+ nxgl_mxpixel_t color[CONFIG_NX_NPLANES];
+ int ret;
+
gvdbg("hwnd=%p rect={(%d,%d),(%d,%d)} more=%s\n",
hwnd, rect->pt1.x, rect->pt1.y, rect->pt2.x, rect->pt2.y,
more ? "true" : "false");
+
+ color[0] = CONFIG_EXAMPLES_NXCON_TBCOLOR;
+ ret = nxtk_filltoolbar(hwnd, rect, color);
+ if (ret < 0)
+ {
+ gdbg("nxtk_filltoolbar failed: %d\n", errno);
+ }
}
/****************************************************************************