diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-03-28 17:19:17 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-03-28 17:19:17 +0000 |
commit | 51f649620cc2be02b02f31ec872920e5ba2afb79 (patch) | |
tree | e12183151cf2f149ff8319895a151c458db3ba01 /apps/examples/nxconsole/nxcon_main.c | |
parent | 6a79e47a66fcc0d38cffca54b862a1efa19eb822 (diff) | |
download | nuttx-51f649620cc2be02b02f31ec872920e5ba2afb79.tar.gz nuttx-51f649620cc2be02b02f31ec872920e5ba2afb79.tar.bz2 nuttx-51f649620cc2be02b02f31ec872920e5ba2afb79.zip |
NX console should only be available if NX multi-user mode is enabled
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4535 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/examples/nxconsole/nxcon_main.c')
-rw-r--r-- | apps/examples/nxconsole/nxcon_main.c | 104 |
1 files changed, 1 insertions, 103 deletions
diff --git a/apps/examples/nxconsole/nxcon_main.c b/apps/examples/nxconsole/nxcon_main.c index fad6b9c0c..8713be493 100644 --- a/apps/examples/nxconsole/nxcon_main.c +++ b/apps/examples/nxconsole/nxcon_main.c @@ -129,91 +129,10 @@ struct nxcon_state_s g_nxcon_vars; ****************************************************************************/ /**************************************************************************** - * Name: nxcon_suinitialize - ****************************************************************************/ - -#ifndef CONFIG_NX_MULTIUSER -static inline int nxcon_suinitialize(void) -{ - FAR NX_DRIVERTYPE *dev; - -#if defined(CONFIG_EXAMPLES_NXCON_EXTERNINIT) - /* Use external graphics driver initialization */ - - message("nxcon_initialize: Initializing external graphics device\n"); - dev = up_nxdrvinit(CONFIG_EXAMPLES_NXCON_DEVNO); - if (!dev) - { - message("nxcon_initialize: up_nxdrvinit failed, devno=%d\n", CONFIG_EXAMPLES_NXCON_DEVNO); - return ERROR; - } - -#elif defined(CONFIG_NX_LCDDRIVER) - int ret; - - /* Initialize the LCD device */ - - message("nxcon_initialize: Initializing LCD\n"); - ret = up_lcdinitialize(); - if (ret < 0) - { - message("nxcon_initialize: up_lcdinitialize failed: %d\n", -ret); - return ERROR; - } - - /* Get the device instance */ - - dev = up_lcdgetdev(CONFIG_EXAMPLES_NXCON_DEVNO); - if (!dev) - { - message("nxcon_initialize: up_lcdgetdev failed, devno=%d\n", - CONFIG_EXAMPLES_NXCON_DEVNO); - return ERROR; - } - - /* Turn the LCD on at 75% power */ - - (void)dev->setpower(dev, ((3*CONFIG_LCD_MAXPOWER + 3)/4)); -#else - int ret; - - /* Initialize the frame buffer device */ - - message("nxcon_initialize: Initializing framebuffer\n"); - ret = up_fbinitialize(); - if (ret < 0) - { - message("nxcon_initialize: up_fbinitialize failed: %d\n", -ret); - return ERROR; - } - - dev = up_fbgetvplane(CONFIG_EXAMPLES_NXCON_VPLANE); - if (!dev) - { - message("nxcon_initialize: up_fbgetvplane failed, vplane=%d\n", CONFIG_EXAMPLES_NXCON_VPLANE); - return ERROR; - } -#endif - - /* Then open NX */ - - message("nxcon_initialize: Open NX\n"); - g_nxcon_vars.hnx = nx_open(dev); - if (!g_nxcon_vars.hnx) - { - message("nxcon_initialize: nx_open failed: %d\n", errno); - return ERROR; - } - return OK; -} -#endif - -/**************************************************************************** * Name: nxcon_initialize ****************************************************************************/ -#ifdef CONFIG_NX_MULTIUSER -static inline int nxcon_muinitialize(void) +static int nxcon_initialize(void) { struct sched_param param; pthread_t thread; @@ -287,20 +206,6 @@ static inline int nxcon_muinitialize(void) } return OK; } -#endif - -/**************************************************************************** - * Name: nxcon_initialize - ****************************************************************************/ - -static int nxcon_initialize(void) -{ -#ifdef CONFIG_NX_MULTIUSER - return nxcon_muinitialize(); -#else - return nxcon_suinitialize(); -#endif -} /**************************************************************************** * Public Functions @@ -519,17 +424,10 @@ errout_with_hwnd: (void)nxtk_closewindow(g_nxcon_vars.hwnd); errout_with_nx: -#ifdef CONFIG_NX_MULTIUSER /* Disconnect from the server */ message(MAIN_NAME_STRING ": Disconnect from the server\n"); nx_disconnect(g_nxcon_vars.hnx); -#else - /* Close the server */ - - message(MAIN_NAME_STRING ": Close NX\n"); - nx_close(g_nxcon_vars.hnx); -#endif errout: return exitcode; } |