Skip to content
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

Update lvgl 8.3.11 #47

Merged
merged 95 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
f28a27f
fix(sdl): destroy texture after use if not stored in cache (#4173)
mariotaku May 8, 2023
fee3cd5
fix(img): fix getting the image type on big endian systems (#4215)
jadergn May 9, 2023
7258563
fix(flex): register LV_STYLE_FLEX_GROW
kisvegabor May 10, 2023
c83ba86
fix(disp): fix memory leak lv_scr_load_anim with auto_del and time=0
kisvegabor May 18, 2023
ea13b5d
fix(msgbox): add missing lv_obj_class_init_obj
kisvegabor May 18, 2023
0fd7d81
fix(msgbox): fix typo
kisvegabor May 18, 2023
69087ed
perf(pxp, vglite): improve performance and add more features (#4222)
nicusorcitu May 18, 2023
f909cf7
fix(chart): fix division by zero if there are no ticks
kisvegabor May 19, 2023
edf7e58
fix(bidi): add more Hebrew checks to RTL characters set (#4171) (#4239)
lorenzo-arena May 24, 2023
54b030a
fix(arduino): fix messed up variable types
kisvegabor May 24, 2023
4d4b286
fix(png): fix decode image size and some warnings (#4248)
lorenzo-arena May 29, 2023
1e2a540
fix(btnmatrix): fix using > 7 as button width
kisvegabor May 31, 2023
3e7ff2a
add(gpu): add renesas-ra6m3 gpu adaptation (#4270)
Rbb666 Jun 8, 2023
a7eb4dd
fix(stm32): static function prototypes moved from .h to .c (#4276)
jacquesdmernok Jun 12, 2023
58b5258
add(docs): add renesas-ra6m3 get-started document (#4278)
Rbb666 Jun 12, 2023
38c549d
fix:(BtnMatrix) Backport https://github.com/lvgl/lvgl/pull/4185
pete-pjb Jun 16, 2023
9197c5d
Revert "fix:(BtnMatrix) Backport https://github.com/lvgl/lvgl/pull/4185"
pete-pjb Jun 16, 2023
8888350
fix:(BtnMatrix) Backport https://github.com/lvgl/lvgl/pull/4185
pete-pjb Jun 16, 2023
6b7f085
fix(btnmatrix): fix array out of bounds addressing with groups and no…
kisvegabor Jun 19, 2023
9bf2fe8
feat(rt-thread): make the rt-thread env recursively glob the UI files
kisvegabor Jun 20, 2023
b39a8bd
docs(faq): don't say 24 bit is support as LVGL can't render in RGB888…
kisvegabor Jun 23, 2023
4d5d22a
docs: mention incompatibility between software rotation and `direct_m…
kolliemo Jun 23, 2023
ae89c7d
fix(tabview): remove the animation if the tab is selected by clicking…
kisvegabor Jun 26, 2023
b687470
example(tabview): fix tabview disable scrollig example
kisvegabor Jun 26, 2023
9b27cd1
demos: add lv_demo_..._close() functions for each demo
kisvegabor Jul 4, 2023
0fc5568
chore(cmsis-pack): update cmsis-pack for v8.3.8 (#4340)
GorgonMeducer Jul 5, 2023
d9d2bf7
docs: update changelog
kisvegabor Jul 5, 2023
aad14e3
fix(obj) prevent hidden objects keeping focus
Jul 10, 2023
3b359b7
fix(indev): fix warnings when loggin coordinates is enabled
Jul 10, 2023
60be520
chore(music demo) fix formatting
Jul 10, 2023
351b50b
fix(tabview): fix warning
kisvegabor Jul 10, 2023
d832932
chore: format code
kisvegabor Jul 10, 2023
d00d0fc
fix(btnmatrix): Hide button matrix when all buttons hidden
Jul 12, 2023
fb70c51
fix(btnmatrix): Fix typo in previous commit!
Jul 12, 2023
56a3c5b
fix(imgbtn): support LV_OBJ_FLAG_CHECKABLE
kisvegabor Jul 14, 2023
d7b94e3
fix(chart): fix lv_chart_get_point_pos_by_id
kisvegabor Jul 15, 2023
02e7c86
fix(font): fix optimizer issue in lv_font_fmt_txt.c (#4385)
the-programmer Jul 21, 2023
576cc2c
fix(attr): refactor LV_ATTRIBUTE_* for function attributes (#4404)
fronders Jul 25, 2023
c1f508a
fix(config): fix typo in LV_USE_PERF_MONITOR and LV_USE_MEM_MONITOR (…
fronders Jul 25, 2023
b7317e3
fix(decoder): fix LV_IMG_CF_ALPHA_8BIT bin file decoder (#4406)
XuNeo Jul 26, 2023
a03899d
docs(disp): metined that rotation rotates the touch coordinates too
kisvegabor Jul 28, 2023
08add38
fix: use const lv_img_dsc_t * dsc function parameter in lv_img_buf.h/
kisvegabor Aug 1, 2023
a35ead5
chore(cmsis-pack): prepare for release v8.3.9 (#4424)
GorgonMeducer Aug 6, 2023
ca5c1fa
docs: update changelog
kisvegabor Aug 6, 2023
3e204db
fix(btnmatrix): fix tapping just outside a button in a buttonmatrix
BurkerA Aug 9, 2023
c408e99
docs(simulator): remove SDL support from the Visual Studio project
kisvegabor Aug 13, 2023
5a0979e
fix(dropdown): position to the selected item in lv_dropdown_set_selected
kisvegabor Aug 25, 2023
e467feb
ci(dropdown): fix test
kisvegabor Aug 25, 2023
455cace
ci: update screenshot compare from v9 to automatically create missing…
kisvegabor Aug 25, 2023
de8d1e9
fix(sdl): add missing parameter in lv_draw_sdl_composite_texture_obta…
ONLYA Aug 25, 2023
e9383b6
demo(sress): fix issues when the stress test is opened/clsoed multipl…
kisvegabor Aug 27, 2023
cf68880
feat(disp): add double buffered direct-mode efficient sync algorithm …
bhspyder Aug 29, 2023
181400e
docs(calendar): update according to v8.2 changes
kisvegabor Aug 30, 2023
d3fc711
Update screen object opacity function documentation (#4505)
ONLYA Aug 31, 2023
8779d6e
feat(style): backport opa_layered
FASTSHIFT Aug 14, 2023
75e53ee
fix: do not copy invalid areas if not double buffered mode (#4526)
lukasz-skalski Sep 7, 2023
50c6a84
fix(docs): dropdown: fix function name in description of static optio…
kolliemo Sep 8, 2023
d87242b
fix: build on Windows (MinGW environment) (#4538)
defogprog Sep 8, 2023
441ebbe
fix(refr): fix single buffered direct mode
kisvegabor Sep 8, 2023
b1c5a4c
fix(vglite): be sure end_angle > start_angle in arc drawing
kisvegabor Sep 14, 2023
d150e93
chore: code formatting
kisvegabor Sep 14, 2023
2d29ab7
chore(cmsis-pack): create cmsis-pack for v8.3.10 (#4572)
GorgonMeducer Sep 20, 2023
e36686a
release v8.3.10
kisvegabor Sep 20, 2023
9d604a6
fix(btnmatrix): set LV_BTNMATRIX_BTN_NONE when clicking of disabled b…
gbuss79 Sep 21, 2023
347e5c2
fix(dropdown): reset char_i = 0, avoid access overflow (#4589)
eYoung8475 Sep 24, 2023
f3abf60
fix(dropdown): avoid partial match in lv_dropdown_get_option_index (#…
eYoung8475 Sep 26, 2023
b4324eb
docs(label): update text for recoloring (#4606)
C47D Sep 27, 2023
dacc412
fix(draw): fix compiler error in lv_draw_sw_transform.c #2 (#4612)
C47D Sep 29, 2023
6116aae
chore(lv_draw_sw_letter.c): Fix print format (#4615)
C47D Oct 2, 2023
6d6de64
chore: fix compile error
kisvegabor Oct 2, 2023
a080a8f
fix(draw): fix scaling rectangle parts with opa
kisvegabor Oct 2, 2023
9073f75
docs(obj): fix wording (#4625)
hermitsoft Oct 4, 2023
de78397
backport: fix(lv_disp): fix lv_scr_load_anim being called twice quick…
faxe1008 Oct 6, 2023
badb39e
fix: fix warning in lv_draw_sw_letter.c
kisvegabor Oct 6, 2023
7e4f8be
STM32U5 DMA2D support (8.3) (#4643)
tdjastrzebski Oct 10, 2023
911e0fb
docs: fix typo
kisvegabor Oct 13, 2023
c7b01fd
fix(meter): fix minor issues (#4657)
vwheeler63 Oct 16, 2023
b14f324
fix(arc): handle click outside background angle range (#4586) (#4667)
C47D Oct 19, 2023
79ff179
feat(littlefs): add lv_fs_littlefs system as a driver (#4677)
hermitsoft Oct 20, 2023
7b77457
fix(draw_needles): changed needle line draw start point from scale ce…
1saeed Oct 23, 2023
3263046
chore(cmake): add support for user-specified lv_conf.h path (#4689)
Lion-Yu-Bro Oct 23, 2023
484af92
fix(arc): fix setting value by click
kisvegabor Oct 25, 2023
d365577
fix(ime_pinyin): keep cursor in the textarea when a candidate is pres…
Nov 2, 2023
7948ff7
feat(tiny_ttf): backport Tiny TTF to lvgl 8 (#4727)
niklasf Nov 2, 2023
b77fad5
feat(table): add user_data to table cells (#4767)
strijar Nov 8, 2023
9b646ad
fix(table) user data API functions renamed (#4769)
strijar Nov 10, 2023
ac5c08d
fix(table):fix issue with abnormal string output of 'lv_table_set_cel…
Nov 14, 2023
a6580c3
fix(obj): fix arduino compile warnings (#4807)
XuNeo Nov 14, 2023
8cf3017
fix(keyboard): add '&' character
kisvegabor Nov 23, 2023
12be8f0
fix(rt-thread): fix create lvgl thread problem (#4862)
mysterywolf Nov 26, 2023
8091ade
fix(obj): readjust scroll after layout when child removed (#4921)
niklasf Dec 4, 2023
0842196
fix(disp): fix infinite recursive SCREEN_LOADED events
kisvegabor Dec 5, 2023
13ae22c
fix(qrcode): use LV_ASSERT instead of assert
kisvegabor Dec 6, 2023
22df7b7
chore(cmsis-pack): prepare for v8.3.11 (#4936)
GorgonMeducer Dec 6, 2023
45b9c36
release v8.3.11
kisvegabor Dec 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,16 @@ menu "LVGL configuration"
Must be defined to include path of CMSIS header of target processor
e.g. "stm32f769xx.h" or "stm32f429xx.h"

config LV_USE_GPU_RA6M3_G2D
bool "Enable RA6M3 G2D GPU."
config LV_GPU_RA6M3_G2D_INCLUDE
string "include path of target processor"
depends on LV_USE_GPU_RA6M3_G2D
default "hal_data.h"
help
Must be defined to include path of target processor
e.g. "hal_data.h"

config LV_USE_GPU_SWM341_DMA2D
bool "Enable SWM341 DMA2D GPU."
config LV_GPU_SWM341_DMA2D_INCLUDE
Expand Down Expand Up @@ -955,6 +965,17 @@ menu "LVGL configuration"
default 0
depends on LV_USE_FS_FATFS

config LV_USE_FS_LITTLEFS
bool "File system on top of LittleFS"
config LV_FS_LITTLEFS_LETTER
int "Set an upper cased letter on which the drive will accessible (e.g. 'A' i.e. 65)"
default 0
depends on LV_USE_FS_LITTLEFS
config LV_FS_LITTLEFS_CACHE_SIZE
int ">0 to cache this number of bytes in lv_fs_read()"
default 0
depends on LV_USE_FS_LITTLEFS

config LV_USE_PNG
bool "PNG decoder library"

Expand Down Expand Up @@ -991,6 +1012,13 @@ menu "LVGL configuration"
endmenu
endif

config LV_USE_TINY_TTF
bool "Tiny TTF library"
config LV_TINY_TTF_FILE_SUPPORT
bool "Load TTF data from files"
depends on LV_USE_TINY_TTF
default n

config LV_USE_RLOTTIE
bool "Lottie library"

Expand Down
26 changes: 20 additions & 6 deletions demos/benchmark/lv_demo_benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ LV_FONT_DECLARE(lv_font_benchmark_montserrat_16_compr_az);
LV_FONT_DECLARE(lv_font_benchmark_montserrat_28_compr_az);

static void monitor_cb(lv_disp_drv_t * drv, uint32_t time, uint32_t px);
static void scene_next_task_cb(lv_timer_t * timer);
static void next_scene_timer_cb(lv_timer_t * timer);
static void rect_create(lv_style_t * style);
static void img_create(lv_style_t * style, const void * src, bool rotate, bool zoom, bool aa);
static void txt_create(lv_style_t * style);
Expand Down Expand Up @@ -636,7 +636,7 @@ static lv_obj_t * scene_bg;
static lv_obj_t * title;
static lv_obj_t * subtitle;
static uint32_t rnd_act;

static lv_timer_t * next_scene_timer;

static const uint32_t rnd_map[] = {
0xbd13204f, 0x67d8167f, 0x20211c99, 0xb0a7cc05,
Expand Down Expand Up @@ -708,9 +708,21 @@ void lv_demo_benchmark(void)
benchmark_init();

/*Manually start scenes*/
scene_next_task_cb(NULL);
next_scene_timer_cb(NULL);
}

void lv_demo_benchmark_close(void)
{
if(next_scene_timer) lv_timer_del(next_scene_timer);
next_scene_timer = NULL;

lv_anim_del(NULL, NULL);

lv_style_reset(&style_common);

lv_obj_clean(lv_scr_act());

}

void lv_demo_benchmark_run_scene(int_fast16_t scene_no)
{
Expand Down Expand Up @@ -973,11 +985,13 @@ static void report_cb(lv_timer_t * timer)
}
}

static void scene_next_task_cb(lv_timer_t * timer)
static void next_scene_timer_cb(lv_timer_t * timer)
{
LV_UNUSED(timer);
lv_obj_clean(scene_bg);

next_scene_timer = NULL;

if(opa_mode) {
if(scene_act >= 0) {
if(scenes[scene_act].time_sum_opa == 0) scenes[scene_act].time_sum_opa = 1;
Expand Down Expand Up @@ -1014,8 +1028,8 @@ static void scene_next_task_cb(lv_timer_t * timer)

rnd_reset();
scenes[scene_act].create_cb();
lv_timer_t * t = lv_timer_create(scene_next_task_cb, SCENE_TIME, NULL);
lv_timer_set_repeat_count(t, 1);
next_scene_timer = lv_timer_create(next_scene_timer_cb, SCENE_TIME, NULL);
lv_timer_set_repeat_count(next_scene_timer, 1);

}
/*Ready*/
Expand Down
2 changes: 2 additions & 0 deletions demos/benchmark/lv_demo_benchmark.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ typedef void finished_cb_t(void);
**********************/
void lv_demo_benchmark(void);

void lv_demo_benchmark_close(void);

void lv_demo_benchmark_run_scene(int_fast16_t scene_no);

void lv_demo_benchmark_set_finished_cb(finished_cb_t * finished_cb);
Expand Down
13 changes: 11 additions & 2 deletions demos/keypad_encoder/lv_demo_keypad_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ static lv_obj_t * t2;

void lv_demo_keypad_encoder(void)
{
g = lv_group_create();
lv_group_set_default(g);
g = lv_group_get_default();
if(g == NULL) {
g = lv_group_create();
lv_group_set_default(g);
}

lv_indev_t * cur_drv = NULL;
for(;;) {
Expand Down Expand Up @@ -76,6 +79,12 @@ void lv_demo_keypad_encoder(void)
msgbox_create();
}

void lv_demo_keypad_encoder_close(void)
{
lv_obj_clean(lv_scr_act());
lv_obj_clean(lv_layer_top());
}

/**********************
* STATIC FUNCTIONS
**********************/
Expand Down
1 change: 1 addition & 0 deletions demos/keypad_encoder/lv_demo_keypad_encoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ extern "C" {
* GLOBAL PROTOTYPES
**********************/
void lv_demo_keypad_encoder(void);
void lv_demo_keypad_encoder_close(void);

/**********************
* MACROS
Expand Down
25 changes: 24 additions & 1 deletion demos/music/lv_demo_music.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ static const uint32_t time_list[] = {
2 * 60 + 19,
};

#if LV_DEMO_MUSIC_AUTO_PLAY
static lv_timer_t * auto_step_timer;
#endif

static lv_color_t original_screen_bg_color;

/**********************
* MACROS
**********************/
Expand All @@ -113,14 +119,31 @@ static const uint32_t time_list[] = {

void lv_demo_music(void)
{
original_screen_bg_color = lv_obj_get_style_bg_color(lv_scr_act(), 0);
lv_obj_set_style_bg_color(lv_scr_act(), lv_color_hex(0x343247), 0);

list = _lv_demo_music_list_create(lv_scr_act());
ctrl = _lv_demo_music_main_create(lv_scr_act());

#if LV_DEMO_MUSIC_AUTO_PLAY
lv_timer_create(auto_step_cb, 1000, NULL);
auto_step_timer = lv_timer_create(auto_step_cb, 1000, NULL);
#endif
}

void lv_demo_music_close(void)
{
/*Delete all aniamtions*/
lv_anim_del(NULL, NULL);

#if LV_DEMO_MUSIC_AUTO_PLAY
lv_timer_del(auto_step_timer);
#endif
_lv_demo_music_list_close();
_lv_demo_music_main_close();

lv_obj_clean(lv_scr_act());

lv_obj_set_style_bg_color(lv_scr_act(), original_screen_bg_color, 0);
}

const char * _lv_demo_music_get_title(uint32_t track_id)
Expand Down
2 changes: 2 additions & 0 deletions demos/music/lv_demo_music.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ extern "C" {
**********************/

void lv_demo_music(void);
void lv_demo_music_close(void);

const char * _lv_demo_music_get_title(uint32_t track_id);
const char * _lv_demo_music_get_artist(uint32_t track_id);
const char * _lv_demo_music_get_genre(uint32_t track_id);
Expand Down
13 changes: 13 additions & 0 deletions demos/music/lv_demo_music_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,19 @@ lv_obj_t * _lv_demo_music_list_create(lv_obj_t * parent)
return list;
}


void _lv_demo_music_list_close(void)
{
lv_style_reset(&style_scrollbar);
lv_style_reset(&style_btn);
lv_style_reset(&style_btn_pr);
lv_style_reset(&style_btn_chk);
lv_style_reset(&style_btn_dis);
lv_style_reset(&style_title);
lv_style_reset(&style_artist);
lv_style_reset(&style_time);
}

void _lv_demo_music_list_btn_check(uint32_t track_id, bool state)
{
lv_obj_t * btn = lv_obj_get_child(list, track_id);
Expand Down
2 changes: 2 additions & 0 deletions demos/music/lv_demo_music_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ extern "C" {
* GLOBAL PROTOTYPES
**********************/
lv_obj_t * _lv_demo_music_list_create(lv_obj_t * parent);
void _lv_demo_music_list_close(void);

void _lv_demo_music_list_btn_check(uint32_t track_id, bool state);

/**********************
Expand Down
18 changes: 13 additions & 5 deletions demos/music/lv_demo_music_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ static void prev_click_event_cb(lv_event_t * e);
static void next_click_event_cb(lv_event_t * e);
static void timer_cb(lv_timer_t * t);
static void track_load(uint32_t id);
static void stop_start_anim(lv_timer_t * t);
static void stop_start_anim_timer_cb(lv_timer_t * t);
static void spectrum_end_cb(lv_anim_t * a);
static void album_fade_anim_cb(void * var, int32_t v);
static int32_t get_cos(int32_t deg, int32_t a);
Expand All @@ -84,6 +84,7 @@ static uint32_t spectrum_lane_ofs_start = 0;
static uint32_t bar_rot = 0;
static uint32_t time_act;
static lv_timer_t * sec_counter_timer;
static lv_timer_t * stop_start_anim_timer;
static const lv_font_t * font_small;
static const lv_font_t * font_large;
static uint32_t track_id;
Expand Down Expand Up @@ -232,8 +233,8 @@ lv_obj_t * _lv_demo_music_main_create(lv_obj_t * parent)

start_anim = true;

lv_timer_t * timer = lv_timer_create(stop_start_anim, INTRO_TIME + 6000, NULL);
lv_timer_set_repeat_count(timer, 1);
stop_start_anim_timer = lv_timer_create(stop_start_anim_timer_cb, INTRO_TIME + 6000, NULL);
lv_timer_set_repeat_count(stop_start_anim_timer, 1);

lv_anim_init(&a);
lv_anim_set_path_cb(&a, lv_anim_path_bounce);
Expand Down Expand Up @@ -292,6 +293,12 @@ lv_obj_t * _lv_demo_music_main_create(lv_obj_t * parent)
return main_cont;
}

void _lv_demo_music_main_close(void)
{
if(stop_start_anim_timer) lv_timer_del(stop_start_anim_timer);
lv_timer_del(sec_counter_timer);
}

void _lv_demo_music_album_next(bool next)
{
uint32_t id = track_id;
Expand Down Expand Up @@ -762,7 +769,7 @@ static void spectrum_draw_event_cb(lv_event_t * e)
lv_obj_t * obj = lv_event_get_target(e);
lv_draw_ctx_t * draw_ctx = lv_event_get_draw_ctx(e);

lv_opa_t opa = lv_obj_get_style_opa(obj, LV_PART_MAIN);
lv_opa_t opa = lv_obj_get_style_opa_recursive(obj, LV_PART_MAIN);
if(opa < LV_OPA_MIN) return;

lv_point_t poly[4];
Expand Down Expand Up @@ -990,10 +997,11 @@ static void spectrum_end_cb(lv_anim_t * a)
}


static void stop_start_anim(lv_timer_t * t)
static void stop_start_anim_timer_cb(lv_timer_t * t)
{
LV_UNUSED(t);
start_anim = false;
stop_start_anim_timer = NULL;
lv_obj_refresh_ext_draw_size(spectrum_obj);
}

Expand Down
2 changes: 2 additions & 0 deletions demos/music/lv_demo_music_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ extern "C" {
* GLOBAL PROTOTYPES
**********************/
lv_obj_t * _lv_demo_music_main_create(lv_obj_t * parent);
void _lv_demo_music_main_close(void);

void _lv_demo_music_play(uint32_t id);
void _lv_demo_music_resume(void);
void _lv_demo_music_pause(void);
Expand Down
31 changes: 23 additions & 8 deletions demos/stress/lv_demo_stress.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static void msgbox_del(lv_timer_t * tmr);
static void set_y_anim(void * obj, int32_t v);
static void set_width_anim(void * obj, int32_t v);
static void arc_set_end_angle_anim(void * obj, int32_t v);
static void obj_test_task_cb(lv_timer_t * tmr);
static void obj_test_timer_cb(lv_timer_t * tmr);

/**********************
* STATIC VARIABLES
Expand All @@ -34,6 +34,10 @@ static lv_obj_t * main_page;
static lv_obj_t * ta;
static const char * mbox_btns[] = {"Ok", "Cancel", ""};
static uint32_t mem_free_start = 0;
static lv_timer_t * obj_test_timer;
static int16_t state;
static lv_timer_t * msgbox_tmr;

/**********************
* MACROS
**********************/
Expand All @@ -45,23 +49,34 @@ static uint32_t mem_free_start = 0;
void lv_demo_stress(void)
{
LV_LOG_USER("Starting stress test. (< 100 bytes permanent memory leak is normal due to fragmentation)");
lv_timer_create(obj_test_task_cb, LV_DEMO_STRESS_TIME_STEP, NULL);
obj_test_timer = lv_timer_create(obj_test_timer_cb, LV_DEMO_STRESS_TIME_STEP, NULL);
state = -1;
}

void lv_demo_stress_close(void)
{
lv_timer_del(obj_test_timer);
obj_test_timer = NULL;
if(msgbox_tmr) {
lv_timer_del(msgbox_tmr);
msgbox_tmr = NULL;
}

lv_obj_clean(lv_scr_act());
lv_obj_clean(lv_layer_top());
}

/**********************
* STATIC FUNCTIONS
**********************/

static void obj_test_task_cb(lv_timer_t * tmr)
static void obj_test_timer_cb(lv_timer_t * tmr)
{
(void) tmr; /*Unused*/
static int16_t state = -1;

lv_anim_t a;
lv_obj_t * obj;

// printf("step start: %d\n", state);

switch(state) {
case -1: {
lv_res_t res = lv_mem_test();
Expand Down Expand Up @@ -246,8 +261,7 @@ static void obj_test_task_cb(lv_timer_t * tmr)

case 14:
obj = lv_msgbox_create(NULL, "Title", "Some text on the message box with average length", mbox_btns, true);

lv_timer_t * msgbox_tmr = lv_timer_create(msgbox_del, LV_DEMO_STRESS_TIME_STEP * 5 + 30, obj);
msgbox_tmr = lv_timer_create(msgbox_del, LV_DEMO_STRESS_TIME_STEP * 5 + 30, obj);
lv_timer_set_repeat_count(msgbox_tmr, 1);
lv_obj_align(obj, LV_ALIGN_RIGHT_MID, -10, 0);
break;
Expand Down Expand Up @@ -439,6 +453,7 @@ static void auto_del(lv_obj_t * obj, uint32_t delay)

static void msgbox_del(lv_timer_t * tmr)
{
msgbox_tmr = NULL;
lv_msgbox_close(tmr->user_data);
}

Expand Down
Loading
Loading