Rename up_nxdrvinit() to board_graphics_setup(). Add CONFIG_BOARDCTL_GRAPHICS that will enabled calls to board_graphics_setup() from boardctrl(). In apps/ and NxWidgts/, replace all calls to up_nxdrvinit with calls to boardctl().

This commit is contained in:
Gregory Nutt 2015-03-31 16:20:21 -06:00
parent 074b57aa69
commit 256abd6dba
19 changed files with 125 additions and 101 deletions

View File

@ -909,11 +909,15 @@ examples/nx
function with a prototype like:
#ifdef CONFIG_NX_LCDDRIVER
FAR struct lcd_dev_s *up_nxdrvinit(unsigned int devno);
FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno);
#else
FAR struct fb_vtable_s *up_nxdrvinit(unsigned int devno);
FAR struct fb_vtable_s *board_graphics_setup(unsigned int devno);
#endif
and must also define: CONFIG_LIB_BOARDCTL=y and
CONFIG_BOARDCTL_GRAPHICS=y so that the boardctl() interface
will be available in order to access this function.
This test can be performed with either the single-user version of
NX or with the multiple user version of NX selected with CONFIG_NX_MULTIUSER.
If CONFIG_NX_MULTIUSER is defined, then the following configuration
@ -982,11 +986,15 @@ examples/nxterm
function with a prototype like:
#ifdef CONFIG_NX_LCDDRIVER
FAR struct lcd_dev_s *up_nxdrvinit(unsigned int devno);
FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno);
#else
FAR struct fb_vtable_s *up_nxdrvinit(unsigned int devno);
FAR struct fb_vtable_s *board_graphics_setup(unsigned int devno);
#endif
and must also define: CONFIG_LIB_BOARDCTL=y and
CONFIG_BOARDCTL_GRAPHICS=y so that the boardctl() interface
will be available in order to access this function.
CONFIG_EXAMPLES_NXCON_MINOR -- The NX console device minor number.
Default is 0 corresponding to /dev/nxterm0
CONFIG_EXAMPLES_NXCON_DEVNAME -- The quoated, full path to the
@ -1054,11 +1062,15 @@ examplex/nxhello
function with a prototype like:
#ifdef CONFIG_NX_LCDDRIVER
FAR struct lcd_dev_s *up_nxdrvinit(unsigned int devno);
FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno);
#else
FAR struct fb_vtable_s *up_nxdrvinit(unsigned int devno);
FAR struct fb_vtable_s *board_graphics_setup(unsigned int devno);
#endif
and must also define: CONFIG_LIB_BOARDCTL=y and
CONFIG_BOARDCTL_GRAPHICS=y so that the boardctl() interface
will be available in order to access this function.
examples/nximage
^^^^^^^^^^^^^^^^
@ -1090,11 +1102,15 @@ examples/nximage
function with a prototype like:
#ifdef CONFIG_NX_LCDDRIVER
FAR struct lcd_dev_s *up_nxdrvinit(unsigned int devno);
FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno);
#else
FAR struct fb_vtable_s *up_nxdrvinit(unsigned int devno);
FAR struct fb_vtable_s *board_graphics_setup(unsigned int devno);
#endif
and must also define: CONFIG_LIB_BOARDCTL=y and
CONFIG_BOARDCTL_GRAPHICS=y so that the boardctl() interface
will be available in order to access this function.
How was that run-length encoded image produced?
a. I used GIMP output the image as a .c file.
@ -1148,11 +1164,15 @@ examplex/nxlines
function with a prototype like:
#ifdef CONFIG_NX_LCDDRIVER
FAR struct lcd_dev_s *up_nxdrvinit(unsigned int devno);
FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno);
#else
FAR struct fb_vtable_s *up_nxdrvinit(unsigned int devno);
FAR struct fb_vtable_s *board_graphics_setup(unsigned int devno);
#endif
and must also define: CONFIG_LIB_BOARDCTL=y and
CONFIG_BOARDCTL_GRAPHICS=y so that the boardctl() interface
will be available in order to access this function.
CONFIG_NSH_BUILTIN_APPS - Build the NX lines examples as an NSH built-in
function.
@ -1203,11 +1223,15 @@ examples/nxtext
function with a prototype like:
#ifdef CONFIG_NX_LCDDRIVER
FAR struct lcd_dev_s *up_nxdrvinit(unsigned int devno);
FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno);
#else
FAR struct fb_vtable_s *up_nxdrvinit(unsigned int devno);
FAR struct fb_vtable_s *board_graphics_setup(unsigned int devno);
#endif
and must also define: CONFIG_LIB_BOARDCTL=y and
CONFIG_BOARDCTL_GRAPHICS=y so that the boardctl() interface
will be available in order to access this function.
CONFIG_EXAMPLES_NXTEXT_BMCACHE - The maximum number of characters that
can be put in the background window. Default is 128.
CONFIG_EXAMPLES_NXTEXT_GLCACHE - The maximum nuber of pre-rendered

