Turn off LCD reading on Shenzhou board (needs some TLC before it will be usable)

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5202 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2012-09-28 19:24:46 +00:00
parent 2ac7f18021
commit 396f8c48ad
5 changed files with 137 additions and 32 deletions

View File

@ -3438,3 +3438,11 @@
* arch/arm/src/stm32/stm32_gpio.c: Add missing logic to set bit
for SPI3 remap. This fixes the XPT2046 touchscreen driver using
drivers/input/ads7843.c
* configs/shenzhou/src/up_ssd1289.c: Fix naming error in
conditional compilation.
* configs/shenzhou/nxwm/defconfig: Disable reading from the LCD.
This does not work. The hardware and the driver support the
capability, but there is some bug that causes memory corruption.
The work around for now: Just disable reading from the LCD.
* drivers/lcd/ssd1289.c: Add some logic to reduce the amount of
output when CONFIG_DEBUG_LCD is enabled.

View File

@ -702,11 +702,11 @@ Where <subdir> is one of the following:
This is a special configuration setup for the NxWM window manager
UnitTest. The NxWM window manager can be found here:
trunk/NxWidgets/nxwm
nuttx-code/NxWidgets/nxwm
The NxWM unit test can be found at:
trunk/NxWidgets/UnitTests/nxwm
nuttx-code/NxWidgets/UnitTests/nxwm
NOTE: JP6 selects between the touchscreen interrupt and the MII
interrupt. It should be positioned 1-2 to enable the touchscreen
@ -714,13 +714,13 @@ Where <subdir> is one of the following:
Documentation for installing the NxWM unit test can be found here:
trunk/NxWidgets/UnitTests/README.txt
nuttx-code/NxWidgets/UnitTests/README.txt
Here is the quick summary of the build steps:
1. Intall the nxwm configuration
$ cd ~/nuttx/trunk/nuttx/tools
$ cd ~/nuttx/nuttx-code/tools
$ ./configure.sh shenzhou/nxwm
2. Make the build context (only)
@ -732,25 +732,41 @@ Where <subdir> is one of the following:
3. Install the nxwm unit test
$ cd ~/nuttx/trunk/NxWidgets
$ tools/install.sh ~/nuttx/trunk/apps nxwm
$ cd ~/nuttx/nuttx-code/NxWidgets
$ tools/install.sh ~/nuttx/nuttx-code/apps nxwm
Creating symbolic link
- To ~/nuttx/trunk/NxWidgets/UnitTests/nxwm
- At ~/nuttx/trunk/apps/external
- To ~/nuttx/nuttx-code/NxWidgets/UnitTests/nxwm
- At ~/nuttx/nuttx-code/apps/external
4. Build the NxWidgets library
$ cd ~/nuttx/trunk/NxWidgets/libnxwidgets
$ make TOPDIR=~/nuttx/trunk/nuttx
$ cd ~/nuttx/nuttx-code/NxWidgets/libnxwidgets
$ make TOPDIR=~/nuttx/nuttx-code
...
5. Build the NxWM library
$ cd ~/nuttx/trunk/NxWidgets/nxwm
$ make TOPDIR=~//nuttx/trunk/nuttx
$ cd ~/nuttx/nuttx-code/NxWidgets/nxwm
$ make TOPDIR=~/nuttx/nuttx-code
...
6. Built NuttX with the installed unit test as the application
$ cd ~/nuttx/trunk/nuttx
$ cd ~/nuttx/nuttx-code
$ make
NOTE: Reading from the LCD is not currently supported by this
configuration. The hardware will support reading from the LCD
and drivers/lcd/ssd1289.c also supports reading from the LCD.
This limits some graphics capabilities.
If you enable reading from the LCD, you will see some memory
corruption. If you get inspired to debug this problem, you can
turn the LCD read functionality back on by setting:
-CONFIG_LCD_NOGETRUN=y
+# CONFIG_LCD_NOGETRUN is not set
-CONFIG_NX_WRITEONLY=y
+# CONFIG_NX_WRITEONLY is not set

View File

