lvgl / lv_demos

Examples, tutorials and applications for the LVGL embedded GUI library
https://lvgl.io
492 stars 366 forks source link

lvgl.h path #90

Closed C47D closed 3 years ago

C47D commented 3 years ago

There are some includes like this #include "lvgl/lvgl.h", should we update them to:

#ifdef LV_CONF_INCLUDE_SIMPLE
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#endif
C47D commented 3 years ago

Forgot to work on my fork of lv_examples, here's the diff you need to apply:

diff --git a/lv_examples.h b/lv_examples.h
index 7195d36..8d04bbf 100644
--- a/lv_examples.h
+++ b/lv_examples.h
@@ -13,7 +13,7 @@ extern "C" {
 /*********************
  *      INCLUDES
  *********************/
-#if defined(LV_LVGL_H_INCLUDE_SIMPLE)
+#if defined(LV_CONF_INCLUDE_SIMPLE)
 #include "lvgl.h"
 #else
 #include "../lvgl/lvgl.h"
diff --git a/src/lv_demo_music/assets/img_lv_demo_music_btn_play.c b/src/lv_demo_music/assets/img_lv_demo_music_btn_play.c
index b8685b5..88dbeaa 100644
--- a/src/lv_demo_music/assets/img_lv_demo_music_btn_play.c
+++ b/src/lv_demo_music/assets/img_lv_demo_music_btn_play.c
@@ -1,4 +1,9 @@
+#ifdef LV_CONF_INCLUDE_SIMPLE
+#include "lvgl.h"
+#else
 #include "lvgl/lvgl.h"
+#endif
+
 #include "../lv_demo_music.h"
 #if LV_USE_DEMO_MUSIC
kisvegabor commented 3 years ago

LV_LVGL_H_INCLUDE_SIMPLE should be correct here. LV_CONF_INCLUDE_SIMPLE is used only in lv_conf_internal.h.

C47D commented 3 years ago

I see, where's LV_LVGL_H_INCLUDE_SIMPLE defined? We're defining LV_CONF_INCLUDE_SIMPLE in the project configuration, maybe that's why I didn't saw any warning while using it.

kisvegabor commented 3 years ago

I see, where's LV_LVGL_H_INCLUDE_SIMPLE defined?

It should be defined in the project's config file too similarly to LV_CONF_INCLUDE_SIMPLE.

C47D commented 3 years ago

Ok, do you want me to send a PR to fix that in here?

kisvegabor commented 3 years ago

I've just fixed it in img_lv_demo_music_btn_play.c.

C47D commented 3 years ago

Thanks, the lv_port_esp32 repo now builds!