You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/07/21 12:41:27 UTC

[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6657: drivers/lcd/st7789: update putarea() method

pkarashchenko commented on code in PR #6657:
URL: https://github.com/apache/incubator-nuttx/pull/6657#discussion_r926626523


##########
drivers/lcd/st7789.c:
##########
@@ -554,15 +564,16 @@ static int st7789_putarea(FAR struct lcd_dev_s *dev,
 {
   FAR struct st7789_dev_s *priv = (FAR struct st7789_dev_s *)dev;
   FAR const uint16_t *src = (FAR const uint16_t *)buffer;
+  fb_coord_t bsiz = col_end - col_start + 1;
 
   ginfo("row_start: %d row_end: %d col_start: %d col_end: %d\n",
          row_start, row_end, col_start, col_end);
 
   DEBUGASSERT(buffer && ((uintptr_t)buffer & 1) == 0);
 
   st7789_setarea(priv, col_start, row_start, col_end, row_end);
-  st7789_wrram(priv, src,
-               (row_end - row_start + 1) * (col_end - col_start + 1));
+  st7789_wrram(priv, src + (ST7789_XRES * row_start) + col_start,
+      bsiz, ST7789_XRES - bsiz, row_end - row_start + 1);

Review Comment:
   ```suggestion
     st7789_wrram(priv, src + (ST7789_XRES * row_start) + col_start,
                  bsiz, ST7789_XRES - bsiz, row_end - row_start + 1);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org