@ -197,7 +197,6 @@ CONFIG_STM32_PHYSR_100FD=0x8000
CONFIG_STM32_RMII=y
CONFIG_STM32_RMII_MCO=y
# CONFIG_STM32_RMII_EXTCLK is not set
# CONFIG_STM32_ETHMAC_REGDEBUG is not set
#
# USB Host Configuration
@ -367,7 +366,7 @@ CONFIG_ADS7843E_THRESHX=39
CONFIG_ADS7843E_THRESHY=51
# CONFIG_INPUT_STMPE811 is not set
CONFIG_LCD=y
# CONFIG_LCD_NOGETRUN is not set
CONFIG_LCD_NOGETRUN=y
CONFIG_LCD_MAXCONTRAST=1
CONFIG_LCD_MAXPOWER=1
# CONFIG_LCD_P14201 is not set
@ -487,7 +486,7 @@ CONFIG_FAT_MAXFNAME=32
CONFIG_NX=y
CONFIG_NX_LCDDRIVER=y
CONFIG_NX_NPLANES=1
# CONFIG_NX_WRITEONLY is not set
CONFIG_NX_WRITEONLY=y
#
# Supported Pixel Depths
@ -1075,6 +1074,7 @@ CONFIG_NXWIDGETS_CONTINUE_REPEAT_TIME=200
CONFIG_NXWIDGETS_DOUBLECLICK_TIME=350
CONFIG_NXWIDGETS_KBDBUFFER_SIZE=16
CONFIG_NXWIDGETS_CURSORCONTROL_SIZE=4
# CONFIG_NXWIDGET_MEMMONITOR is not set
CONFIG_NXWM=y
#

View File