View File

@ -99,11 +99,15 @@ config EXAMPLES_NX_EXTERNINIT
must provide an LCD initialization function with a prototype like:
#ifdef CONFIG_NX_LCDDRIVER
FAR struct lcd_dev_s *up_nxdrvinit(unsigned int devno);
FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno);
#else
FAR struct fb_vtable_s *up_nxdrvinit(unsigned int devno);
FAR struct fb_vtable_s *board_graphics_setup(unsigned int devno);
#endif
and must also define: CONFIG_LIB_BOARDCTL=y and
CONFIG_BOARDCTL_GRAPHICS=y so that the boardctl() interface
will be available in order to access this function.
if NX_MULTIUSER
comment "Multi-User Configuration Options"

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/nx/nx_internal.h
*
* Copyright (C) 2008-2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2011, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -276,22 +276,18 @@ extern nxgl_mxpixel_t g_tbcolor[CONFIG_NX_NPLANES];
* Public Function Prototypes
****************************************************************************/
#ifdef CONFIG_EXAMPLES_NX_EXTERNINIT
extern FAR NX_DRIVERTYPE *up_nxdrvinit(unsigned int devno);
#endif
#if defined(CONFIG_NX) && defined(CONFIG_NX_MULTIUSER)
extern int nx_servertask(int argc, char *argv[]);
extern FAR void *nx_listenerthread(FAR void *arg);
int nx_servertask(int argc, char *argv[]);
FAR void *nx_listenerthread(FAR void *arg);
#endif
#ifdef CONFIG_NX_KBD
extern void nxeg_kbdin(NXWINDOW hwnd, uint8_t nch, const uint8_t *ch, FAR void *arg);
void nxeg_kbdin(NXWINDOW hwnd, uint8_t nch, const uint8_t *ch, FAR void *arg);
#ifndef CONFIG_EXAMPLES_NX_RAWWINDOWS
extern void nxeg_tbkbdin(NXWINDOW hwnd, uint8_t nch, const uint8_t *ch, FAR void *arg);
void nxeg_tbkbdin(NXWINDOW hwnd, uint8_t nch, const uint8_t *ch, FAR void *arg);
#endif
extern void nxeg_filltext(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
FAR struct nxeg_state_s *st);
void nxeg_filltext(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
FAR struct nxeg_state_s *st);
#endif
#endif /* __EXAMPLES_NX_NX_INTERNAL_H */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/nx/nx_main.c
*
* Copyright (C) 2008-2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2011, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -40,6 +40,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <sys/boardctl.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
@ -426,10 +427,10 @@ static inline int nxeg_suinitialize(void)
/* Use external graphics driver initialization */
printf("nxeg_initialize: Initializing external graphics device\n");
dev = up_nxdrvinit(CONFIG_EXAMPLES_NX_DEVNO);
dev = boardctl(BOARDIOC_GRAPHICS_SETUP, CONFIG_EXAMPLES_NX_DEVNO);
if (!dev)
{
printf("nxeg_initialize: up_nxdrvinit failed, devno=%d\n", CONFIG_EXAMPLES_NX_DEVNO);
printf("nxeg_initialize: boardctl failed, devno=%d\n", CONFIG_EXAMPLES_NX_DEVNO);
g_exitcode = NXEXIT_EXTINITIALIZE;
return ERROR;
}

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/nx/nx_server.c
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,6 +39,7 @@
#include <nuttx/config.h>
#include <sys/boardctl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@ -92,10 +93,11 @@ int nx_servertask(int argc, char *argv[])
/* Use external graphics driver initialization */
printf("nxeg_initialize: Initializing external graphics device\n");
dev = up_nxdrvinit(CONFIG_EXAMPLES_NX_DEVNO);
dev = boardctl(BOARDIOC_GRAPHICS_SETUP, CONFIG_EXAMPLES_NX_DEVNO);
if (!dev)
{
printf("nxeg_initialize: up_nxdrvinit failed, devno=%d\n", CONFIG_EXAMPLES_NX_DEVNO);
printf("nxeg_initialize: boardctl failed, devno=%d\n",
CONFIG_EXAMPLES_NX_DEVNO);
g_exitcode = NXEXIT_EXTINITIALIZE;
return ERROR;
}

