From d85cbea7f88d654fc7797d96195230e163a76162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20W=C3=B3jcik?= Date: Wed, 15 Jul 2020 14:33:00 +0200 Subject: [PATCH] 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(-) create mode 100644 graphics/lvgl/README.md delete mode 100644 include/graphics/.gitignore diff --git a/examples/lvgldemo/Makefile b/examples/lvgldemo/Makefile index d39ee0138..f4aecb4fd 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 00d0d8aa6..a150785ad 100644 --- a/examples/lvgldemo/fbdev.h +++ b/examples/lvgldemo/fbdev.h @@ -41,7 +41,7 @@ ****************************************************************************/ #include -#include +#include #ifdef __cplusplus extern "C" diff --git a/examples/lvgldemo/lvgldemo.c b/examples/lvgldemo/lvgldemo.c index 60fe84b9e..e6f9a79d5 100644 --- a/examples/lvgldemo/lvgldemo.c +++ b/examples/lvgldemo/lvgldemo.c @@ -46,7 +46,7 @@ #include #include -#include +#include #include "fbdev.h" #include "tp.h" diff --git a/examples/lvgldemo/tp.h b/examples/lvgldemo/tp.h index ea4ddf207..28b06fa7e 100644 --- a/examples/lvgldemo/tp.h +++ b/examples/lvgldemo/tp.h @@ -41,7 +41,7 @@ ****************************************************************************/ #include -#include +#include /**************************************************************************** * Pre-processor Definitions diff --git a/examples/lvgldemo/tp_cal.c b/examples/lvgldemo/tp_cal.c index ed079651d..db96770d3 100644 --- a/examples/lvgldemo/tp_cal.c +++ b/examples/lvgldemo/tp_cal.c @@ -39,7 +39,7 @@ #include -#include +#include #include "tp.h" /**************************************************************************** diff --git a/graphics/lvgl/Make.defs b/graphics/lvgl/Make.defs index fced7f941..681b8f4fa 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 `` import. + +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(APPDIR)/graphics/lvgl} +CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(APPDIR)/graphics/lvgl} + +# It allows `` 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 ed6cc8ca1..ce1cac80a 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 000000000..d2fc977ca --- /dev/null +++ b/graphics/lvgl/README.md @@ -0,0 +1,21 @@ +# Usage + +Import with `#include ` or `#include `. + +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 a3a154576..000000000 --- a/include/graphics/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/lvgl.h