@ -122,7 +122,7 @@ static void stm32_lcdshow(FAR struct stm32_lower_s *priv, FAR const char *msg);
#endif
static void stm32_wrdata(FAR struct stm32_lower_s *priv, uint16_t data);
#ifndef CONFIG_SSD1289_WRONLY
#ifndef CONFIG_LCD_NOGETRUN
static inline uint16_t stm32_rddata(FAR struct stm32_lower_s *priv);
#endif
@ -131,7 +131,7 @@ static inline uint16_t stm32_rddata(FAR struct stm32_lower_s *priv);
static void stm32_select(FAR struct ssd1289_lcd_s *dev);
static void stm32_deselect(FAR struct ssd1289_lcd_s *dev);
static void stm32_index(FAR struct ssd1289_lcd_s *dev, uint8_t index);
#ifndef CONFIG_SSD1289_WRONLY
#ifndef CONFIG_LCD_NOGETRUN
static uint16_t stm32_read(FAR struct ssd1289_lcd_s *dev);
#endif
static void stm32_write(FAR struct ssd1289_lcd_s *dev, uint16_t data);
@ -253,7 +253,7 @@ static struct stm32_lower_s g_lcdlower =
.select = stm32_select,
.deselect = stm32_deselect,
.index = stm32_index,
#ifndef CONFIG_SSD1289_WRONLY
#ifndef CONFIG_LCD_NOGETRUN
.read = stm32_read,
#endif
.write = stm32_write,
@ -326,7 +326,7 @@ static void stm32_wrdata(FAR struct stm32_lower_s *priv, uint16_t data)
*
************************************************************************************/
#ifndef CONFIG_SSD1289_WRONLY
#ifndef CONFIG_LCD_NOGETRUN
static inline uint16_t stm32_rddata(FAR struct stm32_lower_s *priv)
{
uint16_t regval;
@ -407,7 +407,7 @@ static void stm32_index(FAR struct ssd1289_lcd_s *dev, uint8_t index)
*
************************************************************************************/
#ifndef CONFIG_SSD1289_WRONLY
#ifndef CONFIG_LCD_NOGETRUN
static uint16_t stm32_read(FAR struct ssd1289_lcd_s *dev)
{
FAR struct stm32_lower_s *priv = (FAR struct stm32_lower_s *)dev;

View File

@ -229,8 +229,8 @@
/* Debug ******************************************************************************/
#ifdef CONFIG_DEBUG_LCD
# define lcddbg dbg
# define lcdvdbg vdbg
# define lcddbg dbg
# define lcdvdbg vdbg
#else
# define lcddbg(x...)
# define lcdvdbg(x...)
@ -253,6 +253,16 @@ struct ssd1289_dev_s
FAR struct ssd1289_lcd_s *lcd; /* The contained platform-specific, LCD interface */
uint8_t power; /* Current power setting */
/* These fields simplify and reduce debug output */
#ifdef CONFIG_DEBUG_LCD
bool put; /* Last raster operation was a putrun */
fb_coord_t firstrow; /* First row of the run */
fb_coord_t lastrow; /* Last row of the run */
fb_coord_t col; /* Column of the run */
size_t npixels; /* Length of the run */
#endif
/* This is working memory allocated by the LCD driver for each LCD device
* and for each color plane. This memory will hold one raster line of data.
* The size of the allocated run buffer must therefore be at least
@ -287,6 +297,19 @@ static void ssd1289_setcursor(FAR struct ssd1289_lcd_s *lcd, uint16_t column,
/* LCD Data Transfer Methods */
#if 0 /* Sometimes useful */
static void ssd1289_dumprun(FAR const char *msg, FAR uint16_t *run, size_t npixels);
#else
# define ssd1289_dumprun(m,r,n)
#endif
#ifdef CONFIG_DEBUG_LCD
static void ssd1289_showrun(FAR struct ssd1289_dev_s *priv, fb_coord_t row,
fb_coord_t col, size_t npixels, bool put);
#else
# define ssd1289_showrun(p,r,c,n,b)
#endif
static int ssd1289_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffer,
size_t npixels);
static int ssd1289_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer,
@ -488,6 +511,64 @@ static void ssd1289_dumprun(FAR const char *msg, FAR uint16_t *run, size_t npixe
}
#endif
/**************************************************************************************
* Name: ssd1289_showrun
*
* Description:
* When LCD debug is enabled, try to reduce then amount of ouptut data generated by
* ssd1289_putrun and ssd1289_getrun
*
**************************************************************************************/
#ifdef CONFIG_DEBUG_LCD
static void ssd1289_showrun(FAR struct ssd1289_dev_s *priv, fb_coord_t row,
fb_coord_t col, size_t npixels, bool put)
{
fb_coord_t nextrow = priv->lastrow + 1;
/* Has anything changed (other than the row is the next row in the sequence)? */
if (put == priv->put && row == nextrow && col == priv->col &&
npixels == priv->npixels)
{
/* No, just update the last row */
priv->lastrow = nextrow;
}
else
{
/* Yes... then this is the end of the preceding sequence. Output the last run
* (if there were more than one run in the sequence).
*/
if (priv->firstrow != priv->lastrow)
{
lcddbg("...\n");
lcddbg("%s row: %d col: %d npixels: %d\n",
priv->put ? "PUT" : "GET",
priv->lastrow, priv->col, priv->npixels);
}
/* And we are starting a new sequence. Output the first run of the
* new sequence
*/
lcddbg("%s row: %d col: %d npixels: %d\n",
put ? "PUT" : "GET", row, col, npixels);
/* And save information about the run so that we can detect continuations
* of the sequence.
*/
priv->put = put;
priv->firstrow = row;
priv->lastrow = row;
priv->col = col;
priv->npixels = npixels;
}
}
#endif
/**************************************************************************************
* Name: ssd1289_putrun
*
@ -512,7 +593,7 @@ static int ssd1289_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buf
/* Buffer must be provided and aligned to a 16-bit address boundary */
lcdvdbg("row: %d col: %d npixels: %d\n", row, col, npixels);
ssd1289_showrun(priv, row, col, npixels, true);
DEBUGASSERT(buffer && ((uintptr_t)buffer & 1) == 0);
/* Select the LCD */
@ -536,7 +617,7 @@ static int ssd1289_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buf
ssd1289_gramselect(lcd);
ssd1289_gramwrite(lcd, *src);
/* Increment to next column */
/* Increment to the next column */
src++;
col++;
@ -581,7 +662,7 @@ static int ssd1289_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buf
ssd1289_gramselect(lcd);
ssd1289_gramwrite(lcd, *src);
/* Increment to next column */
/* Increment to the next column */
src++;
col--;
@ -604,7 +685,7 @@ static int ssd1289_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buf
ssd1289_gramselect(lcd);
ssd1289_gramwrite(lcd, *src);
/* Decrement to next column */
/* Decrement to the next column */
src++;
col++;
@ -632,7 +713,7 @@ static int ssd1289_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buf
**************************************************************************************/
static int ssd1289_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer,
size_t npixels)
size_t npixels)
{
#ifndef CONFIG_LCD_NOGETRUN
FAR struct ssd1289_dev_s *priv = &g_lcddev;
@ -643,7 +724,7 @@ static int ssd1289_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer,
/* Buffer must be provided and aligned to a 16-bit address boundary */
lcdvdbg("row: %d col: %d npixels: %d\n", row, col, npixels);
ssd1289_showrun(priv, row, col, npixels, false);
DEBUGASSERT(buffer && ((uintptr_t)buffer & 1) == 0);
/* Select the LCD */
@ -666,7 +747,7 @@ static int ssd1289_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer,
ssd1289_readsetup(lcd, &accum);
*dest++ = ssd1289_gramread(lcd, &accum);
/* Increment to next column */
/* Increment to the next column */
col++;
}
@ -715,7 +796,7 @@ static int ssd1289_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer,
ssd1289_readsetup(lcd, &accum);
*dest++ = ssd1289_gramread(lcd, &accum);
/* Increment to next column */
/* Increment to the next column */
col--;
}
@ -738,7 +819,7 @@ static int ssd1289_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer,
ssd1289_readsetup(lcd, &accum);
*dest++ = ssd1289_gramread(lcd, &accum);
/* Decrement to next column */
/* Decrement to the next column */
col++;
}