You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2021/04/04 19:20:30 UTC

[incubator-nuttx-apps] branch master updated: examples/lvgldemo: Enable build without input methods

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 478a702  examples/lvgldemo: Enable build without input methods
478a702 is described below

commit 478a7027d964455dd77cd502f3359694a6365bc5
Author: Gustavo Henrique Nihei <gu...@espressif.com>
AuthorDate: Wed Mar 31 15:19:47 2021 -0300

    examples/lvgldemo: Enable build without input methods
---
 examples/lvgldemo/Makefile   |  8 ++++++--
 examples/lvgldemo/lvgldemo.c | 14 ++++++++++++++
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/examples/lvgldemo/Makefile b/examples/lvgldemo/Makefile
index 07c8a35..65a8d00 100644
--- a/examples/lvgldemo/Makefile
+++ b/examples/lvgldemo/Makefile
@@ -52,9 +52,13 @@ MODULE = $(CONFIG_EXAMPLES_LVGLDEMO)
 
 # LittleVGL demo Example
 
-CSRCS += fbdev.c lcddev.c tp.c tp_cal.c
+CSRCS += fbdev.c lcddev.c
 
-# static common assets used in mutiple example
+ifneq ($(CONFIG_INPUT),)
+CSRCS += tp.c tp_cal.c
+endif
+
+# static common assets used in multiple examples
 
 LV_EXAMPLE_ASSETS = $(wildcard ./lv_examples/assets/*.c)
 CSRCS += $(notdir $(LV_EXAMPLE_ASSETS))
diff --git a/examples/lvgldemo/lvgldemo.c b/examples/lvgldemo/lvgldemo.c
index 05d4e09..855a2fd 100644
--- a/examples/lvgldemo/lvgldemo.c
+++ b/examples/lvgldemo/lvgldemo.c
@@ -50,9 +50,14 @@
 
 #include "fbdev.h"
 #include "lcddev.h"
+
+#ifdef CONFIG_INPUT
+
 #include "tp.h"
 #include "tp_cal.h"
 
+#endif
+
 /****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
@@ -194,6 +199,8 @@ int main(int argc, FAR char *argv[])
 
   lv_disp_drv_register(&disp_drv);
 
+#ifdef CONFIG_INPUT
+
   /* Touchpad Initialization */
 
   tp_init();
@@ -208,6 +215,8 @@ int main(int argc, FAR char *argv[])
   indev_drv.read_cb = tp_read;
   lv_indev_drv_register(&indev_drv);
 
+#endif
+
 #if defined(CONFIG_EXAMPLES_LVGLDEMO_BENCHMARK)
   lv_demo_benchmark();
 #elif defined(CONFIG_EXAMPLES_LVGLDEMO_PRINTER)
@@ -218,6 +227,8 @@ int main(int argc, FAR char *argv[])
   lv_demo_widgets();
 #endif
 
+#ifdef CONFIG_INPUT
+
   /* Start TP calibration */
 
 #ifdef CONFIG_EXAMPLES_LVGLDEMO_CALIBRATE
@@ -225,6 +236,9 @@ int main(int argc, FAR char *argv[])
 #else
   tp_set_cal_values(p, p + 1, p + 2, p + 3);
 #endif
+
+#endif
+
   /* Handle LVGL tasks */
 
   while (1)