You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2020/11/28 05:39:02 UTC

[incubator-nuttx] 09/24: arch/arm/src/lpc54xx/lpc54_lcd.c: Appease nxstyle

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit a77b402f386ad31d6665c86d82067c26f35808cc
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sat Nov 28 09:37:16 2020 +0900

    arch/arm/src/lpc54xx/lpc54_lcd.c: Appease nxstyle
---
 arch/arm/src/lpc54xx/lpc54_lcd.c | 43 ++++++++++++++++++++++++----------------
 1 file changed, 26 insertions(+), 17 deletions(-)

diff --git a/arch/arm/src/lpc54xx/lpc54_lcd.c b/arch/arm/src/lpc54xx/lpc54_lcd.c
index 0351650..dd68b88 100644
--- a/arch/arm/src/lpc54xx/lpc54_lcd.c
+++ b/arch/arm/src/lpc54xx/lpc54_lcd.c
@@ -275,11 +275,11 @@ static int lpc54_getcmap(FAR struct fb_vtable_s *vtable,
         {
           /* Save the even palette value */
 
-          cmap->red[i+1]    = (rgb & LCD_PAL_R1_MASK) >> LCD_PAL_R1_SHIFT;
-          cmap->green[i+1]  = (rgb & LCD_PAL_G1_MASK) >> LCD_PAL_G1_SHIFT;
-          cmap->blue[i+1]   = (rgb & LCD_PAL_B1_MASK) >> LCD_PAL_B1_SHIFT;
+          cmap->red[i + 1]    = (rgb & LCD_PAL_R1_MASK) >> LCD_PAL_R1_SHIFT;
+          cmap->green[i + 1]  = (rgb & LCD_PAL_G1_MASK) >> LCD_PAL_G1_SHIFT;
+          cmap->blue[i + 1]   = (rgb & LCD_PAL_B1_MASK) >> LCD_PAL_B1_SHIFT;
 #ifdef CONFIG_FB_TRANSPARENCY
-          cmap->transp[i+1] = 0;
+          cmap->transp[i + 1] = 0;
 #endif
         }
     }
