diff --git a/ChangeLog b/ChangeLog index bcb8a099e01d7fc8c024fbf5031c051b841589a4..2367f0fb06a6c04352f4b9a2ec2165ea9cf9d402 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4457,4 +4457,6 @@ konfig-frontends tool (2013-03-25). * configs/twr-k60n512: Converted configurations to use the konfig-frontends tool (2013-03-25). + * arch/arm/src/lpc17xx/lpc17_lcd.c: Add an LCD framebuffer drier + for the LPC177x/8x family. diff --git a/arch/arm/src/lpc17xx/Kconfig b/arch/arm/src/lpc17xx/Kconfig index 82b830a142822200a35a7e6ea03fb2131893fb05..923964dadd0b1352c4760fc33bb09c951135e015 100644 --- a/arch/arm/src/lpc17xx/Kconfig +++ b/arch/arm/src/lpc17xx/Kconfig @@ -654,6 +654,14 @@ config LPC17_LCD_TFTPANEL display panels require the digital color value of each pixel to be applied to the display data inputs. +config LPC17_LCD_MONOCHROME + bool "Monochrome LCD" + default n + depends on !LPC17_LCD_TFTPANEL + ---help--- + STN LCD monochrome/color selection. Selects monochrome LCD. This + selection has no meaning for a TFT panel. + choice prompt "Bits per pixel" default LPC17_LCD_BPP24 if LPC17_LCD_TFTPANEL @@ -673,6 +681,7 @@ config LPC17_LCD_BPP8 config LPC17_LCD_BPP16 bool "16 bit per pixel" + depends on !LPC17_LCD_MONOCHROME config LPC17_LCD_BPP24 bool "24 bit per pixel" @@ -680,9 +689,11 @@ config LPC17_LCD_BPP24 config LPC17_LCD_BPP16_565 bool "16 bpp, 5:6:5 mode" + depends on !LPC17_LCD_MONOCHROME config LPC17_LCD_BPP12_444 bool "12 bpp, 4:4:4 mode" + depends on !LPC17_LCD_MONOCHROME endchoice diff --git a/arch/arm/src/lpc17xx/lpc17_lcd.c b/arch/arm/src/lpc17xx/lpc17_lcd.c index c10d8ade7506305d701b880eeb7d1dd0d14237ea..dccc10404c1f819f6c2e0234539942e64e2f06ce 100644 --- a/arch/arm/src/lpc17xx/lpc17_lcd.c +++ b/arch/arm/src/lpc17xx/lpc17_lcd.c @@ -563,6 +563,30 @@ int up_fbinitialize(void) regval &= ~LCD_CTRL_BGR; putreg32(regval, LPC17_LCD_CTRL); + /* Select monochrome or color LCD */ + +#ifdef CONFIG_LPC17_LCD_MONOCHROME + /* Select monochrome LCD */ + + regval &= ~LCD_CTRL_BGR; + putreg32(regval, LPC17_LCD_CTRL); + + /* Select 4- or 8-bit monochrome interface */ + +#if LPC17_BPP > 4 + regval |= LCD_CTRL_LCDMONO8; +#else + regval &= ~LCD_CTRL_LCDMONO8; +#endif + putreg32(regval, LPC17_LCD_CTRL); + +#else + /* Select color LCD */ + + regval &= ~(LCD_CTRL_LCDBW | LCD_CTRL_LCDMONO8); + putreg32(regval, LPC17_LCD_CTRL); +#endif + /* Little endian byte order */ regval &= ~LCD_CTRL_BEBO; diff --git a/fs/fs_select.c b/fs/fs_select.c index 206e73be03a21d29d224e21cfc8d645eaa08d0ff..2b4fdf5435b3b97bbf2ec3d72555457558977d83 100644 --- a/fs/fs_select.c +++ b/fs/fs_select.c @@ -117,9 +117,9 @@ int select(int nfds, FAR fd_set *readfds, FAR fd_set *writefds, { /* Check if any monitor operation is requested on this fd */ - if (readfds && FD_ISSET(fd, readfds) || - writefds && FD_ISSET(fd, writefds) || - exceptfds && FD_ISSET(fd, exceptfds)) + if ((readfds && FD_ISSET(fd, readfds)) || + (writefds && FD_ISSET(fd, writefds)) || + (exceptfds && FD_ISSET(fd, exceptfds))) { /* Yes.. increment the count of pollfds structures needed */