int trv_servertask(int argc, char *argv[]) { FAR struct fb_vtable_s *fbdev; int ret; /* Get the framebuffer device */ fbdev = trv_get_fbdev(); /* Then start the server */ ret = nx_run(dev); trv_abort("nx_run returned: %d\n", errno); }
int nxcon_server(int argc, char *argv[]) { FAR NX_DRIVERTYPE *dev; int ret; #if defined(CONFIG_EXAMPLES_NXCON_EXTERNINIT) /* Use external graphics driver initialization */ message("nxcon_server: Initializing external graphics device\n"); dev = up_nxdrvinit(CONFIG_EXAMPLES_NXCON_DEVNO); if (!dev) { message("nxcon_server: up_nxdrvinit failed, devno=%d\n", CONFIG_EXAMPLES_NXCON_DEVNO); return ERROR; } #elif defined(CONFIG_NX_LCDDRIVER) /* Initialize the LCD device */ message("nxcon_server: Initializing LCD\n"); ret = up_lcdinitialize(); if (ret < 0) { message("nxcon_server: up_lcdinitialize failed: %d\n", -ret); return 1; } /* Get the device instance */ dev = up_lcdgetdev(CONFIG_EXAMPLES_NXCON_DEVNO); if (!dev) { message("nxcon_server: up_lcdgetdev failed, devno=%d\n", CONFIG_EXAMPLES_NXCON_DEVNO); return 2; } /* Turn the LCD on at 75% power */ (void)dev->setpower(dev, ((3*CONFIG_LCD_MAXPOWER + 3)/4)); #else /* Initialize the frame buffer device */ message("nxcon_server: Initializing framebuffer\n"); ret = up_fbinitialize(); if (ret < 0) { message("nxcon_server: up_fbinitialize failed: %d\n", -ret); return 1; } dev = up_fbgetvplane(CONFIG_EXAMPLES_NXCON_VPLANE); if (!dev) { message("nxcon_server: up_fbgetvplane failed, vplane=%d\n", CONFIG_EXAMPLES_NXCON_VPLANE); return 2; } #endif /* Then start the server */ ret = nx_run(dev); gvdbg("nx_run returned: %d\n", errno); return 3; }
int nx_servertask(int argc, char *argv[]) { FAR NX_DRIVERTYPE *dev; int ret; #if defined(CONFIG_EXAMPLES_NX_EXTERNINIT) /* Use external graphics driver initialization */ printf("nxeg_initialize: Initializing external graphics device\n"); dev = boardctl(BOARDIOC_GRAPHICS_SETUP, CONFIG_EXAMPLES_NX_DEVNO); if (!dev) { printf("nxeg_initialize: boardctl failed, devno=%d\n", CONFIG_EXAMPLES_NX_DEVNO); g_exitcode = NXEXIT_EXTINITIALIZE; return ERROR; } #elif defined(CONFIG_NX_LCDDRIVER) /* Initialize the LCD device */ printf("nx_servertask: Initializing LCD\n"); ret = board_lcd_initialize(); if (ret < 0) { printf("nx_servertask: board_lcd_initialize failed: %d\n", -ret); return 1; } /* Get the device instance */ dev = board_lcd_getdev(CONFIG_EXAMPLES_NX_DEVNO); if (!dev) { printf("nx_servertask: board_lcd_getdev failed, devno=%d\n", CONFIG_EXAMPLES_NX_DEVNO); return 2; } /* Turn the LCD on at 75% power */ (void)dev->setpower(dev, ((3*CONFIG_LCD_MAXPOWER + 3)/4)); #else /* Initialize the frame buffer device */ printf("nx_servertask: Initializing framebuffer\n"); ret = up_fbinitialize(); if (ret < 0) { printf("nx_servertask: up_fbinitialize failed: %d\n", -ret); return 1; } dev = up_fbgetvplane(CONFIG_EXAMPLES_NX_VPLANE); if (!dev) { printf("nx_servertask: up_fbgetvplane failed, vplane=%d\n", CONFIG_EXAMPLES_NX_VPLANE); return 2; } #endif /* Then start the server */ ret = nx_run(dev); printf("nx_servertask: nx_run returned: %d\n", errno); return 3; }
int nx_server(int argc, char *argv[]) { FAR NX_DRIVERTYPE *dev; int ret; #if defined(CONFIG_NXSTART_EXTERNINIT) /* Use external graphics driver initialization */ dev = up_nxdrvinit(CONFIG_NXSTART_DEVNO); if (!dev) { gdbg("ERROR: up_nxdrvinit failed, devno=%d\n", CONFIG_NXSTART_DEVNO); return EXIT_FAILURE; } #elif defined(CONFIG_NX_LCDDRIVER) /* Initialize the LCD device */ ret = up_lcdinitialize(); if (ret < 0) { gdbg("ERROR: up_lcdinitialize failed: %d\n", ret); return EXIT_FAILURE; } /* Get the device instance */ dev = up_lcdgetdev(CONFIG_NXSTART_DEVNO); if (!dev) { gdbg("ERROR: up_lcdgetdev failed, devno=%d\n", CONFIG_NXSTART_DEVNO); return EXIT_FAILURE; } /* Turn the LCD on at 75% power */ (void)dev->setpower(dev, ((3*CONFIG_LCD_MAXPOWER + 3)/4)); #else /* CONFIG_NX_LCDDRIVER */ /* Initialize the frame buffer device */ ret = up_fbinitialize(); if (ret < 0) { gdbg("ERROR: up_fbinitialize failed: %d\n", ret); return EXIT_FAILURE; } dev = up_fbgetvplane(CONFIG_NXSTART_VPLANE); if (!dev) { gdbg("ERROR: up_fbgetvplane failed, vplane=%d\n", CONFIG_NXSTART_VPLANE); return EXIT_FAILURE; } #endif /* CONFIG_NX_LCDDRIVER */ /* Then start the server (nx_run does not normally return) */ ret = nx_run(dev); gvdbg("nx_run returned: %d\n", ret); return EXIT_FAILURE; }
int nxterm_server(int argc, char *argv[]) { FAR NX_DRIVERTYPE *dev; int ret; #if defined(CONFIG_EXAMPLES_NXTERM_EXTERNINIT) struct boardioc_graphics_s devinfo; int ret; /* Use external graphics driver initialization */ printf("nxterm_server: Initializing external graphics device\n"); devinfo.devno = CONFIG_EXAMPLES_NXTERM_DEVNO; devinfo.dev = NULL; ret = boardctl(BOARDIOC_GRAPHICS_SETUP, (uintptr_t)&devinfo); if (ret < 0) { printf("nxterm_server: boardctl failed, devno=%d: %d\n", CONFIG_EXAMPLES_NXTERM_DEVNO, errno); return ERROR; } dev = devinfo.dev; #elif defined(CONFIG_NX_LCDDRIVER) /* Initialize the LCD device */ printf("nxterm_server: Initializing LCD\n"); ret = board_lcd_initialize(); if (ret < 0) { printf("nxterm_server: board_lcd_initialize failed: %d\n", -ret); return 1; } /* Get the device instance */ dev = board_lcd_getdev(CONFIG_EXAMPLES_NXTERM_DEVNO); if (!dev) { printf("nxterm_server: board_lcd_getdev failed, devno=%d\n", CONFIG_EXAMPLES_NXTERM_DEVNO); return 2; } /* Turn the LCD on at 75% power */ (void)dev->setpower(dev, ((3*CONFIG_LCD_MAXPOWER + 3)/4)); #else /* Initialize the frame buffer device */ printf("nxterm_server: Initializing framebuffer\n"); ret = up_fbinitialize(0); if (ret < 0) { printf("nxterm_server: up_fbinitialize failed: %d\n", -ret); return 1; } dev = up_fbgetvplane(0, CONFIG_EXAMPLES_NXTERM_VPLANE); if (!dev) { printf("nxterm_server: up_fbgetvplane failed, vplane=%d\n", CONFIG_EXAMPLES_NXTERM_VPLANE); return 2; } #endif /* Then start the server */ ret = nx_run(dev); gvdbg("nx_run returned: %d\n", errno); return 3; }