@@ -316,7 +316,8 @@ static int lpc54_putcmap(FAR struct fb_vtable_s *vtable,
   if ((i & 1) != 0)
     {
       rgb0  = *pal;
-      rgb0 &= (LCD_PAL_R0_MASK | LCD_PAL_G0_MASK | LCD_PAL_B0_MASK | LCD_PAL_I0);
+      rgb0 &= (LCD_PAL_R0_MASK | LCD_PAL_G0_MASK | LCD_PAL_B0_MASK |
+               LCD_PAL_I0);
       rgb1 |= ((uint32_t)cmap->red[i]   << LCD_PAL_R0_SHIFT |
                (uint32_t)cmap->green[i] << LCD_PAL_G0_SHIFT |
                (uint32_t)cmap->blue[i]  << LCD_PAL_B0_SHIFT);
@@ -340,13 +341,14 @@ static int lpc54_putcmap(FAR struct fb_vtable_s *vtable,
       if ((i + 1) >= last)
         {
           rgb1  = *pal;
-          rgb1 &= (LCD_PAL_R1_MASK | LCD_PAL_G1_MASK | LCD_PAL_B1_MASK | LCD_PAL_I1);
+          rgb1 &= (LCD_PAL_R1_MASK | LCD_PAL_G1_MASK | LCD_PAL_B1_MASK |
+                   LCD_PAL_I1);
         }
       else
         {
-          rgb1  = ((uint32_t)cmap->red[i+1]   << LCD_PAL_R1_SHIFT |
-                   (uint32_t)cmap->green[i+1] << LCD_PAL_G1_SHIFT |
-                   (uint32_t)cmap->blue[i+1]  << LCD_PAL_B1_SHIFT);
+          rgb1  = ((uint32_t)cmap->red[i + 1]   << LCD_PAL_R1_SHIFT |
+                   (uint32_t)cmap->green[i + 1] << LCD_PAL_G1_SHIFT |
+                   (uint32_t)cmap->blue[i + 1]  << LCD_PAL_B1_SHIFT);
         }
 
       /* Save the new palette value */
@@ -408,6 +410,7 @@ static int lpc54_setcursor(FAR struct fb_vtable_s *vtable,
           g_cpos = settings->pos;
           lcdinfo("pos: (h:%d, w:%d)\n", g_cpos.x, g_cpos.y);
         }
+
 #ifdef CONFIG_FB_HWCURSORSIZE
       if ((flags & FB_CUR_SETSIZE) != 0)
         {
@@ -415,6 +418,7 @@ static int lpc54_setcursor(FAR struct fb_vtable_s *vtable,
           lcdinfo("size: (h:%d, w:%d)\n", g_csize.h, g_csize.w);
         }
 #endif
+
 #ifdef CONFIG_FB_HWCURSORIMAGE
       if ((flags & FB_CUR_SETIMAGE) != 0)
         {
@@ -423,6 +427,7 @@ static int lpc54_setcursor(FAR struct fb_vtable_s *vtable,
                   settings->img.image);
         }
 #endif
+
       return OK;
     }
 
@@ -459,6 +464,7 @@ int up_fbinitialize(int display)
   int i;
 
   /* Configure pins */
+
   /* LCD panel data. Pins used depend on the panel configuration:
    *
    * STN  4BPP: VD0-VD3           (single panel)
@@ -468,7 +474,7 @@ int up_fbinitialize(int display)
    * TFT 12BPP: VD4-VD7, VD12-VD15, VD20-VD23
    * TFT 16BPP: VD3-VD7, VD10-VD15, VD19-VD23
    * TFT 24BPP: VD0-VD23
-  */
+   */
 
   lcdinfo("Configuring pins\n");
 
@@ -650,10 +656,10 @@ int up_fbinitialize(int display)
 
   putreg32(0, LPC54_LCD_TIMH);
 
-  regval = (((CONFIG_LPC54_LCD_HWIDTH/16) - 1) << LCD_TIMH_PPL_SHIFT |
-            (CONFIG_LPC54_LCD_HPULSE - 1)      << LCD_TIMH_HSW_SHIFT |
-            (CONFIG_LPC54_LCD_HFRONTPORCH - 1) << LCD_TIMH_HFP_SHIFT |
-            (CONFIG_LPC54_LCD_HBACKPORCH - 1)  << LCD_TIMH_HBP_SHIFT);
+  regval = (((CONFIG_LPC54_LCD_HWIDTH / 16) - 1) << LCD_TIMH_PPL_SHIFT |
+            (CONFIG_LPC54_LCD_HPULSE - 1)        << LCD_TIMH_HSW_SHIFT |
+            (CONFIG_LPC54_LCD_HFRONTPORCH - 1)   << LCD_TIMH_HFP_SHIFT |
+            (CONFIG_LPC54_LCD_HBACKPORCH - 1)    << LCD_TIMH_HBP_SHIFT);
   putreg32(regval, LPC54_LCD_TIMH);
 
   /* Initialize vertical timing */
@@ -800,7 +806,8 @@ int up_fbinitialize(int display)
  *
  * Description:
  *   Return a a reference to the framebuffer object for the specified video
- *   plane of the specified plane.  Many OSDs support multiple planes of video.
+ *   plane of the specified plane.  Many OSDs support multiple planes of
+ *   video.
  *
  * Input Parameters:
  *   display - In the case of hardware with multiple displays, this
@@ -897,14 +904,16 @@ void lpc54_lcdclear(nxgl_mxpixel_t color)
 
   lcdinfo("Clearing display: color=%08x VRAM=%08x size=%d\n",
           color, CONFIG_LPC54_LCD_VRAMBASE,
-          CONFIG_LPC54_LCD_HWIDTH * CONFIG_LPC54_LCD_VHEIGHT * sizeof(uint32_t));
+          CONFIG_LPC54_LCD_HWIDTH * CONFIG_LPC54_LCD_VHEIGHT *
+          sizeof(uint32_t));
 
 #else
   uint16_t *dest = (uint16_t *)CONFIG_LPC54_LCD_VRAMBASE;
 
   lcdinfo("Clearing display: color=%08x VRAM=%08x size=%d\n",
           color, CONFIG_LPC54_LCD_VRAMBASE,
-          CONFIG_LPC54_LCD_HWIDTH * CONFIG_LPC54_LCD_VHEIGHT * sizeof(uint16_t));
+          CONFIG_LPC54_LCD_HWIDTH * CONFIG_LPC54_LCD_VHEIGHT *
+          sizeof(uint16_t));
 #endif
 
   for (i = 0; i < (CONFIG_LPC54_LCD_HWIDTH * CONFIG_LPC54_LCD_VHEIGHT); i++)