This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git
The following commit(s) were added to refs/heads/master by this push:
new d85cbea Don't copy header outside of LVGL, export LVGL, add README,
fix example
d85cbea is described below
commit d85cbea7f88d654fc7797d96195230e163a76162
Author: Maciej Wójcik <[email protected]>
AuthorDate: Wed Jul 15 14:33:00 2020 +0200
Don't copy header outside of LVGL, export LVGL, add README, fix example
---
examples/lvgldemo/Makefile | 7 ++-----
examples/lvgldemo/fbdev.h | 2 +-
examples/lvgldemo/lvgldemo.c | 2 +-
examples/lvgldemo/tp.h | 2 +-
examples/lvgldemo/tp_cal.c | 2 +-
graphics/lvgl/Make.defs | 10 ++++++++++
graphics/lvgl/Makefile | 11 +----------
graphics/lvgl/README.md | 21 +++++++++++++++++++++
include/graphics/.gitignore | 1 -
9 files changed, 38 insertions(+), 20 deletions(-)
diff --git a/examples/lvgldemo/Makefile b/examples/lvgldemo/Makefile
index d39ee01..f4aecb4 100644
--- a/examples/lvgldemo/Makefile
+++ b/examples/lvgldemo/Makefile
@@ -86,11 +86,8 @@ endif
MAINSRC = lvgldemo.c
-LVGL_SRC_DIR=$(APPDIR)/graphics/lvgl/lvgl
-LVGL_DIR=$(APPDIR)/graphics/lvgl
-
-CFLAGS += ${shell $(INCDIR) "$(CC)" "$(LVGL_SRC_DIR)" "$(LVGL_DIR)"}
-CXXFLAGS += ${shell $(INCDIR) "$(CC)" "$(LVGL_SRC_DIR)" "$(LVGL_DIR)"}
+CFLAGS += ${shell $(DEFINE) "$(CC)" LV_LVGL_H_INCLUDE_SIMPLE}
+CXXFLAGS += ${shell $(DEFINE) "$(CC)" LV_LVGL_H_INCLUDE_SIMPLE}
$(LVGL_EXAMPLES_TARBALL):
@echo "Downloading: $(LVGL_EXAMPLES_TARBALL)"
diff --git a/examples/lvgldemo/fbdev.h b/examples/lvgldemo/fbdev.h
index 00d0d8a..a150785 100644
--- a/examples/lvgldemo/fbdev.h
+++ b/examples/lvgldemo/fbdev.h
@@ -41,7 +41,7 @@
****************************************************************************/
#include <stdint.h>
-#include <graphics/lvgl.h>
+#include <lvgl/lvgl.h>
#ifdef __cplusplus
extern "C"
diff --git a/examples/lvgldemo/lvgldemo.c b/examples/lvgldemo/lvgldemo.c
index 60fe84b..e6f9a79 100644
--- a/examples/lvgldemo/lvgldemo.c
+++ b/examples/lvgldemo/lvgldemo.c
@@ -46,7 +46,7 @@
#include <pthread.h>
#include <time.h>
-#include <graphics/lvgl.h>
+#include <lvgl/lvgl.h>
#include "fbdev.h"
#include "tp.h"
diff --git a/examples/lvgldemo/tp.h b/examples/lvgldemo/tp.h
index ea4ddf2..28b06fa 100644
--- a/examples/lvgldemo/tp.h
+++ b/examples/lvgldemo/tp.h
@@ -41,7 +41,7 @@
****************************************************************************/
#include <nuttx/config.h>
-#include <graphics/lvgl.h>
+#include <lvgl/lvgl.h>
/****************************************************************************
* Pre-processor Definitions
diff --git a/examples/lvgldemo/tp_cal.c b/examples/lvgldemo/tp_cal.c
index ed07965..db96770 100644
--- a/examples/lvgldemo/tp_cal.c
+++ b/examples/lvgldemo/tp_cal.c
@@ -39,7 +39,7 @@
#include <stdio.h>
-#include <graphics/lvgl.h>
+#include <lvgl/lvgl.h>
#include "tp.h"
/****************************************************************************
diff --git a/graphics/lvgl/Make.defs b/graphics/lvgl/Make.defs
index fced7f9..681b8f4 100644
--- a/graphics/lvgl/Make.defs
+++ b/graphics/lvgl/Make.defs
@@ -35,4 +35,14 @@
ifeq ($(CONFIG_GRAPHICS_LVGL),y)
CONFIGURED_APPS += $(APPDIR)/graphics/lvgl
+
+# It allows `<lvgl/lvgl.h>` import.
+
+CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(APPDIR)/graphics/lvgl}
+CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(APPDIR)/graphics/lvgl}
+
+# It allows `<lvgl.h>` import.
+
+CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(APPDIR)/graphics/lvgl/lvgl}
+CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)"
$(APPDIR)/graphics/lvgl/lvgl}
endif
diff --git a/graphics/lvgl/Makefile b/graphics/lvgl/Makefile
index ed6cc8c..ce1cac8 100644
--- a/graphics/lvgl/Makefile
+++ b/graphics/lvgl/Makefile
@@ -66,8 +66,6 @@ UNPACK ?= unzip -o
LVGL_UNPACKDIR = $(WD)/$(LVGL_UNPACKNAME)
-CFLAGS += ${shell $(INCDIR) "$(CC)" $(APPDIR)/graphics/lvgl}
-
$(LVGL_TARBALL):
@echo "Downloading: $(LVGL_TARBALL)"
$(Q) $(WGET) $(CONFIG_GRAPH_LVGL_URL)/$(LVGL_TARBALL)
@@ -78,13 +76,7 @@ $(LVGL_UNPACKNAME): $(LVGL_TARBALL)
$(Q) mv lvgl-$(LVGL_VERSION) $(LVGL_UNPACKNAME)
$(Q) touch $(LVGL_UNPACKNAME)
-lvgl/lvgl.h: $(LVGL_UNPACKNAME)
-
-$(APPDIR)/include/graphics/lvgl.h: lvgl/lvgl.h
- @echo "CP: lvgl/lvgl.h"
- $(Q) cp lvgl/lvgl.h $(APPDIR)/include/graphics/lvgl.h
-
-context:: $(LVGL_UNPACKNAME) $(APPDIR)/include/graphics/lvgl.h
+context:: $(LVGL_UNPACKNAME)
clean::
$(call DELDIR, build)
@@ -92,6 +84,5 @@ clean::
distclean::
$(call DELDIR, $(LVGL_UNPACKNAME))
$(call DELFILE, $(LVGL_TARBALL))
- $(call DELFILE, $(APPDIR)/include/graphics/lvgl.h)
include $(APPDIR)/Application.mk
diff --git a/graphics/lvgl/README.md b/graphics/lvgl/README.md
new file mode 100644
index 0000000..d2fc977
--- /dev/null
+++ b/graphics/lvgl/README.md
@@ -0,0 +1,21 @@
+# Usage
+
+Import with `#include <lvgl/lvgl.h>` or `#include <lvgl.h>`.
+
+Upstream example ported to NuttX is present at `examples/lvgldemo`.
+
+LVGL can be used with framebuffer device. To find example boards with this
+preconfigured, search for `CONFIG_GRAPHICS_LVGL=y` in `defconfig` files.
+All of them have also `CONFIG_VIDEO_FB=y` present.
+
+As a second option, LVGL can talk to a display driver and explicitly draw line
by line.
+For this case, there is no preconfigured board present. Go to _Porting_ section
+of upstream documentation for more hints.
+
+# Resources
+
+* [API documentation with
examples](https://docs.lvgl.io/latest/en/html/index.html)
+* [GitHub / LVGL / LVGL library](https://github.com/lvgl/lvgl)
+* [GitHub / LVGL / Examples, tutorials,
applications](https://github.com/lvgl/lv_examples)
+* [GitHub / LVGL / Desktop
simulator](https://github.com/lvgl/lv_sim_eclipse_sdl)
+* [GitHub / LVGL / Web simulator](https://github.com/lvgl/lv_sim_emscripten)
diff --git a/include/graphics/.gitignore b/include/graphics/.gitignore
deleted file mode 100644
index a3a1545..0000000
--- a/include/graphics/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/lvgl.h