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 2021/02/16 06:12:33 UTC

[GitHub] [incubator-nuttx-apps] btashton opened a new pull request #591: lvgldemo: Add support for lcddev

btashton opened a new pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591


   ## Summary
   This provides an adaptor for using lvgl with the lcddev in addition to the fbdev. As part of this it also fixes a compilation error when fbdev was used with CONFIG_FB_UPDATE.  There is also a monitoring callback enabled for monitoring the performance of the demo.
   
   ## Impact
   lvgldemo can now be used without requiring a framebuffer to be created.
   
   ## Testing
   You can see the demo running on my keyboard feather using the lcddev here (ignore the terrible refresh rate, that is due to the 8MHz SPI bus and DMA limitations I am addressing):
   ```
   NuttShell (NSH) NuttX-10.0.1
   nsh> lvgldemo
   VideoInfo:
         fmt: 11
        xres: 240
        yres: 320
     nplanes: 1
   PlaneInfo (plane 0):
         bpp: 16
   tp_init: Opening /dev/input0
   76800 px refreshed in 2250 ms
   ```
   ![image](https://user-images.githubusercontent.com/173245/108024988-803d8080-6fda-11eb-93d8-d64a6ea72a53.png)
   
   
   


----------------------------------------------------------------
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.

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



[GitHub] [incubator-nuttx-apps] acassis commented on pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
acassis commented on pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#issuecomment-800111125


   ping @btashton 


----------------------------------------------------------------
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.

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



[GitHub] [incubator-nuttx-apps] gustavonihei commented on a change in pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#discussion_r603273374



##########
File path: examples/lvgldemo/lvgldemo.c
##########
@@ -89,6 +91,25 @@ void lv_demo_widgets(void);
  * Private Functions
  ****************************************************************************/
 
+/****************************************************************************
+ * Name: monitor_cb
+ *
+ * Description:
+ *   Monitoring callback from lvgl every time the screen is flushed.
+ *
+ ****************************************************************************/
+
+static void monitor_cb(lv_disp_drv_t * disp_drv, uint32_t time, uint32_t px)
+{
+  ginfo("%" PRIu32 " px refreshed in %" PRIu32 " ms\n", px, time);
+}
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+lv_color_t buf[DISPLAY_BUFFER_SIZE];

Review comment:
       ```suggestion
   static lv_color_t buf[DISPLAY_BUFFER_SIZE];
   ```
   This buffer does not need to have external linkage.

##########
File path: examples/lvgldemo/lvgldemo.c
##########
@@ -153,16 +172,29 @@ int main(int argc, FAR char *argv[])
 
   lv_init();
 
-  /* Display interface initialization */
-
-  fbdev_init();
-
   /* Basic LittlevGL display driver initialization */

Review comment:
       ```suggestion
     /* Basic LVGL display driver initialization */
   ```




-- 
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.

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



[GitHub] [incubator-nuttx-apps] gustavonihei commented on a change in pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#discussion_r603270445



##########
File path: examples/lvgldemo/lcddev.c
##########
@@ -0,0 +1,198 @@
+/****************************************************************************
+ * apps/examples/lvgldemo/lcddev.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include "lcddev.h"
+
+#include <nuttx/config.h>
+#include <nuttx/lcd/lcd_dev.h>
+
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <debug.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifndef LCDDEV_PATH
+#  define LCDDEV_PATH  "/dev/lcd0"
+#endif
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct lcd_state_s
+{
+  int fd;
+  struct fb_videoinfo_s vinfo;
+  struct lcd_planeinfo_s pinfo;
+  bool rotated;
+};
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static struct lcd_state_s state;
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_flush
+ *
+ * Description:
+ *   Flush a buffer to the marked area
+ *
+ * Input Parameters:
+ *   x1      - Left coordinate
+ *   y1      - Top coordinate
+ *   x2      - Right coordinate
+ *   y2      - Bottom coordinate
+ *   color_p - A n array of colors

Review comment:
       ```suggestion
    *   disp_drv  - LVGL driver interface
    *   lv_area_t - Area of the screen to be flushed
    *   color_p   - A n array of colors
   ```




-- 
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.

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



[GitHub] [incubator-nuttx-apps] gustavonihei commented on a change in pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#discussion_r603274649



##########
File path: examples/lvgldemo/lvgldemo.c
##########
@@ -45,10 +45,12 @@
 #include <stdio.h>
 #include <pthread.h>

Review comment:
       ```suggestion
   ```
   This header is not referenced in this file and may be removed.




-- 
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.

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



[GitHub] [incubator-nuttx-apps] btashton commented on pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
btashton commented on pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#issuecomment-779719760


   Hmm there are some important changes in mine that are not in that implemention both for the framebuffer and lcd driver. How do you want to bring these together then? 


----------------------------------------------------------------
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.

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



[GitHub] [incubator-nuttx-apps] gustavonihei commented on a change in pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#discussion_r603271276



##########
File path: examples/lvgldemo/lcddev.c
##########
@@ -0,0 +1,198 @@
+/****************************************************************************
+ * apps/examples/lvgldemo/lcddev.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include "lcddev.h"
+
+#include <nuttx/config.h>
+#include <nuttx/lcd/lcd_dev.h>
+
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <debug.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifndef LCDDEV_PATH
+#  define LCDDEV_PATH  "/dev/lcd0"
+#endif
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct lcd_state_s
+{
+  int fd;
+  struct fb_videoinfo_s vinfo;
+  struct lcd_planeinfo_s pinfo;
+  bool rotated;
+};
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static struct lcd_state_s state;
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_flush
+ *
+ * Description:
+ *   Flush a buffer to the marked area
+ *
+ * Input Parameters:
+ *   x1      - Left coordinate
+ *   y1      - Top coordinate
+ *   x2      - Right coordinate
+ *   y2      - Bottom coordinate
+ *   color_p - A n array of colors
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+static void lcddev_flush(struct _disp_drv_t *disp_drv, const lv_area_t *area,
+                         lv_color_t *color_p)
+{
+  int ret;
+  struct lcddev_area_s lcd_area;
+
+  lcd_area.row_start = area->y1;
+  lcd_area.row_end = area->y2;
+  lcd_area.col_start = area->x1;
+  lcd_area.col_end = area->x2;
+
+  lcd_area.data = (uint8_t *)color_p;
+
+  ret = ioctl(state.fd, LCDDEVIO_PUTAREA,
+              (unsigned long)((uintptr_t)&lcd_area));
+
+  if (ret < 0)
+    {
+      int errcode = errno;
+
+      gerr("ERROR: ioctl(LCDDEVIO_PUTAREA) failed: %d\n",
+           errcode);
+      close(state.fd);
+      return;
+    }
+
+  /* Tell the flushing is ready */
+
+  lv_disp_flush_ready(disp_drv);
+}
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_init
+ *
+ * Description:

Review comment:
       ```suggestion
    * Description:
    *   Initialize LCD device.
   ```




-- 
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.

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



[GitHub] [incubator-nuttx-apps] gustavonihei commented on a change in pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#discussion_r603438384



