Code Monkey home page Code Monkey logo

Comments (9)

roddehugo avatar roddehugo commented on June 8, 2024 1

TL;DR: looks good to me although I have not tested it yet. You can consider this issue resolve from my perspective. Thanks for your support.

I am actually working with master here for a professional project I am involved in. It is actually the beginning of it and you will likely hear from me again :)

I have not checked the rework-7 branch yet, only a quick glance to not couple my code too closed to the 6.1.2 as 7.0 is coming.

As far as I can see, with both 474dc1f0 and 5fd053b8, it should fix the issues I have encountered. It achieves the same result as in my branch compared to master.

I can live we the fix on my branch for the time being as I understand it is not worth the pain of future conflicts when merging rework-7.

from lv_demos.

kisvegabor avatar kisvegabor commented on June 8, 2024

Hi,

You are right, it was accidentally removed.

I've just added back this functionality. Could you try it?

from lv_demos.

jozba avatar jozba commented on June 8, 2024

Hi Gabor,

that looks good to me. Could you also add similar fix for assets?

Thanks,
Jozef

from lv_demos.

kisvegabor avatar kisvegabor commented on June 8, 2024

Good point. I've updated the assets too.

from lv_demos.

roddehugo avatar roddehugo commented on June 8, 2024

Hi,

First, thanks for the work @kisvegabor! I've just discovered this library and it is something I've been looking for, for a long time.

Concerning this issue, in my current setup, I want a configuration file per application (a source file with main.c plus a lv_conf.h and a lv_drv_conf.h by its side). But all my applications share the same submodules, in this case, LittlevGL submodules like lvgl, lv_drivers, and lv_examples.

Hence, here, shouldn't it be LV_LVGL_H_INCLUDE_SIMPLE instead? Like in lv_drivers? Otherwise, my setup does work for drivers but not for examples.

In lv_drivers:

/*********************
 *      INCLUDES
 *********************/
#ifndef LV_DRV_NO_CONF
#ifdef LV_CONF_INCLUDE_SIMPLE
#include "lv_drv_conf.h"
#else
#include "../../lv_drv_conf.h"
#endif
#endif

#if USE_EVDEV

#ifdef LV_LVGL_H_INCLUDE_SIMPLE
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#endif

/*********************
 *      DEFINES
 *********************/

In lv_examples:

/*********************
 *      INCLUDES
 *********************/
#ifdef LV_CONF_INCLUDE_SIMPLE
#include "lvgl.h"
#include "lv_ex_conf.h"
#else
#include "../../../lvgl/lvgl.h"
#include "../../../lv_ex_conf.h"
#endif

#if LV_USE_TESTS

/*********************
 *      DEFINES
 *********************/

Thanks,
Hugo

from lv_demos.

roddehugo avatar roddehugo commented on June 8, 2024

Actually, I have found several issues with the includes in this repository, on the master branch already. I wrote patches to apply locally. Is it something you are interested in? I can file a PR.

Here are the issues I encountered on my way:

  1. the way lvgl.h include is handled here is not consistent with lv_drivers
  2. so I basically applied the same schema in every include in lv_examples, for instance, in lv_test_obj.h, this patch is applied:
+#ifndef LV_EX_NO_CONF
 #ifdef LV_CONF_INCLUDE_SIMPLE
-#include "lvgl.h"
 #include "lv_ex_conf.h"
 #else
-#include "../../../lvgl/lvgl.h"
 #include "../../../lv_ex_conf.h"
 #endif
+#endif

 #if LV_USE_TESTS

+#ifdef LV_LVGL_H_INCLUDE_SIMPLE
+#include "lvgl.h"
+#else
+#include "lvgl/lvgl.h"
+#endif
+
  1. it works fine, except for the tests that rely on the activation of features via LV_USE_*, like in lv_test_cont.h, we can find this line #if LV_USE_CONT && LV_USE_TESTS. But, with the above patch, lvgl.h comes after the #if, hence compiler complains LV_USE_CONT is not defined... I could have put it before, but then it would still be inconsistent with the way it is done in lv_drivers. So I opted for another approach, since there is main lv_examples.h that include lvgl.h. Here is the new patch for lv_test_obj.h, that also work for lv_test_cont.h:
+#include "../../../lv_examples.h"
+
+#ifndef LV_EX_NO_CONF
 #ifdef LV_CONF_INCLUDE_SIMPLE
-#include "lvgl.h"
 #include "lv_ex_conf.h"
 #else
-#include "../../../../lvgl/lvgl.h"
 #include "../../../../lv_ex_conf.h"
 #endif
+#endif

 #if LV_USE_CONT && LV_USE_TESTS

with lv_examples.h being patched with:

-#include "../lvgl/lvgl.h"
+#ifdef LV_LVGL_H_INCLUDE_SIMPLE
+#include "lvgl.h"
+#else
+#include "lvgl/lvgl.h"
+#endif
  1. great that works as expected, but know I have not activated LV_USE_DEMO, and #if order in makes compiler complains about LV_DEMO_WALLPAPER not being defined, with -Wundef flag:
img_bubble_pattern.c:4:5: error: 'LV_DEMO_WALLPAPER' is not defined

I just switched the condition order like this:

-#if LV_DEMO_WALLPAPER && LV_USE_DEMO
+#if LV_USE_DEMO && LV_DEMO_WALLPAPER

and it works fine!

  1. I am happy, now my setup works great, and lv_examples behaves like lv_drivers, which is a good sign of coherence in the library.

FYI: For 4., I'll file a PR; what do you think of 3.?

Have a great Monday,
Hugo

from lv_demos.

kisvegabor avatar kisvegabor commented on June 8, 2024

Hi Hugo,

Ups, really there are some inconsistencies here. Thank you for pointing it out.

As the examples are displayed in the documentation too so it'd be important to keep the "header" part short.

As master will be replaced soon with rework-7 let's see what are the issue there.
I pushed a fix to solve the issue you have mentioned in your first comment. 5fd053b

Does dev-7.0 of lvgl works normally now with rework-7 of lv_examples?

from lv_demos.

kisvegabor avatar kisvegabor commented on June 8, 2024

I am actually working with master here for a professional project I am involved in. It is actually the beginning of it and you will likely hear from me again :)

Looking forward to it! 🙂

from lv_demos.

kisvegabor avatar kisvegabor commented on June 8, 2024

It seems all working for v7.0, so I close this issue,

from lv_demos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.