diff --git a/configs/zp214xpa/README.txt b/configs/zp214xpa/README.txt index ca4f79038e..8446aee6fd 100644 --- a/configs/zp214xpa/README.txt +++ b/configs/zp214xpa/README.txt @@ -236,7 +236,7 @@ Using OpenOCD and GDB with an FT2232 JTAG emulator configs/zp214xpa/tools/oocd.sh $PWD - If you add that path to your PATH environment variable, ithe commandi + If you add that path to your PATH environment variable, the command simplifies to just: oocd.sh $PWD @@ -309,9 +309,9 @@ Configurations: 2. Default platform/toolchain: - CONFIG_HOST_LINUX=y : Linux (Cygwin under Windows okay too). + CONFIG_HOST_LINUX=y : Linux (Cygwin under Windows okay too). CONFIG_ARM_TOOLCHAIN_GNU_EABIL=y : Buildroot (arm-nuttx-elf-gcc) - CONFIG_RAW_BINARY=y : Output formats: ELF and raw binary + CONFIG_RAW_BINARY=y : Output formats: ELF and raw binary nxlines: -------- @@ -333,8 +333,16 @@ Configurations: 2. Default platform/toolchain: - CONFIG_HOST_LINUX=y : Linux (Cygwin under Windows okay too). + CONFIG_HOST_LINUX=y : Linux (Cygwin under Windows okay too). CONFIG_ARM_TOOLCHAIN_GNU_EABIL=y : Buildroot (arm-nuttx-elf-gcc) - CONFIG_RAW_BINARY=y : Output formats: ELF and raw binary + CONFIG_RAW_BINARY=y : Output formats: ELF and raw binary + + STATUS: + 2012-12-30: Configuration verified. + + 2017-11-25: Grrr... This configuration no longer works. Some serious bit + rot has set in. Now only random garbage appears on the OLED. Certainly + a lot has changed since 2012, but I cannot see any change to either this + configuration, to the LCD driver or to the LPC2148 support that would + effect the operation of the LCD. - 3. Verified as of this writing (2012-12-30). diff --git a/configs/zp214xpa/src/lpc2148_appinit.c b/configs/zp214xpa/src/lpc2148_appinit.c index 8d52632333..8652e9134c 100644 --- a/configs/zp214xpa/src/lpc2148_appinit.c +++ b/configs/zp214xpa/src/lpc2148_appinit.c @@ -1,7 +1,7 @@ /**************************************************************************** * config/zp214xpa/src/lpc2148_appinit.c * - * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2015-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -40,7 +40,11 @@ #include #include -#include +#include + +#ifdef CONFIG_VIDEO_FB +# include +#endif #ifdef CONFIG_LIB_BOARDCTL @@ -75,6 +79,29 @@ int board_app_initialize(uintptr_t arg) { + int ret; + +#ifdef CONFIG_FS_PROCFS + /* Mount the procfs file system */ + + ret = mount(NULL, "/proc", "procfs", 0, NULL); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: Failed to mount procfs at /proc: %d\n", ret); + } +#endif + +#ifdef CONFIG_VIDEO_FB + /* Initialize and register the framebuffer driver */ + + ret = fb_register(0, 0); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: fb_register() failed: %d\n", ret); + } +#endif + + UNUSED(ret); return OK; } diff --git a/drivers/lcd/Kconfig b/drivers/lcd/Kconfig index ae3e82c704..3ca7b79cf0 100644 --- a/drivers/lcd/Kconfig +++ b/drivers/lcd/Kconfig @@ -41,6 +41,17 @@ config LCD_FRAMEBUFFER disabled because this external commone framebuffer interface will provide the necessary buffering. +config LCD_EXTERNINIT + bool "External LCD Initialization" + default n + depends on LCD_FRAMEBUFFER + ---help--- + Define to support external LCD initialization by platform-specific + code. This this option is defined, then the LCD framebuffer + emulation will call board_graphics_setup() to initialize the + graphics device. This option is necessary if display is used that + cannot be initialized using the standard LCD interfaces. + menu "LCD driver selection" config LCD_CONSOLE diff --git a/drivers/lcd/lcd_framebuffer.c b/drivers/lcd/lcd_framebuffer.c index 230433cd50..369d774a21 100644 --- a/drivers/lcd/lcd_framebuffer.c +++ b/drivers/lcd/lcd_framebuffer.c @@ -496,6 +496,16 @@ int up_fbinitialize(int display) priv->vtable.setcursor = lcdfb_setcursor, #endif +#ifdef CONFIG_LCD_EXTERNINIT + /* Use external graphics driver initialization */ + + lcd = board_graphics_setup(display); + if (lcd == NULL) + { + gerr("ERROR: board_graphics_setup failed, devno=%d\n", display); + return EXIT_FAILURE; + } +#else /* Initialize the LCD device */ ret = board_lcd_initialize(); @@ -514,6 +524,7 @@ int up_fbinitialize(int display) ret = -ENODEV; goto errout_with_lcd; } +#endif priv->lcd = lcd; @@ -571,9 +582,11 @@ int up_fbinitialize(int display) return OK; errout_with_lcd: +#ifndef CONFIG_LCD_EXTERNINIT board_lcd_uninitialize(); errout_with_state: +#endif kmm_free(priv); return ret; } @@ -656,9 +669,11 @@ void up_fbuninitialize(int display) g_lcdfb = priv->flink; } +#ifndef CONFIG_LCD_EXTERNINIT /* Uninitialize the LCD */ board_lcd_uninitialize(); +#endif /* Free the frame buffer allocation */ diff --git a/graphics/Kconfig b/graphics/Kconfig index 527f8fb01d..6ee3fc622c 100644 --- a/graphics/Kconfig +++ b/graphics/Kconfig @@ -389,8 +389,9 @@ config NX_MXCLIENTMSGS controls how many messages are pre-allocated). config NXSTART_EXTERNINIT - bool "External display Initialization" + bool "External Display Initialization" default n + select LCD_EXTERNINIT if NX_LCDDRIVER ---help--- Define to support external display initialization by platform- specific code. This this option is defined, then nx_start() will diff --git a/include/nuttx/board.h b/include/nuttx/board.h index 00fe5bb165..cfe38d4dd3 100644 --- a/include/nuttx/board.h +++ b/include/nuttx/board.h @@ -349,7 +349,7 @@ void board_tsc_teardown(void); * ****************************************************************************/ -#ifdef CONFIG_NX_LCDDRIVER +#if defined(CONFIG_NX_LCDDRIVER) || defined(CONFIG_LCD_FRAMEBUFFER) struct lcd_dev_s; FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno); #else