##########
File path: examples/lvgldemo/lcddev.c
##########
@@ -0,0 +1,197 @@
+/****************************************************************************
+ * apps/examples/lvgldemo/lcddev.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include "lcddev.h"
+
+#include <nuttx/config.h>
+#include <nuttx/lcd/lcd_dev.h>
+
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <debug.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifndef LCDDEV_PATH
+#  define LCDDEV_PATH  "/dev/lcd0"
+#endif
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct lcd_state_s
+{
+  int fd;
+  struct fb_videoinfo_s vinfo;
+  struct lcd_planeinfo_s pinfo;
+  bool rotated;
+};
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static struct lcd_state_s state;
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_flush
+ *
+ * Description:
+ *   Flush a buffer to the marked area.
+ *
+ * Input Parameters:
+ *   disp_drv  - LVGL driver interface
+ *   lv_area_t - Area of the screen to be flushed
+ *   color_p   - A n array of colors
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+static void lcddev_flush(struct _disp_drv_t *disp_drv, const lv_area_t *area,
+                         lv_color_t *color_p)
+{
+  int ret;
+  struct lcddev_area_s lcd_area;
+
+  lcd_area.row_start = area->y1;
+  lcd_area.row_end = area->y2;
+  lcd_area.col_start = area->x1;
+  lcd_area.col_end = area->x2;
+
+  lcd_area.data = (uint8_t *)color_p;
+
+  ret = ioctl(state.fd, LCDDEVIO_PUTAREA,
+              (unsigned long)((uintptr_t)&lcd_area));
+
+  if (ret < 0)
+    {
+      int errcode = errno;
+
+      gerr("ERROR: ioctl(LCDDEVIO_PUTAREA) failed: %d\n",
+           errcode);
+      close(state.fd);
+      return;
+    }
+
+  /* Tell the flushing is ready */
+
+  lv_disp_flush_ready(disp_drv);
+}
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_init
+ *
+ * Description:
+ *   Initialize LCD device.
+ *
+ * Input Parameters:
+ *   lv_drvr -- LVGL driver interface
+ *
+ * Returned Value:
+ *   EXIT_SUCCESS on success; EXIT_FAILURE on failure.
+ *
+ ****************************************************************************/
+
+int lcddev_init(lv_disp_drv_t *lv_drvr)
+{
+  FAR const char *lcddev = LCDDEV_PATH;
+  int ret;
+
+  /* Open the framebuffer driver */
+
+  state.fd = open(lcddev, 0);
+  if (state.fd < 0)
+    {
+      int errcode = errno;
+      gerr("ERROR: Failed to open %s: %d\n", state.fd, errcode);
+      return EXIT_FAILURE;
+    }
+
+  /* Get the characteristics of the framebuffer */

Review comment:
       This is one was not resolved yet.




-- 
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.

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



[GitHub] [incubator-nuttx-apps] gustavonihei commented on a change in pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#discussion_r603270445



##########
File path: examples/lvgldemo/lcddev.c
##########
@@ -0,0 +1,198 @@
+/****************************************************************************
+ * apps/examples/lvgldemo/lcddev.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include "lcddev.h"
+
+#include <nuttx/config.h>
+#include <nuttx/lcd/lcd_dev.h>
+
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <debug.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifndef LCDDEV_PATH
+#  define LCDDEV_PATH  "/dev/lcd0"
+#endif
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct lcd_state_s
+{
+  int fd;
+  struct fb_videoinfo_s vinfo;
+  struct lcd_planeinfo_s pinfo;
+  bool rotated;
+};
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static struct lcd_state_s state;
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_flush
+ *
+ * Description:
+ *   Flush a buffer to the marked area
+ *
+ * Input Parameters:
+ *   x1      - Left coordinate
+ *   y1      - Top coordinate
+ *   x2      - Right coordinate
+ *   y2      - Bottom coordinate
+ *   color_p - A n array of colors

Review comment:
       ```suggestion
    *   disp_drv  - LVGL driver interface
    *   lv_area_t - Area of the screen to be flushed
    *   color_p   - A n array of colors
   ```
   Fix function documentation.




-- 
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.

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



[GitHub] [incubator-nuttx-apps] gustavonihei commented on a change in pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#discussion_r596061574



##########
File path: examples/lvgldemo/lvgldemo.c
##########
@@ -89,6 +90,25 @@ void lv_demo_widgets(void);
  * Private Functions
  ****************************************************************************/
 
+/****************************************************************************
+ * Name: monitor_cb
+ *
+ * Description:
+ *   Monitoring callback from lvgl every time the screen is flushed.

Review comment:
       ```suggestion
    *   Monitoring callback from LVGL every time the screen is flushed.
   ```




-- 
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.

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



[GitHub] [incubator-nuttx-apps] btashton commented on pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
btashton commented on pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#issuecomment-779645418


   Build passed. This failed on an unrelated breakage in sim with nimble.


----------------------------------------------------------------
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.

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



[GitHub] [incubator-nuttx-apps] gustavonihei commented on a change in pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#discussion_r596061574



##########
File path: examples/lvgldemo/lvgldemo.c
##########
@@ -89,6 +90,25 @@ void lv_demo_widgets(void);
  * Private Functions
  ****************************************************************************/
 
+/****************************************************************************
+ * Name: monitor_cb
+ *
+ * Description:
+ *   Monitoring callback from lvgl every time the screen is flushed.

Review comment:
       ```suggestion
    *   Monitoring callback from LVGL every time the screen is flushed.
   ```
   ```suggestion
    *   Monitoring callback from lvgl every time the screen is flushed.
   ```




----------------------------------------------------------------
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.

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



[GitHub] [incubator-nuttx-apps] gustavonihei commented on a change in pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#discussion_r596062019



##########
File path: examples/lvgldemo/lvgldemo.c
##########
@@ -89,6 +90,25 @@ void lv_demo_widgets(void);
  * Private Functions
  ****************************************************************************/
 
+/****************************************************************************
+ * Name: monitor_cb
+ *
+ * Description:
+ *   Monitoring callback from lvgl every time the screen is flushed.
+ *
+ ****************************************************************************/
+
+static void monitor_cb(lv_disp_drv_t * disp_drv, uint32_t time, uint32_t px)
+{
+  printf("%" PRIu32 " px refreshed in %" PRIu32 " ms\n", px, time);

Review comment:
       Could you change this printf to use our logging macros?




----------------------------------------------------------------
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.

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



[GitHub] [incubator-nuttx-apps] btashton commented on pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
btashton commented on pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#issuecomment-808960851


   > It is reporting an issue on mkfatfs:
   > 
   > ```
   > In file included from mkfatfs.c:32:
   > mkfatfs.c: In function 'mkfatfs_getgeometry':
   > Error: mkfatfs.c:156:16: error: format '%zu' expects argument of type 'size_t', but argument 4 has type 'blkcnt_t' {aka 'long unsigned int'} [-Werror=format=]
   >   156 |           ferr("ERROR: User maxblocks (%" PRId32
   >       |                ^~~~~~~~~~~~~~~~~~~~~~~~~~
   >   157 |                ") exceeds blocks on device (%zu)\n",
   >   158 |                fmt->ff_nsectors, geometry.geo_nsectors);
   >       |                                  ~~~~~~~~~~~~~~~~~~~~~
   >       |                                          |
   >       |                                          blkcnt_t {aka long unsigned int}
   > mkfatfs.c:157:47: note: format string is defined here
   >   157 |                ") exceeds blocks on device (%zu)\n",
   >       |                                             ~~^
   >       |                                               |
   >       |                                               unsigned int
   >       |                                             %lu
   > cc1: all warnings being treated as errors
   > make[3]: *** [/github/workspace/sources/apps/Application.mk:134: mkfatfs.github.workspace.sources.apps.fsutils.mkfatfs.o] Error 1
   > make[3]: Target 'all' not remade because of errors.
   > make[2]: *** [Makefile:59: /github/workspace/sources/apps/fsutils/mkfatfs_all] Error 2
   > make[2]: Target '/github/workspace/sources/apps/libapps.a' not remade because of errors.
   > make[1]: *** [Makefile:53: all] Error 2
   > make: *** [tools/LibTargets.mk:210: /github/workspace/sources/apps/libapps.a] Error 2
   > make: Target 'all' not remade because of errors.
   > /github/workspace/sources/nuttx/tools/testbuild.sh: line 252: /github/workspace/sources/nuttx/../nuttx/nuttx.manifest: No such file or directory
   >   Normalize stm3210e-eval/nsh
   > ====================================================================================
   > Configuration/Tool: stm3210e-eval/usbserial,CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL
   > ------------------------------------------------------------------------------------
   > ```
   
   This is unrelated to my changes here, I expect it to go away now that I have rebased.


-- 
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.

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



[GitHub] [incubator-nuttx-apps] acassis commented on pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
acassis commented on pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#issuecomment-799418267


   It is reporting an issue on mkfatfs:
   ```
   In file included from mkfatfs.c:32:
   mkfatfs.c: In function 'mkfatfs_getgeometry':
   Error: mkfatfs.c:156:16: error: format '%zu' expects argument of type 'size_t', but argument 4 has type 'blkcnt_t' {aka 'long unsigned int'} [-Werror=format=]
     156 |           ferr("ERROR: User maxblocks (%" PRId32
         |                ^~~~~~~~~~~~~~~~~~~~~~~~~~
     157 |                ") exceeds blocks on device (%zu)\n",
     158 |                fmt->ff_nsectors, geometry.geo_nsectors);
         |                                  ~~~~~~~~~~~~~~~~~~~~~
         |                                          |
         |                                          blkcnt_t {aka long unsigned int}
   mkfatfs.c:157:47: note: format string is defined here
     157 |                ") exceeds blocks on device (%zu)\n",
         |                                             ~~^
         |                                               |
         |                                               unsigned int
         |                                             %lu
   cc1: all warnings being treated as errors
   make[3]: *** [/github/workspace/sources/apps/Application.mk:134: mkfatfs.github.workspace.sources.apps.fsutils.mkfatfs.o] Error 1
   make[3]: Target 'all' not remade because of errors.
   make[2]: *** [Makefile:59: /github/workspace/sources/apps/fsutils/mkfatfs_all] Error 2
   make[2]: Target '/github/workspace/sources/apps/libapps.a' not remade because of errors.
   make[1]: *** [Makefile:53: all] Error 2
   make: *** [tools/LibTargets.mk:210: /github/workspace/sources/apps/libapps.a] Error 2
   make: Target 'all' not remade because of errors.
   /github/workspace/sources/nuttx/tools/testbuild.sh: line 252: /github/workspace/sources/nuttx/../nuttx/nuttx.manifest: No such file or directory
     Normalize stm3210e-eval/nsh
   ====================================================================================
   Configuration/Tool: stm3210e-eval/usbserial,CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL
   ------------------------------------------------------------------------------------
   ```


----------------------------------------------------------------
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.

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



[GitHub] [incubator-nuttx-apps] btashton commented on a change in pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
btashton commented on a change in pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#discussion_r603408704



##########
File path: examples/lvgldemo/lvgldemo.c
##########
@@ -153,16 +172,29 @@ int main(int argc, FAR char *argv[])
 
   lv_init();
 
-  /* Display interface initialization */
-
-  fbdev_init();
-
   /* Basic LittlevGL display driver initialization */

Review comment:
       The projects name is LittlevGL not LVGL, but for consistency I have changed it.




-- 
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.

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



[GitHub] [incubator-nuttx-apps] gustavonihei commented on a change in pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#discussion_r596063455



##########
File path: examples/lvgldemo/lcddev.c
##########
@@ -0,0 +1,200 @@
+/****************************************************************************
+ * apps/examples/lvgldemo/lcddev.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include "lcddev.h"
+
+#include <nuttx/config.h>
+#include <nuttx/lcd/lcd_dev.h>
+
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifndef LCDDEV_PATH
+#  define LCDDEV_PATH  "/dev/lcd0"
+#endif
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct lcd_state_s
+{
+  int fd;
+  struct fb_videoinfo_s vinfo;
+  struct lcd_planeinfo_s pinfo;
+  bool rotated;
+};
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static struct lcd_state_s state;
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_flush
+ *
+ * Description:
+ *   Flush a buffer to the marked area
+ *
+ * Input Parameters:
+ *   x1      - Left coordinate
+ *   y1      - Top coordinate
+ *   x2      - Right coordinate
+ *   y2      - Bottom coordinate
+ *   color_p - A n array of colors
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+static void lcddev_flush(struct _disp_drv_t *disp_drv, const lv_area_t *area,
+                         lv_color_t *color_p)
+{
+  int ret;
+  struct lcddev_area_s lcd_area;
+
+  lcd_area.row_start = area->y1;
+  lcd_area.row_end = area->y2;
+  lcd_area.col_start = area->x1;
+  lcd_area.col_end = area->x2;
+
+  lcd_area.data = (uint8_t *)color_p;
+
+  ret = ioctl(state.fd, LCDDEVIO_PUTAREA,
+              (unsigned long)((uintptr_t)&lcd_area));
+
+  if (ret < 0)
+    {
+      int errcode = errno;
+
+      fprintf(stderr, "ERROR: ioctl(LCDDEVIO_PUTAREA) failed: %d\n",
+              errcode);
+      close(state.fd);
+      return;
+    }
+
+  /* Tell the flushing is ready */
+
+  lv_disp_flush_ready(disp_drv);
+}
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_init
+ *
+ * Description:
+ *
+ * Input Parameters:
+ *   lv_drvr -- lvgl driver interface
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+int lcddev_init(lv_disp_drv_t *lv_drvr)
+{
+  FAR const char *fbdev = LCDDEV_PATH;
+  int ret;
+
+  /* Open the framebuffer driver */

Review comment:
       ```suggestion
     /* Open the LCD driver */
   ```

##########
File path: examples/lvgldemo/lcddev.c
##########
@@ -0,0 +1,200 @@
+/****************************************************************************
+ * apps/examples/lvgldemo/lcddev.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include "lcddev.h"
+
+#include <nuttx/config.h>
+#include <nuttx/lcd/lcd_dev.h>
+
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifndef LCDDEV_PATH
+#  define LCDDEV_PATH  "/dev/lcd0"
+#endif
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct lcd_state_s
+{
+  int fd;
+  struct fb_videoinfo_s vinfo;
+  struct lcd_planeinfo_s pinfo;
+  bool rotated;
+};
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static struct lcd_state_s state;
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_flush
+ *
+ * Description:
+ *   Flush a buffer to the marked area
+ *
+ * Input Parameters:
+ *   x1      - Left coordinate
+ *   y1      - Top coordinate
+ *   x2      - Right coordinate
+ *   y2      - Bottom coordinate
+ *   color_p - A n array of colors
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+static void lcddev_flush(struct _disp_drv_t *disp_drv, const lv_area_t *area,
+                         lv_color_t *color_p)
+{
+  int ret;
+  struct lcddev_area_s lcd_area;
+
+  lcd_area.row_start = area->y1;
+  lcd_area.row_end = area->y2;
+  lcd_area.col_start = area->x1;
+  lcd_area.col_end = area->x2;
+
+  lcd_area.data = (uint8_t *)color_p;
+
+  ret = ioctl(state.fd, LCDDEVIO_PUTAREA,
+              (unsigned long)((uintptr_t)&lcd_area));
+
+  if (ret < 0)
+    {
+      int errcode = errno;
+
+      fprintf(stderr, "ERROR: ioctl(LCDDEVIO_PUTAREA) failed: %d\n",
+              errcode);
+      close(state.fd);
+      return;
+    }
+
+  /* Tell the flushing is ready */
+
+  lv_disp_flush_ready(disp_drv);
+}
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_init
+ *
+ * Description:
+ *
+ * Input Parameters:
+ *   lv_drvr -- lvgl driver interface
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+int lcddev_init(lv_disp_drv_t *lv_drvr)
+{
+  FAR const char *fbdev = LCDDEV_PATH;

Review comment:
       ```suggestion
     FAR const char *lcddev = LCDDEV_PATH;
   ```

##########
File path: examples/lvgldemo/lcddev.c
##########
@@ -0,0 +1,200 @@
+/****************************************************************************
+ * apps/examples/lvgldemo/lcddev.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include "lcddev.h"
+
+#include <nuttx/config.h>
+#include <nuttx/lcd/lcd_dev.h>
+
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifndef LCDDEV_PATH
+#  define LCDDEV_PATH  "/dev/lcd0"
+#endif
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct lcd_state_s
+{
+  int fd;
+  struct fb_videoinfo_s vinfo;
+  struct lcd_planeinfo_s pinfo;
+  bool rotated;
+};
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static struct lcd_state_s state;
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_flush
+ *
+ * Description:
+ *   Flush a buffer to the marked area
+ *
+ * Input Parameters:
+ *   x1      - Left coordinate
+ *   y1      - Top coordinate
+ *   x2      - Right coordinate
+ *   y2      - Bottom coordinate
+ *   color_p - A n array of colors
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+static void lcddev_flush(struct _disp_drv_t *disp_drv, const lv_area_t *area,
+                         lv_color_t *color_p)
+{
+  int ret;
+  struct lcddev_area_s lcd_area;
+
+  lcd_area.row_start = area->y1;
+  lcd_area.row_end = area->y2;
+  lcd_area.col_start = area->x1;
+  lcd_area.col_end = area->x2;
+
+  lcd_area.data = (uint8_t *)color_p;
+
+  ret = ioctl(state.fd, LCDDEVIO_PUTAREA,
+              (unsigned long)((uintptr_t)&lcd_area));
+
+  if (ret < 0)
+    {
+      int errcode = errno;
+
+      fprintf(stderr, "ERROR: ioctl(LCDDEVIO_PUTAREA) failed: %d\n",
+              errcode);
+      close(state.fd);
+      return;
+    }
+
+  /* Tell the flushing is ready */
+
+  lv_disp_flush_ready(disp_drv);
+}
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_init
+ *
+ * Description:
+ *
+ * Input Parameters:
+ *   lv_drvr -- lvgl driver interface
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+int lcddev_init(lv_disp_drv_t *lv_drvr)
+{
+  FAR const char *fbdev = LCDDEV_PATH;
+  int ret;
+
+  /* Open the framebuffer driver */
+
+  state.fd = open(fbdev, 0);
+  if (state.fd < 0)
+    {
+      int errcode = errno;
+      fprintf(stderr, "ERROR: Failed to open %s: %d\n", state.fd, errcode);
+      return EXIT_FAILURE;
+    }
+
+  /* Get the characteristics of the framebuffer */

Review comment:
       ```suggestion
     /* Get the characteristics of the LCD device */
   ```




----------------------------------------------------------------
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.

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



[GitHub] [incubator-nuttx-apps] gustavonihei commented on a change in pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#discussion_r603435358



##########
File path: examples/lvgldemo/lvgldemo.c
##########
@@ -153,16 +172,29 @@ int main(int argc, FAR char *argv[])
 
   lv_init();
 
-  /* Display interface initialization */
-
-  fbdev_init();
-
   /* Basic LittlevGL display driver initialization */

Review comment:
       Indeed, they announced the renaming of the project on Release 7.0:
   https://blog.lvgl.io/2020-06-01/announcement




-- 
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.

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



[GitHub] [incubator-nuttx-apps] gustavonihei commented on a change in pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#discussion_r596061383



##########
File path: examples/lvgldemo/lcddev.c
##########
@@ -0,0 +1,200 @@
+/****************************************************************************
+ * apps/examples/lvgldemo/lcddev.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include "lcddev.h"
+
+#include <nuttx/config.h>
+#include <nuttx/lcd/lcd_dev.h>
+
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifndef LCDDEV_PATH
+#  define LCDDEV_PATH  "/dev/lcd0"
+#endif
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct lcd_state_s
+{
+  int fd;
+  struct fb_videoinfo_s vinfo;
+  struct lcd_planeinfo_s pinfo;
+  bool rotated;
+};
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static struct lcd_state_s state;
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_flush
+ *
+ * Description:
+ *   Flush a buffer to the marked area
+ *
+ * Input Parameters:
+ *   x1      - Left coordinate
+ *   y1      - Top coordinate
+ *   x2      - Right coordinate
+ *   y2      - Bottom coordinate
+ *   color_p - A n array of colors
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+static void lcddev_flush(struct _disp_drv_t *disp_drv, const lv_area_t *area,
+                         lv_color_t *color_p)
+{
+  int ret;
+  struct lcddev_area_s lcd_area;
+
+  lcd_area.row_start = area->y1;
+  lcd_area.row_end = area->y2;
+  lcd_area.col_start = area->x1;
+  lcd_area.col_end = area->x2;
+
+  lcd_area.data = (uint8_t *)color_p;
+
+  ret = ioctl(state.fd, LCDDEVIO_PUTAREA,
+              (unsigned long)((uintptr_t)&lcd_area));
+
+  if (ret < 0)
+    {
+      int errcode = errno;
+
+      fprintf(stderr, "ERROR: ioctl(LCDDEVIO_PUTAREA) failed: %d\n",
+              errcode);
+      close(state.fd);
+      return;
+    }
+
+  /* Tell the flushing is ready */
+
+  lv_disp_flush_ready(disp_drv);
+}
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_init
+ *
+ * Description:
+ *
+ * Input Parameters:
+ *   lv_drvr -- lvgl driver interface
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+int lcddev_init(lv_disp_drv_t *lv_drvr)
+{
+  FAR const char *fbdev = LCDDEV_PATH;
+  int ret;
+
+  /* Open the framebuffer driver */
+
+  state.fd = open(fbdev, 0);
+  if (state.fd < 0)
+    {
+      int errcode = errno;
+      fprintf(stderr, "ERROR: Failed to open %s: %d\n", state.fd, errcode);
+      return EXIT_FAILURE;
+    }
+
+  /* Get the characteristics of the framebuffer */
+
+  ret = ioctl(state.fd, LCDDEVIO_GETVIDEOINFO,
+              (unsigned long)((uintptr_t)&state.vinfo));
+  if (ret < 0)
+    {
+      int errcode = errno;
+
+      fprintf(stderr, "ERROR: ioctl(LCDDEVIO_GETVIDEOINFO) failed: %d\n",
+              errcode);
+      close(state.fd);
+      return EXIT_FAILURE;
+    }
+
+  printf("VideoInfo:\n");
+  printf("      fmt: %u\n", state.vinfo.fmt);
+  printf("     xres: %u\n", state.vinfo.xres);
+  printf("     yres: %u\n", state.vinfo.yres);
+  printf("  nplanes: %u\n", state.vinfo.nplanes);
+
+  ret = ioctl(state.fd, LCDDEVIO_GETPLANEINFO,
+              (unsigned long)((uintptr_t)&state.pinfo));
+  if (ret < 0)
+    {
+      int errcode = errno;
+      fprintf(stderr, "ERROR: ioctl(LCDDEVIO_GETPLANEINFO) failed: %d\n",
+              errcode);
+      close(state.fd);
+      return EXIT_FAILURE;
+    }
+
+  printf("PlaneInfo (plane 0):\n");
+  printf("      bpp: %u\n", state.pinfo.bpp);
+
+  if (state.pinfo.bpp != CONFIG_LV_COLOR_DEPTH)
+    {
+      /* For the LCD driver we do not have a geat way to translate this

Review comment:
       ```suggestion
         /* For the LCD driver we do not have a great way to translate this
   ```




----------------------------------------------------------------
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.

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



[GitHub] [incubator-nuttx-apps] gustavonihei commented on a change in pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#discussion_r603268847



##########
File path: examples/lvgldemo/lvgldemo.c
##########
@@ -89,6 +90,25 @@ void lv_demo_widgets(void);
  * Private Functions
  ****************************************************************************/
 
+/****************************************************************************
+ * Name: monitor_cb
+ *
+ * Description:
+ *   Monitoring callback from lvgl every time the screen is flushed.

Review comment:
       Although marked as resolved, it has not been addressed.

##########
File path: examples/lvgldemo/lcddev.c
##########
@@ -0,0 +1,200 @@
+/****************************************************************************
+ * apps/examples/lvgldemo/lcddev.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include "lcddev.h"
+
+#include <nuttx/config.h>
+#include <nuttx/lcd/lcd_dev.h>
+
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifndef LCDDEV_PATH
+#  define LCDDEV_PATH  "/dev/lcd0"
+#endif
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct lcd_state_s
+{
+  int fd;
+  struct fb_videoinfo_s vinfo;
+  struct lcd_planeinfo_s pinfo;
+  bool rotated;
+};
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static struct lcd_state_s state;
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_flush
+ *
+ * Description:
+ *   Flush a buffer to the marked area
+ *
+ * Input Parameters:
+ *   x1      - Left coordinate
+ *   y1      - Top coordinate
+ *   x2      - Right coordinate
+ *   y2      - Bottom coordinate
+ *   color_p - A n array of colors
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+static void lcddev_flush(struct _disp_drv_t *disp_drv, const lv_area_t *area,
+                         lv_color_t *color_p)
+{
+  int ret;
+  struct lcddev_area_s lcd_area;
+
+  lcd_area.row_start = area->y1;
+  lcd_area.row_end = area->y2;
+  lcd_area.col_start = area->x1;
+  lcd_area.col_end = area->x2;
+
+  lcd_area.data = (uint8_t *)color_p;
+
+  ret = ioctl(state.fd, LCDDEVIO_PUTAREA,
+              (unsigned long)((uintptr_t)&lcd_area));
+
+  if (ret < 0)
+    {
+      int errcode = errno;
+
+      fprintf(stderr, "ERROR: ioctl(LCDDEVIO_PUTAREA) failed: %d\n",
+              errcode);
+      close(state.fd);
+      return;
+    }
+
+  /* Tell the flushing is ready */
+
+  lv_disp_flush_ready(disp_drv);
+}
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_init
+ *
+ * Description:
+ *
+ * Input Parameters:
+ *   lv_drvr -- lvgl driver interface
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+int lcddev_init(lv_disp_drv_t *lv_drvr)
+{
+  FAR const char *fbdev = LCDDEV_PATH;
+  int ret;
+
+  /* Open the framebuffer driver */
+
+  state.fd = open(fbdev, 0);
+  if (state.fd < 0)
+    {
+      int errcode = errno;
+      fprintf(stderr, "ERROR: Failed to open %s: %d\n", state.fd, errcode);
+      return EXIT_FAILURE;
+    }
+
+  /* Get the characteristics of the framebuffer */

Review comment:
       Although marked as resolved, it has not been addressed.

##########
File path: examples/lvgldemo/lcddev.c
##########
@@ -0,0 +1,200 @@
+/****************************************************************************
+ * apps/examples/lvgldemo/lcddev.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include "lcddev.h"
+
+#include <nuttx/config.h>
+#include <nuttx/lcd/lcd_dev.h>
+
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifndef LCDDEV_PATH
+#  define LCDDEV_PATH  "/dev/lcd0"
+#endif
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct lcd_state_s
+{
+  int fd;
+  struct fb_videoinfo_s vinfo;
+  struct lcd_planeinfo_s pinfo;
+  bool rotated;
+};
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static struct lcd_state_s state;
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_flush
+ *
+ * Description:
+ *   Flush a buffer to the marked area
+ *
+ * Input Parameters:
+ *   x1      - Left coordinate
+ *   y1      - Top coordinate
+ *   x2      - Right coordinate
+ *   y2      - Bottom coordinate
+ *   color_p - A n array of colors
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+static void lcddev_flush(struct _disp_drv_t *disp_drv, const lv_area_t *area,
+                         lv_color_t *color_p)
+{
+  int ret;
+  struct lcddev_area_s lcd_area;
+
+  lcd_area.row_start = area->y1;
+  lcd_area.row_end = area->y2;
+  lcd_area.col_start = area->x1;
+  lcd_area.col_end = area->x2;
+
+  lcd_area.data = (uint8_t *)color_p;
+
+  ret = ioctl(state.fd, LCDDEVIO_PUTAREA,
+              (unsigned long)((uintptr_t)&lcd_area));
+
+  if (ret < 0)
+    {
+      int errcode = errno;
+
+      fprintf(stderr, "ERROR: ioctl(LCDDEVIO_PUTAREA) failed: %d\n",
+              errcode);
+      close(state.fd);
+      return;
+    }
+
+  /* Tell the flushing is ready */
+
+  lv_disp_flush_ready(disp_drv);
+}
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_init
+ *
+ * Description:
+ *
+ * Input Parameters:
+ *   lv_drvr -- lvgl driver interface
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+int lcddev_init(lv_disp_drv_t *lv_drvr)
+{
+  FAR const char *fbdev = LCDDEV_PATH;
+  int ret;
+
+  /* Open the framebuffer driver */

Review comment:
       Although marked as resolved, it has not been addressed.

##########
File path: examples/lvgldemo/lcddev.c
##########
@@ -0,0 +1,200 @@
+/****************************************************************************
+ * apps/examples/lvgldemo/lcddev.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include "lcddev.h"
+
+#include <nuttx/config.h>
+#include <nuttx/lcd/lcd_dev.h>
+
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifndef LCDDEV_PATH
+#  define LCDDEV_PATH  "/dev/lcd0"
+#endif
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct lcd_state_s
+{
+  int fd;
+  struct fb_videoinfo_s vinfo;
+  struct lcd_planeinfo_s pinfo;
+  bool rotated;
+};
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static struct lcd_state_s state;
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_flush
+ *
+ * Description:
+ *   Flush a buffer to the marked area
+ *
+ * Input Parameters:
+ *   x1      - Left coordinate
+ *   y1      - Top coordinate
+ *   x2      - Right coordinate
+ *   y2      - Bottom coordinate
+ *   color_p - A n array of colors
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+static void lcddev_flush(struct _disp_drv_t *disp_drv, const lv_area_t *area,
+                         lv_color_t *color_p)
+{
+  int ret;
+  struct lcddev_area_s lcd_area;
+
+  lcd_area.row_start = area->y1;
+  lcd_area.row_end = area->y2;
+  lcd_area.col_start = area->x1;
+  lcd_area.col_end = area->x2;
+
+  lcd_area.data = (uint8_t *)color_p;
+
+  ret = ioctl(state.fd, LCDDEVIO_PUTAREA,
+              (unsigned long)((uintptr_t)&lcd_area));
+
+  if (ret < 0)
+    {
+      int errcode = errno;
+
+      fprintf(stderr, "ERROR: ioctl(LCDDEVIO_PUTAREA) failed: %d\n",
+              errcode);
+      close(state.fd);

Review comment:
       Although marked as resolved, it has not been addressed.




-- 
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.

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



[GitHub] [incubator-nuttx-apps] acassis merged pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
acassis merged pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591


   


-- 
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.

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



[GitHub] [incubator-nuttx-apps] btashton edited a comment on pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
btashton edited a comment on pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#issuecomment-779719760


   Hmm there are some important changes in mine that are not in that implemention both for the framebuffer and lcd driver. How do you want to bring these together then?  I did not know about that PR, but it has also has not moved in a couple weeks. 


----------------------------------------------------------------
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.

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



[GitHub] [incubator-nuttx-apps] btashton commented on pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
btashton commented on pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#issuecomment-809525583


   Sorry... A lot of these are repeated and from the original code and so I searched and must have missed a few. I'll try and update later. 


-- 
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.

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



[GitHub] [incubator-nuttx-apps] btashton commented on pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
btashton commented on pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#issuecomment-808960700


   I think all the comments should be resolved now.


-- 
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.

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



[GitHub] [incubator-nuttx-apps] gustavonihei commented on a change in pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#discussion_r596064267



##########
File path: examples/lvgldemo/lcddev.c
##########
@@ -0,0 +1,200 @@
+/****************************************************************************
+ * apps/examples/lvgldemo/lcddev.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include "lcddev.h"
+
+#include <nuttx/config.h>
+#include <nuttx/lcd/lcd_dev.h>
+
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifndef LCDDEV_PATH
+#  define LCDDEV_PATH  "/dev/lcd0"
+#endif
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct lcd_state_s
+{
+  int fd;
+  struct fb_videoinfo_s vinfo;
+  struct lcd_planeinfo_s pinfo;
+  bool rotated;
+};
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static struct lcd_state_s state;
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_flush
+ *
+ * Description:
+ *   Flush a buffer to the marked area
+ *
+ * Input Parameters:
+ *   x1      - Left coordinate
+ *   y1      - Top coordinate
+ *   x2      - Right coordinate
+ *   y2      - Bottom coordinate
+ *   color_p - A n array of colors
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+static void lcddev_flush(struct _disp_drv_t *disp_drv, const lv_area_t *area,
+                         lv_color_t *color_p)
+{
+  int ret;
+  struct lcddev_area_s lcd_area;
+
+  lcd_area.row_start = area->y1;
+  lcd_area.row_end = area->y2;
+  lcd_area.col_start = area->x1;
+  lcd_area.col_end = area->x2;
+
+  lcd_area.data = (uint8_t *)color_p;
+
+  ret = ioctl(state.fd, LCDDEVIO_PUTAREA,
+              (unsigned long)((uintptr_t)&lcd_area));
+
+  if (ret < 0)
+    {
+      int errcode = errno;
+
+      fprintf(stderr, "ERROR: ioctl(LCDDEVIO_PUTAREA) failed: %d\n",
+              errcode);
+      close(state.fd);
+      return;
+    }
+
+  /* Tell the flushing is ready */
+
+  lv_disp_flush_ready(disp_drv);
+}
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_init
+ *
+ * Description:
+ *
+ * Input Parameters:
+ *   lv_drvr -- lvgl driver interface

Review comment:
       ```suggestion
    *   lv_drvr -- LVGL driver interface
   ```




----------------------------------------------------------------
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.

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



[GitHub] [incubator-nuttx-apps] xiaoxiang781216 commented on pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#issuecomment-779787240


   > Hmm there are some important changes in mine that are not in that implemention both for the framebuffer and lcd driver. How do you want to bring these together then? I did not know about that PR, but it has also has not moved in a couple weeks.
   
   If your version have more functionality, we can base on yours.
   BTW, the upcoming v8 version will merge lvgldemo into the main repo:
   https://github.com/lvgl/lvgl/issues/1852
   So NuttX specific stuff need to move to grahpics/lvgl too.


----------------------------------------------------------------
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.

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



[GitHub] [incubator-nuttx-apps] gustavonihei commented on a change in pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#discussion_r603273550



##########
File path: examples/lvgldemo/lvgldemo.c
##########
@@ -153,16 +172,29 @@ int main(int argc, FAR char *argv[])
 
   lv_init();
 
-  /* Display interface initialization */
-
-  fbdev_init();
-
   /* Basic LittlevGL display driver initialization */

Review comment:
       ```suggestion
     /* Basic LVGL display driver initialization */
   ```
   On line 171 there is another `LittlevGL` reference that should be fixed.




-- 
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.

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



[GitHub] [incubator-nuttx-apps] btashton commented on pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
btashton commented on pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#issuecomment-809492792


   > Some of my previous comments were not addressed. Also there some other minor issues that may be fixed to improve the overall code quality.
   
   Sorry about that.  I think they are all covered now.


-- 
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.

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



[GitHub] [incubator-nuttx-apps] gustavonihei commented on a change in pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#discussion_r603272893



##########
File path: examples/lvgldemo/lcddev.c
##########
@@ -0,0 +1,198 @@
+/****************************************************************************
+ * apps/examples/lvgldemo/lcddev.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include "lcddev.h"
+
+#include <nuttx/config.h>
+#include <nuttx/lcd/lcd_dev.h>
+
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <debug.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifndef LCDDEV_PATH
+#  define LCDDEV_PATH  "/dev/lcd0"
+#endif
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct lcd_state_s
+{
+  int fd;
+  struct fb_videoinfo_s vinfo;
+  struct lcd_planeinfo_s pinfo;
+  bool rotated;
+};
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static struct lcd_state_s state;
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_flush
+ *
+ * Description:
+ *   Flush a buffer to the marked area

Review comment:
       ```suggestion
    *   Flush a buffer to the marked area.
   ```




-- 
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.

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



[GitHub] [incubator-nuttx-apps] gustavonihei commented on pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#issuecomment-809523960


   > > Some of my previous comments were not addressed. Also there some other minor issues that may be fixed to improve the overall code quality.
   > 
   > Sorry about that. I think they are all covered now.
   
   No problem.
   There are still some left, I've commented again in those places.
   


-- 
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.

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



[GitHub] [incubator-nuttx-apps] gustavonihei commented on a change in pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#discussion_r603438521



##########
File path: examples/lvgldemo/lcddev.c
##########
@@ -0,0 +1,197 @@
+/****************************************************************************
+ * apps/examples/lvgldemo/lcddev.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include "lcddev.h"
+
+#include <nuttx/config.h>
+#include <nuttx/lcd/lcd_dev.h>
+
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <debug.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifndef LCDDEV_PATH
+#  define LCDDEV_PATH  "/dev/lcd0"
+#endif
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct lcd_state_s
+{
+  int fd;
+  struct fb_videoinfo_s vinfo;
+  struct lcd_planeinfo_s pinfo;
+  bool rotated;
+};
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static struct lcd_state_s state;
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_flush
+ *
+ * Description:
+ *   Flush a buffer to the marked area.
+ *
+ * Input Parameters:
+ *   disp_drv  - LVGL driver interface
+ *   lv_area_t - Area of the screen to be flushed
+ *   color_p   - A n array of colors
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+static void lcddev_flush(struct _disp_drv_t *disp_drv, const lv_area_t *area,
+                         lv_color_t *color_p)
+{
+  int ret;
+  struct lcddev_area_s lcd_area;
+
+  lcd_area.row_start = area->y1;
+  lcd_area.row_end = area->y2;
+  lcd_area.col_start = area->x1;
+  lcd_area.col_end = area->x2;
+
+  lcd_area.data = (uint8_t *)color_p;
+
+  ret = ioctl(state.fd, LCDDEVIO_PUTAREA,
+              (unsigned long)((uintptr_t)&lcd_area));
+
+  if (ret < 0)
+    {
+      int errcode = errno;
+
+      gerr("ERROR: ioctl(LCDDEVIO_PUTAREA) failed: %d\n",
+           errcode);
+      close(state.fd);
+      return;
+    }
+
+  /* Tell the flushing is ready */
+
+  lv_disp_flush_ready(disp_drv);
+}
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_init
+ *
+ * Description:
+ *   Initialize LCD device.
+ *
+ * Input Parameters:
+ *   lv_drvr -- LVGL driver interface
+ *
+ * Returned Value:
+ *   EXIT_SUCCESS on success; EXIT_FAILURE on failure.
+ *
+ ****************************************************************************/
+
+int lcddev_init(lv_disp_drv_t *lv_drvr)
+{
+  FAR const char *lcddev = LCDDEV_PATH;
+  int ret;
+
+  /* Open the framebuffer driver */

Review comment:
       This is one was not resolved yet.

##########
File path: examples/lvgldemo/lcddev.c
##########
@@ -0,0 +1,197 @@
+/****************************************************************************
+ * apps/examples/lvgldemo/lcddev.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include "lcddev.h"
+
+#include <nuttx/config.h>
+#include <nuttx/lcd/lcd_dev.h>
+
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <debug.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifndef LCDDEV_PATH
+#  define LCDDEV_PATH  "/dev/lcd0"
+#endif
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct lcd_state_s
+{
+  int fd;
+  struct fb_videoinfo_s vinfo;
+  struct lcd_planeinfo_s pinfo;
+  bool rotated;
+};
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static struct lcd_state_s state;
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_flush
+ *
+ * Description:
+ *   Flush a buffer to the marked area.
+ *
+ * Input Parameters:
+ *   disp_drv  - LVGL driver interface
+ *   lv_area_t - Area of the screen to be flushed
+ *   color_p   - A n array of colors
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+static void lcddev_flush(struct _disp_drv_t *disp_drv, const lv_area_t *area,
+                         lv_color_t *color_p)
+{
+  int ret;
+  struct lcddev_area_s lcd_area;
+
+  lcd_area.row_start = area->y1;
+  lcd_area.row_end = area->y2;
+  lcd_area.col_start = area->x1;
+  lcd_area.col_end = area->x2;
+
+  lcd_area.data = (uint8_t *)color_p;
+
+  ret = ioctl(state.fd, LCDDEVIO_PUTAREA,
+              (unsigned long)((uintptr_t)&lcd_area));
+
+  if (ret < 0)
+    {
+      int errcode = errno;
+
+      gerr("ERROR: ioctl(LCDDEVIO_PUTAREA) failed: %d\n",
+           errcode);
+      close(state.fd);

Review comment:
       This is one was not resolved yet.




-- 
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.

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



[GitHub] [incubator-nuttx-apps] xiaoxiang781216 edited a comment on pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 edited a comment on pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#issuecomment-779787240


   > Hmm there are some important changes in mine that are not in that implemention both for the framebuffer and lcd driver. How do you want to bring these together then? I did not know about that PR, but it has also has not moved in a couple weeks.
   
   If your version have more functionality, we can base on yours.
   BTW, the upcoming v8 version will merge lvgldemo into the main repo:
   https://github.com/lvgl/lvgl/issues/1852
   So NuttX specific stuff need to move into grahpics/lvgl too.
   v8 has many exciting feature(Kconfig, grid and flex layout, and more), we are working with @kisvegabor closely to upgrade the new version as soon as possible.


----------------------------------------------------------------
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.

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



[GitHub] [incubator-nuttx-apps] btashton commented on a change in pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
btashton commented on a change in pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#discussion_r603423670



##########
File path: examples/lvgldemo/lvgldemo.c
##########
@@ -153,16 +172,29 @@ int main(int argc, FAR char *argv[])
 
   lv_init();
 
-  /* Display interface initialization */
-
-  fbdev_init();
-
   /* Basic LittlevGL display driver initialization */

Review comment:
       Interesting the front page of the docs still refer to it as LittlevGL anyway I changed it to LVGL everywhere so it is consistent. 




-- 
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.

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



[GitHub] [incubator-nuttx-apps] v01d commented on a change in pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
v01d commented on a change in pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#discussion_r603430909



##########
File path: examples/lvgldemo/lvgldemo.c
##########
@@ -153,16 +172,29 @@ int main(int argc, FAR char *argv[])
 
   lv_init();
 
-  /* Display interface initialization */
-
-  fbdev_init();
-
   /* Basic LittlevGL display driver initialization */

Review comment:
       I think they redefined the acronym to "Light and Versatile Graphics Library"




-- 
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.

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



[GitHub] [incubator-nuttx-apps] gustavonihei commented on a change in pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#discussion_r603272679



##########
File path: examples/lvgldemo/lcddev.c
##########
@@ -0,0 +1,198 @@
+/****************************************************************************
+ * apps/examples/lvgldemo/lcddev.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include "lcddev.h"
+
+#include <nuttx/config.h>
+#include <nuttx/lcd/lcd_dev.h>
+
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <debug.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifndef LCDDEV_PATH
+#  define LCDDEV_PATH  "/dev/lcd0"
+#endif
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct lcd_state_s
+{
+  int fd;
+  struct fb_videoinfo_s vinfo;
+  struct lcd_planeinfo_s pinfo;
+  bool rotated;
+};
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static struct lcd_state_s state;
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_flush
+ *
+ * Description:
+ *   Flush a buffer to the marked area
+ *
+ * Input Parameters:
+ *   x1      - Left coordinate
+ *   y1      - Top coordinate
+ *   x2      - Right coordinate
+ *   y2      - Bottom coordinate
+ *   color_p - A n array of colors
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+static void lcddev_flush(struct _disp_drv_t *disp_drv, const lv_area_t *area,
+                         lv_color_t *color_p)
+{
+  int ret;
+  struct lcddev_area_s lcd_area;
+
+  lcd_area.row_start = area->y1;
+  lcd_area.row_end = area->y2;
+  lcd_area.col_start = area->x1;
+  lcd_area.col_end = area->x2;
+
+  lcd_area.data = (uint8_t *)color_p;
+
+  ret = ioctl(state.fd, LCDDEVIO_PUTAREA,
+              (unsigned long)((uintptr_t)&lcd_area));
+
+  if (ret < 0)
+    {
+      int errcode = errno;
+
+      gerr("ERROR: ioctl(LCDDEVIO_PUTAREA) failed: %d\n",
+           errcode);
+      close(state.fd);
+      return;
+    }
+
+  /* Tell the flushing is ready */
+
+  lv_disp_flush_ready(disp_drv);
+}
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_init
+ *
+ * Description:
+ *
+ * Input Parameters:
+ *   lv_drvr -- LVGL driver interface
+ *
+ * Returned Value:
+ *   None

Review comment:
       ```suggestion
    *   EXIT_SUCCESS on success; EXIT_FAILURE on failure.
   ```




-- 
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.

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



[GitHub] [incubator-nuttx-apps] xiaoxiang781216 commented on pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#issuecomment-779712668


   lcd driver duplicate with this: https://github.com/apache/incubator-nuttx-apps/pull/580


----------------------------------------------------------------
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.

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



[GitHub] [incubator-nuttx-apps] gustavonihei commented on a change in pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#discussion_r596065916



##########
File path: examples/lvgldemo/lcddev.c
##########
@@ -0,0 +1,200 @@
+/****************************************************************************
+ * apps/examples/lvgldemo/lcddev.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include "lcddev.h"
+
+#include <nuttx/config.h>
+#include <nuttx/lcd/lcd_dev.h>
+
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifndef LCDDEV_PATH
+#  define LCDDEV_PATH  "/dev/lcd0"
+#endif
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct lcd_state_s
+{
+  int fd;
+  struct fb_videoinfo_s vinfo;
+  struct lcd_planeinfo_s pinfo;
+  bool rotated;
+};
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static struct lcd_state_s state;
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_flush
+ *
+ * Description:
+ *   Flush a buffer to the marked area
+ *
+ * Input Parameters:
+ *   x1      - Left coordinate
+ *   y1      - Top coordinate
+ *   x2      - Right coordinate
+ *   y2      - Bottom coordinate
+ *   color_p - A n array of colors
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+static void lcddev_flush(struct _disp_drv_t *disp_drv, const lv_area_t *area,
+                         lv_color_t *color_p)
+{
+  int ret;
+  struct lcddev_area_s lcd_area;
+
+  lcd_area.row_start = area->y1;
+  lcd_area.row_end = area->y2;
+  lcd_area.col_start = area->x1;
+  lcd_area.col_end = area->x2;
+
+  lcd_area.data = (uint8_t *)color_p;
+
+  ret = ioctl(state.fd, LCDDEVIO_PUTAREA,
+              (unsigned long)((uintptr_t)&lcd_area));
+
+  if (ret < 0)
+    {
+      int errcode = errno;
+
+      fprintf(stderr, "ERROR: ioctl(LCDDEVIO_PUTAREA) failed: %d\n",
+              errcode);
+      close(state.fd);

Review comment:
       ```suggestion
         close(state.fd);
         state.fd = -1;
   ```
   Since the file descriptor is now invalid, it is safer to also reset its value.




----------------------------------------------------------------
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.

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



[GitHub] [incubator-nuttx-apps] gustavonihei commented on a change in pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#discussion_r596062019



##########
File path: examples/lvgldemo/lvgldemo.c
##########
@@ -89,6 +90,25 @@ void lv_demo_widgets(void);
  * Private Functions
  ****************************************************************************/
 
+/****************************************************************************
+ * Name: monitor_cb
+ *
+ * Description:
+ *   Monitoring callback from lvgl every time the screen is flushed.
+ *
+ ****************************************************************************/
+
+static void monitor_cb(lv_disp_drv_t * disp_drv, uint32_t time, uint32_t px)
+{
+  printf("%" PRIu32 " px refreshed in %" PRIu32 " ms\n", px, time);

Review comment:
       Could you change this printf to use our logging macros? Keeping it as a printf will be too verbose.




----------------------------------------------------------------
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.

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



[GitHub] [incubator-nuttx-apps] v01d commented on a change in pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
v01d commented on a change in pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#discussion_r603419396



##########
File path: examples/lvgldemo/lvgldemo.c
##########
@@ -153,16 +172,29 @@ int main(int argc, FAR char *argv[])
 
   lv_init();
 
-  /* Display interface initialization */
-
-  fbdev_init();
-
   /* Basic LittlevGL display driver initialization */

Review comment:
       I think they recently renamed to LVGL




-- 
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.

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



[GitHub] [incubator-nuttx-apps] gustavonihei commented on a change in pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#discussion_r603275613



##########
File path: examples/lvgldemo/lvgldemo.c
##########
@@ -153,16 +172,29 @@ int main(int argc, FAR char *argv[])
 
   lv_init();
 
-  /* Display interface initialization */
-
-  fbdev_init();
-
   /* Basic LittlevGL display driver initialization */
 
   lv_disp_buf_init(&disp_buf, buf, NULL, DISPLAY_BUFFER_SIZE);
   lv_disp_drv_init(&disp_drv);
-  disp_drv.flush_cb = fbdev_flush;
   disp_drv.buffer = &disp_buf;
+  disp_drv.monitor_cb = monitor_cb;
+
+  /* Display interface initialization */
+
+  if (fbdev_init(&disp_drv) != EXIT_SUCCESS)
+    {
+      /* Failed to use framebuffer falling back to lcd driver */
+
+      if (lcddev_init(&disp_drv) != EXIT_SUCCESS)
+        {
+          /* No possible drivers left, fail */
+
+          return EXIT_FAILURE;
+        }
+    }
+
+  /* Basic LittlevGL display driver initialization */

Review comment:
       ```suggestion
   ```
   Repeated documentation, may be removed.




-- 
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.

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



[GitHub] [incubator-nuttx-apps] acassis commented on pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
acassis commented on pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#issuecomment-811090733


   @btashton I will merge it now, then you submit small fixes later, lets to avoid forcing the CI even further!


-- 
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.

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



[GitHub] [incubator-nuttx-apps] xiaoxiang781216 edited a comment on pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 edited a comment on pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#issuecomment-779787240


   > Hmm there are some important changes in mine that are not in that implemention both for the framebuffer and lcd driver. How do you want to bring these together then? I did not know about that PR, but it has also has not moved in a couple weeks.
   
   If your version have more functionality, we can base on yours.
   BTW, the upcoming v8 version will merge lvgldemo into the main repo:
   https://github.com/lvgl/lvgl/issues/1852
   So all NuttX specific stuff need to move into grahpics/lvgl too.
   v8 has many exciting feature(Kconfig, grid and flex layout, and more), we are working with @kisvegabor closely to upgrade the new version as soon as possible.


----------------------------------------------------------------
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.

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



[GitHub] [incubator-nuttx-apps] gustavonihei commented on a change in pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#discussion_r596063602



##########
File path: examples/lvgldemo/lcddev.c
##########
@@ -0,0 +1,200 @@
+/****************************************************************************
+ * apps/examples/lvgldemo/lcddev.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include "lcddev.h"
+
+#include <nuttx/config.h>
+#include <nuttx/lcd/lcd_dev.h>
+
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifndef LCDDEV_PATH
+#  define LCDDEV_PATH  "/dev/lcd0"
+#endif
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct lcd_state_s
+{
+  int fd;
+  struct fb_videoinfo_s vinfo;
+  struct lcd_planeinfo_s pinfo;
+  bool rotated;
+};
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static struct lcd_state_s state;
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_flush
+ *
+ * Description:
+ *   Flush a buffer to the marked area
+ *
+ * Input Parameters:
+ *   x1      - Left coordinate
+ *   y1      - Top coordinate
+ *   x2      - Right coordinate
+ *   y2      - Bottom coordinate
+ *   color_p - A n array of colors
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+static void lcddev_flush(struct _disp_drv_t *disp_drv, const lv_area_t *area,
+                         lv_color_t *color_p)
+{
+  int ret;
+  struct lcddev_area_s lcd_area;
+
+  lcd_area.row_start = area->y1;
+  lcd_area.row_end = area->y2;
+  lcd_area.col_start = area->x1;
+  lcd_area.col_end = area->x2;
+
+  lcd_area.data = (uint8_t *)color_p;
+
+  ret = ioctl(state.fd, LCDDEVIO_PUTAREA,
+              (unsigned long)((uintptr_t)&lcd_area));
+
+  if (ret < 0)
+    {
+      int errcode = errno;
+
+      fprintf(stderr, "ERROR: ioctl(LCDDEVIO_PUTAREA) failed: %d\n",
+              errcode);
+      close(state.fd);
+      return;
+    }
+
+  /* Tell the flushing is ready */
+
+  lv_disp_flush_ready(disp_drv);
+}
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_init
+ *
+ * Description:
+ *
+ * Input Parameters:
+ *   lv_drvr -- lvgl driver interface
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+int lcddev_init(lv_disp_drv_t *lv_drvr)
+{
+  FAR const char *fbdev = LCDDEV_PATH;

Review comment:
       ```suggestion
     FAR const char *lcddev = LCDDEV_PATH;
   ```
   ```suggestion
     FAR const char *fbdev = LCDDEV_PATH;
   ```




----------------------------------------------------------------
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.

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



[GitHub] [incubator-nuttx-apps] gustavonihei commented on a change in pull request #591: lvgldemo: Add support for lcddev

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #591:
URL: https://github.com/apache/incubator-nuttx-apps/pull/591#discussion_r596063350



##########
File path: examples/lvgldemo/lcddev.c
##########
@@ -0,0 +1,200 @@
+/****************************************************************************
+ * apps/examples/lvgldemo/lcddev.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include "lcddev.h"
+
+#include <nuttx/config.h>
+#include <nuttx/lcd/lcd_dev.h>
+
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifndef LCDDEV_PATH
+#  define LCDDEV_PATH  "/dev/lcd0"
+#endif
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct lcd_state_s
+{
+  int fd;
+  struct fb_videoinfo_s vinfo;
+  struct lcd_planeinfo_s pinfo;
+  bool rotated;
+};
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static struct lcd_state_s state;
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_flush
+ *
+ * Description:
+ *   Flush a buffer to the marked area
+ *
+ * Input Parameters:
+ *   x1      - Left coordinate
+ *   y1      - Top coordinate
+ *   x2      - Right coordinate
+ *   y2      - Bottom coordinate
+ *   color_p - A n array of colors
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+static void lcddev_flush(struct _disp_drv_t *disp_drv, const lv_area_t *area,
+                         lv_color_t *color_p)
+{
+  int ret;
+  struct lcddev_area_s lcd_area;
+
+  lcd_area.row_start = area->y1;
+  lcd_area.row_end = area->y2;
+  lcd_area.col_start = area->x1;
+  lcd_area.col_end = area->x2;
+
+  lcd_area.data = (uint8_t *)color_p;
+
+  ret = ioctl(state.fd, LCDDEVIO_PUTAREA,
+              (unsigned long)((uintptr_t)&lcd_area));
+
+  if (ret < 0)
+    {
+      int errcode = errno;
+
+      fprintf(stderr, "ERROR: ioctl(LCDDEVIO_PUTAREA) failed: %d\n",
+              errcode);
+      close(state.fd);
+      return;
+    }
+
+  /* Tell the flushing is ready */
+
+  lv_disp_flush_ready(disp_drv);
+}
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_init
+ *
+ * Description:
+ *
+ * Input Parameters:
+ *   lv_drvr -- lvgl driver interface
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+int lcddev_init(lv_disp_drv_t *lv_drvr)
+{
+  FAR const char *fbdev = LCDDEV_PATH;
+  int ret;
+
+  /* Open the framebuffer driver */
+
+  state.fd = open(fbdev, 0);
+  if (state.fd < 0)
+    {
+      int errcode = errno;
+      fprintf(stderr, "ERROR: Failed to open %s: %d\n", state.fd, errcode);
+      return EXIT_FAILURE;
+    }
+
+  /* Get the characteristics of the framebuffer */

Review comment:
       ```suggestion
     /* Get the characteristics of the LCD device */
   ```
   ```suggestion
     /* Get the characteristics of the framebuffer */
   ```

##########
File path: examples/lvgldemo/lcddev.c
##########
@@ -0,0 +1,200 @@
+/****************************************************************************
+ * apps/examples/lvgldemo/lcddev.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include "lcddev.h"
+
+#include <nuttx/config.h>
+#include <nuttx/lcd/lcd_dev.h>
+
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifndef LCDDEV_PATH
+#  define LCDDEV_PATH  "/dev/lcd0"
+#endif
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct lcd_state_s
+{
+  int fd;
+  struct fb_videoinfo_s vinfo;
+  struct lcd_planeinfo_s pinfo;
+  bool rotated;
+};
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static struct lcd_state_s state;
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_flush
+ *
+ * Description:
+ *   Flush a buffer to the marked area
+ *
+ * Input Parameters:
+ *   x1      - Left coordinate
+ *   y1      - Top coordinate
+ *   x2      - Right coordinate
+ *   y2      - Bottom coordinate
+ *   color_p - A n array of colors
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+static void lcddev_flush(struct _disp_drv_t *disp_drv, const lv_area_t *area,
+                         lv_color_t *color_p)
+{
+  int ret;
+  struct lcddev_area_s lcd_area;
+
+  lcd_area.row_start = area->y1;
+  lcd_area.row_end = area->y2;
+  lcd_area.col_start = area->x1;
+  lcd_area.col_end = area->x2;
+
+  lcd_area.data = (uint8_t *)color_p;
+
+  ret = ioctl(state.fd, LCDDEVIO_PUTAREA,
+              (unsigned long)((uintptr_t)&lcd_area));
+
+  if (ret < 0)
+    {
+      int errcode = errno;
+
+      fprintf(stderr, "ERROR: ioctl(LCDDEVIO_PUTAREA) failed: %d\n",
+              errcode);
+      close(state.fd);
+      return;
+    }
+
+  /* Tell the flushing is ready */
+
+  lv_disp_flush_ready(disp_drv);
+}
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lcddev_init
+ *
+ * Description:
+ *
+ * Input Parameters:
+ *   lv_drvr -- lvgl driver interface
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+int lcddev_init(lv_disp_drv_t *lv_drvr)
+{
+  FAR const char *fbdev = LCDDEV_PATH;
+  int ret;
+
+  /* Open the framebuffer driver */

Review comment:
       ```suggestion
     /* Open the LCD driver */
   ```
   ```suggestion
     /* Open the framebuffer driver */
   ```




----------------------------------------------------------------
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.

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