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 2022/08/13 12:36:54 UTC

[incubator-nuttx] 03/03: Adjusting the APA102 driver to refer the buffer from the begining.

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 2234c005d16ad129899868142339ef1e66a27d7e
Author: Tiago Medicci Serrano <ti...@espressif.com>
AuthorDate: Mon Aug 8 10:47:23 2022 -0300

    Adjusting the APA102 driver to refer the buffer from the begining.
---
 drivers/lcd/apa102.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/lcd/apa102.c b/drivers/lcd/apa102.c
index 981ec954ac..5a612872a1 100644
--- a/drivers/lcd/apa102.c
+++ b/drivers/lcd/apa102.c
@@ -505,12 +505,14 @@ static int apa102_putarea(FAR struct lcd_dev_s *dev,
           if (i % 2 == 0)
             {
               priv->fb[(i * APA102_XRES) + j] =
-                rgb565_apa102(*(src + (i * APA102_XRES) + j));
+                rgb565_apa102(*(src + ((i - row_start) * APA102_XRES) +
+                              (j - col_start)));
             }
           else
             {
               priv->fb[(i * APA102_XRES) + APA102_XRES - j - 1] =
-                rgb565_apa102(*(src + (i * APA102_XRES) + j));
+                rgb565_apa102(*(src + ((i - row_start) * APA102_XRES) +
+                              (j - col_start)));
             }
         }
     }