-
Notifications
You must be signed in to change notification settings - Fork 428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lv_examples: Add Kconfig to lv_examples and choose an example to run on the menuconfig interface #196
Conversation
…on the menuconfig interface
Add the necessary header file of the choosen example on the menuconfig interface and run it. Some extra configuration might be needed on some examples, like the keypad and encoder demo.
Currently all the demos source files are included, I think we should include only the source of the selected demo, what do you think? |
components/lv_examples/lv_ex_conf.h
Outdated
@@ -16,7 +16,7 @@ | |||
/******************* | |||
* GENERAL SETTING | |||
*******************/ | |||
#define LV_EX_PRINTF 1 /*Enable printf-ing data in demoes and examples*/ | |||
#define LV_EX_PRINTF CONFIG_LV_EX_PRINTF /*Enable printf-ing data in demoes and examples*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(This applies to all the changes in lv_ex_conf.h
.)
As far as I know, Kconfig does not define unselected options to 0; it just doesn't define them at all. I'm not sure how the statement #if LV_EX_PRINTF
will be affected by this. It might be better to use a code pattern like this:
#define LV_EX_PRINTF CONFIG_LV_EX_PRINTF /*Enable printf-ing data in demoes and examples*/ | |
/*Enable printf-ing data in demoes and examples*/ | |
#ifdef CONFIG_LV_EX_PRINTF | |
#define LV_EX_PRINTF 1 | |
#else | |
#define LV_EX_PRINTF 0 | |
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're totally right @embeddedt, I forgot about that, will commit your suggestion. I think the same applies for the other choice symbols (demo to run), isn't?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the pattern I use in the new lv_conf_internal.h:
https://github.com/lvgl/lvgl/blob/1c96215db9ec9d3de0dd10c2403e124cbb4a8dd6/src/lv_conf_internal.h#L107
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure but I think we would need to include the ESP-IDFs sdkconfig.h
file to be able to use the CONFIG_x symbols. I will try removing that include on the current lv_config
file and see what happens.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's needed we can use LV_CONF_PATH to include any file instead of lv_conf.h
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I will test it too, yesterday I forgot to push the fixes for @embeddedt comment, will do it later.
I've tested choosing the widgets and benchmark demos and they work as expected, when selecting the stress demo I'm getting a hardfault, it's an
I haven't updated LVGL to test if the problem is gone with the current master. |
LVGL log output:
Based on the log output I think the issue can be found around here: |
Found the issue in /*Align the pattern to the middle*/
int32_t ofs_x = (lv_area_get_width(coords) - (lv_area_get_width(coords) / img_w) * img_w) / 2;
int32_t ofs_y = (lv_area_get_height(coords) - (lv_area_get_height(coords) / img_h) * img_h) / 2;
else if(src_type == LV_IMG_SRC_SYMBOL) {
lv_draw_label_dsc_init(&label_dsc);
label_dsc.color = dsc->pattern_recolor;
label_dsc.font = dsc->pattern_font;
label_dsc.opa = dsc->pattern_opa;
lv_point_t s;
_lv_txt_get_size(&s, dsc->pattern_image, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX,
LV_TXT_FLAG_NONE);
img_w = s.x;
img_h = s.y;
} |
Looks like a letter is missing from the font, so the returned size is 0 on at least one axis. I suppose we should bail out of |
Is there a way to find out what letter is it? I'm using the monospaced font. |
I think |
Thanks, I will try it with another microcontroller, I don't have a debugger for the esp32 at the moment. |
@embeddedt, changed the default font for the stress demo to montserrat 14 and the problem is gone, so the issue appear to be on the unscii 8 font. Taking a look at the log output above we can see a bunch of |
@embeddedt, @kisvegabor I think we can merge this and fix the hardfault on either lvgl or lv_examples, what do you think? |
I agree. Regarding the hard fault see this comment. |
Ok, I will merge this, but the fix went into lvgl master and we're using the release/v7 branch on here, should we track the master branch? |
The fix is in v7.5 so |
@embeddedt, thanks for the clarification :) |
New try with the updated
lv_examples
, decided to leave the following options out of the menuconfig:because they are not intended to be used on ESP32, what do you think @kisvegabor.