View File

@ -84,9 +84,13 @@ config EXAMPLES_NXHELLO_EXTERNINIT
must provide an LCD initialization function with a prototype like:
#ifdef CONFIG_NX_LCDDRIVER
FAR struct lcd_dev_s *up_nxdrvinit(unsigned int devno);
FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno);
#else
FAR struct fb_vtable_s *up_nxdrvinit(unsigned int devno);
FAR struct fb_vtable_s *board_graphics_setup(unsigned int devno);
#endif
and must also define: CONFIG_LIB_BOARDCTL=y and
CONFIG_BOARDCTL_GRAPHICS=y so that the boardctl() interface
will be available in order to access this function.
endif

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/nxhello/nxhello.h
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -169,12 +169,8 @@ extern const struct nx_callback_s g_nxhellocb;
* Public Function Prototypes
****************************************************************************/
#ifdef CONFIG_EXAMPLES_NXHELLO_EXTERNINIT
extern FAR NX_DRIVERTYPE *up_nxdrvinit(unsigned int devno);
#endif
/* Background window interfaces */
extern void nxhello_hello(NXWINDOW hwnd);
void nxhello_hello(NXWINDOW hwnd);
#endif /* __APPS_EXAMPLES_NXHELLO_NXHELLO_H */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/nxhello/nxhello_main.c
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -40,6 +40,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <sys/boardctl.h>
#include <stdint.h>
#include <stdbool.h>
@ -126,10 +127,10 @@ static inline int nxhello_initialize(void)
/* Use external graphics driver initialization */
printf("nxhello_initialize: Initializing external graphics device\n");
dev = up_nxdrvinit(CONFIG_EXAMPLES_NXHELLO_DEVNO);
dev = boardctl(BOARDIOC_GRAPHICS_SETUP, CONFIG_EXAMPLES_NXHELLO_DEVNO);
if (!dev)
{
printf("nxhello_initialize: up_nxdrvinit failed, devno=%d\n",
printf("nxhello_initialize: boardctl failed, devno=%d\n",
CONFIG_EXAMPLES_NXHELLO_DEVNO);
g_nxhello.code = NXEXIT_EXTINITIALIZE;
return ERROR;

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/nximage/nximage.h
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -182,18 +182,14 @@ extern const struct nx_callback_s g_nximagecb;
* Public Function Prototypes
****************************************************************************/
#ifdef CONFIG_EXAMPLES_NXIMAGE_EXTERNINIT
extern FAR NX_DRIVERTYPE *up_nxdrvinit(unsigned int devno);
#endif
/* Background window interfaces */
extern void nximage_image(NXWINDOW hwnd);
void nximage_image(NXWINDOW hwnd);
/* Image interfaces */
extern nxgl_mxpixel_t nximage_bgcolor(void);
extern nxgl_mxpixel_t nximage_avgcolor(nxgl_mxpixel_t color1, nxgl_mxpixel_t color2);
extern void nximage_blitrow(FAR nxgl_mxpixel_t *run, FAR const void **state);
nxgl_mxpixel_t nximage_bgcolor(void);
nxgl_mxpixel_t nximage_avgcolor(nxgl_mxpixel_t color1, nxgl_mxpixel_t color2);
void nximage_blitrow(FAR nxgl_mxpixel_t *run, FAR const void **state);
#endif /* __APPS_EXAMPLES_NXIMAGE_NXIMAGE_H */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/nximage/nximage_main.c
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -40,6 +40,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <sys/boardctl.h>
#include <stdint.h>
#include <stdbool.h>
@ -130,10 +131,10 @@ static inline int nximage_initialize(void)
/* Use external graphics driver initialization */
printf("nximage_initialize: Initializing external graphics device\n");
dev = up_nxdrvinit(CONFIG_EXAMPLES_NXIMAGE_DEVNO);
dev = boardctl(BOARDIOC_GRAPHICS_SETUP, CONFIG_EXAMPLES_NXIMAGE_DEVNO);
if (!dev)
{
printf("nximage_initialize: up_nxdrvinit failed, devno=%d\n",
printf("nximage_initialize: boardctl failed, devno=%d\n",
CONFIG_EXAMPLES_NXIMAGE_DEVNO);
g_nximage.code = NXEXIT_EXTINITIALIZE;
return ERROR;

View File

@ -90,10 +90,13 @@ config EXAMPLES_NXLINES_EXTERNINIT
initialization function with a prototype like:
#ifdef NX_LCDDRIVER
FAR struct lcd_dev_s *up_nxdrvinit(unsigned int devno);
FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno);
#else
FAR struct fb_vtable_s *up_nxdrvinit(unsigned int devno);
FAR struct fb_vtable_s *board_graphics_setup(unsigned int devno);
#endif
endif
and must also define: CONFIG_LIB_BOARDCTL=y and
CONFIG_BOARDCTL_GRAPHICS=y so that the boardctl() interface
will be available in order to access this function.
endif

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/nxlines/nxlines.h
*
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2011-2012, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -166,12 +166,8 @@ extern const struct nx_callback_s g_nxlinescb;
* Public Function Prototypes
****************************************************************************/
#ifdef CONFIG_EXAMPLES_NXLINES_EXTERNINIT
extern FAR NX_DRIVERTYPE *up_nxdrvinit(unsigned int devno);
#endif
/* Background window interfaces */
extern void nxlines_test(NXWINDOW hwnd);
void nxlines_test(NXWINDOW hwnd);
#endif /* __APPS_EXAMPLES_NXLINES_NXLINES_H */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/nxlines/nxlines_main.c
*
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2011-2012, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -122,10 +122,10 @@ static inline int nxlines_initialize(void)
/* Use external graphics driver initialization */
printf("nxlines_initialize: Initializing external graphics device\n");
dev = up_nxdrvinit(CONFIG_EXAMPLES_NXLINES_DEVNO);
dev = boardctl(BOARDIOC_GRAPHICS_SETUP, CONFIG_EXAMPLES_NXLINES_DEVNO);
if (!dev)
{
printf("nxlines_initialize: up_nxdrvinit failed, devno=%d\n",
printf("nxlines_initialize: boardctl failed, devno=%d\n",
CONFIG_EXAMPLES_NXLINES_DEVNO);
g_nxlines.code = NXEXIT_EXTINITIALIZE;
return ERROR;

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/nxterm/nxterm_internal.h
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -276,15 +276,10 @@ extern const struct nx_callback_s g_nxtoolcb;
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/* Board-specific driver intiialization */
#ifdef CONFIG_EXAMPLES_NXCON_EXTERNINIT
extern FAR NX_DRIVERTYPE *up_nxdrvinit(unsigned int devno);
#endif
/* Server thread support */
extern int nxterm_server(int argc, char *argv[]);
extern FAR void *nxterm_listener(FAR void *arg);
int nxterm_server(int argc, char *argv[]);
FAR void *nxterm_listener(FAR void *arg);
#endif /* __EXAMPLES_NXTERM_NXCON_INTERNAL_H */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/nxterm/nxterm_server.c
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,6 +39,7 @@
#include <nuttx/config.h>
#include <sys/boardctl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@ -90,10 +91,11 @@ int nxterm_server(int argc, char *argv[])
/* Use external graphics driver initialization */
printf("nxterm_server: Initializing external graphics device\n");
dev = up_nxdrvinit(CONFIG_EXAMPLES_NXCON_DEVNO);
dev = boardctl(BOARDIOC_GRAPHICS_SETUP, CONFIG_EXAMPLES_NXCON_DEVNO);
if (!dev)
{
printf("nxterm_server: up_nxdrvinit failed, devno=%d\n", CONFIG_EXAMPLES_NXCON_DEVNO);
printf("nxterm_server: boardctl failed, devno=%d\n",
CONFIG_EXAMPLES_NXCON_DEVNO);
return ERROR;
}

View File

@ -118,11 +118,15 @@ config EXAMPLES_NXTEXT_EXTERNINIT
must provide an LCD initialization function with a prototype like:
#ifdef CONFIG_NX_LCDDRIVER
FAR struct lcd_dev_s *up_nxdrvinit(unsigned int devno);
FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno);
#else
FAR struct fb_vtable_s *up_nxdrvinit(unsigned int devno);
FAR struct fb_vtable_s *board_graphics_setup(unsigned int devno);
#endif
and must also define: CONFIG_LIB_BOARDCTL=y and
CONFIG_BOARDCTL_GRAPHICS=y so that the boardctl() interface
will be available in order to access this function.
if NX_MULTIUSER
comment "Multi-User Configuration Options"

View File

@ -315,32 +315,29 @@ extern int g_exitcode;
* Public Function Prototypes
****************************************************************************/
#ifdef CONFIG_EXAMPLES_NXTEXT_EXTERNINIT
extern FAR NX_DRIVERTYPE *up_nxdrvinit(unsigned int devno);
#endif
#if defined(CONFIG_NX) && defined(CONFIG_NX_MULTIUSER)
extern int nxtext_server(int argc, char *argv[]);
extern FAR void *nxtext_listener(FAR void *arg);
int nxtext_server(int argc, char *argv[]);
FAR void *nxtext_listener(FAR void *arg);
#endif
/* Background window interfaces */
extern FAR struct nxtext_state_s *nxbg_getstate(void);
extern void nxbg_write(NXWINDOW hwnd, FAR const uint8_t *buffer, size_t buflen);
FAR struct nxtext_state_s *nxbg_getstate(void);
void nxbg_write(NXWINDOW hwnd, FAR const uint8_t *buffer, size_t buflen);
/* Pop-up window interfaces */
extern NXWINDOW nxpu_open(void);
extern int nxpu_close(NXWINDOW hwnd);
NXWINDOW nxpu_open(void);
int nxpu_close(NXWINDOW hwnd);
/* Generic text helpers */
extern void nxtext_home(FAR struct nxtext_state_s *st);
extern void nxtext_newline(FAR struct nxtext_state_s *st);
extern void nxtext_putc(NXWINDOW hwnd, FAR struct nxtext_state_s *st,
NXHANDLE hfont, uint8_t ch);
extern void nxtext_fillchar(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
FAR struct nxtext_state_s *st, NXHANDLE hfont,
FAR const struct nxtext_bitmap_s *bm);
void nxtext_home(FAR struct nxtext_state_s *st);
void nxtext_newline(FAR struct nxtext_state_s *st);
void nxtext_putc(NXWINDOW hwnd, FAR struct nxtext_state_s *st,
NXHANDLE hfont, uint8_t ch);
void nxtext_fillchar(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
FAR struct nxtext_state_s *st, NXHANDLE hfont,
FAR const struct nxtext_bitmap_s *bm);
#endif /* __EXAMPLES_NXTEXT_NXTEXT_INTERNAL_H */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/nxtext/nxtext_main.c
*
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2011-2012, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -168,10 +168,11 @@ static inline int nxtext_suinitialize(void)
/* Use external graphics driver initialization */
printf("nxtext_initialize: Initializing external graphics device\n");
dev = up_nxdrvinit(CONFIG_EXAMPLES_NXTEXT_DEVNO);
dev = boardctl(BOARDIOC_GRAPHICS_SETUP, CONFIG_EXAMPLES_NXTEXT_DEVNO);
if (!dev)
{
printf("nxtext_initialize: up_nxdrvinit failed, devno=%d\n", CONFIG_EXAMPLES_NXTEXT_DEVNO);
printf("nxtext_initialize: boardctl failed, devno=%d\n",
CONFIG_EXAMPLES_NXTEXT_DEVNO);
g_exitcode = NXEXIT_EXTINITIALIZE;
return ERROR;
}

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/nxtext/nxtext_server.c
*
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2011-2012, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -92,10 +92,11 @@ int nxtext_server(int argc, char *argv[])
/* Use external graphics driver initialization */
printf("nxtext_server: Initializing external graphics device\n");
dev = up_nxdrvinit(CONFIG_EXAMPLES_NXTEXT_DEVNO);
dev = boardctl(BOARDIOC_GRAPHICS_SETUP, CONFIG_EXAMPLES_NXTEXT_DEVNO);
if (!dev)
{
printf("nxtext_server: up_nxdrvinit failed, devno=%d\n", CONFIG_EXAMPLES_NXTEXT_DEVNO);
printf("nxtext_server: boardctl failed, devno=%d\n",
CONFIG_EXAMPLES_NXTEXT_DEVNO);
g_exitcode = NXEXIT_EXTINITIALIZE;
return ERROR;
}